示例#1
0
require $_PHPLIB["libdir"] . "ct_sql.inc";
require $_PHPLIB["libdir"] . "session.inc";
require $_PHPLIB["libdir"] . "auth.inc";
require $_PHPLIB["libdir"] . "perm.inc";
require $_PHPLIB["libdir"] . "user.inc";
require "phplib/local.inc";
require $_PHPLIB["libdir"] . "page.inc";
global $myDB;
if (!is_object($myDB)) {
    $myDB = new DB_Linktrail();
    include "dbapi/sql_strs.inc";
    include "dbapi/sql_util.inc";
}
include "messages/bounce.inc";
//notify the user of the bounce
$address = decode_address($argv[1]);
if (isset($argv[2]) and $argv[2] == "o") {
    print "Debug: {$address}\n";
} else {
    $fp = fopen("/home/linktrai/bounce.log", "a");
    fputs($fp, "Doing bounce-code for: {$address} (" . strftime("%Y-%m-%d %H:%M:%S", time()) . ")\n");
    fclose($fp);
}
$hsh = get_bounce_state($address);
$flag = $hsh['BounceFlag'];
if ($flag == BOUNCE_ERR) {
    exit(0);
}
//no error code. This would lead to
//bounce being generated. -> loop
/* 
示例#2
0
function internet_address_parse_string($string)
{
    $inptr = $string;
    $nb_mail_in = 0;
    $nb_mail_out = 0;
    while ($inptr != false && strlen($inptr) > 0) {
        $start = $inptr;
        $nb_mail_in++;
        $addr = decode_address($inptr);
        if ($addr != false) {
            if (mb_formEmail($addr['addr'])) {
                $nb_mail_out++;
                $addrlist[] = $addr;
            }
        }
        decode_lwsp($inptr);
        if (strlen($inptr) > 0 && ($inptr[0] == ',' || $inptr[0] == ';')) {
            $inptr = substr($inptr, 1);
        } else {
            if (strlen($inptr) > 0) {
                $inptr = strchr($inptr, ',');
                if ($inptr != false) {
                    $inptr = substr($inptr, 1);
                }
            }
        }
    }
    if ($nb_mail_out > 0) {
        $retour = (object) NULL;
        $retour->diff = $nb_mail_in - $nb_mail_out;
        $retour->addrlist = $addrlist;
        return $retour;
    } else {
        return false;
    }
}