X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fsmtp.php;h=830b14ec36e393b2c557df6ae960e386dada297b;hb=4b920601138434546a98d0e3b2150fbc0a8c13b0;hp=ad55611525c867802d4e5a7c4cf2504e17894fbb;hpb=b68edc750e3b478f5302681e8fbd289b17447550;p=squirrelmail.git diff --git a/functions/smtp.php b/functions/smtp.php index ad556115..830b14ec 100644 --- a/functions/smtp.php +++ b/functions/smtp.php @@ -279,14 +279,28 @@ function timezone () { /* Print all the needed RFC822 headers */ function write822Header ($fp, $t, $c, $b, $subject, $body, $more_headers, $session, $rn="\r\n") { - global $REMOTE_ADDR, $SERVER_NAME, $REMOTE_PORT; - global $data_dir, $username, $popuser, $domain, $version, $useSendmail; - global $default_charset, $HTTP_VIA, $HTTP_X_FORWARDED_FOR; - global $REMOTE_HOST, $identity; + global $data_dir, $username, $popuser, $domain, $version, $useSendmail, + $default_charset, $identity, $_SERVER; /* Storing the header to make sure the header is the same * everytime the header is printed. */ + + /* get those globals */ + $REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; + $SERVER_NAME = $_SERVER['SERVER_NAME']; + $REMOTE_PORT = $_SERVER['REMOTE_PORT']; + + if(isset($_SERVER['REMOTE_HOST'])) { + $REMOTE_HOST = $_SERVER['REMOTE_HOST']; + } + if(isset($_SERVER['HTTP_VIA'])) { + $HTTP_VIA = $_SERVER['HTTP_VIA']; + } + if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { + $HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR']; + } + static $header, $headerlength, $headerrn; if ($header == '') { @@ -787,14 +801,14 @@ function errorCheck($line, $smtpConnection, $verbose = false) { } if ($status == 0) { - include_once('../functions/page_header.php'); + include_once(SM_PATH . 'functions/page_header.php'); if ($compose_new_win == '1') { compose_Header($color, 'None'); } else { displayPageHeader($color, 'None'); } - include_once('../functions/display_messages.php'); + include_once(SM_PATH . 'functions/display_messages.php'); $lines = nl2br(htmlspecialchars($lines)); $msg = $message . "
\nServer replied: $lines"; plain_error_message($msg, $color);