[imp] horde/lib/MIME/Headers.php

Frode Tviberg frode.netcom at tviberg.com
Sun Mar 23 10:26:13 PST 2003


Hi!

I found out that you put a TAB in the Received header.
A qmail-scanner (virus-scanner) will stop this - because the
TAB is an illegal MIME-character in the header.
Is there anyway to 'strip' this?

Under is what I had to do to get this to work - its pretty fast and
not pretty...

-ftr-

    function addReceivedHeader()
    {
        if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            /* This indicates the user is connecting through a proxy. */
            $remote_path = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
            $remote_addr = $remote_path[0];
            $remote = gethostbyaddr($remote_addr);
        } else {
            $remote_addr = $_SERVER['REMOTE_ADDR'];
            if (empty($_SERVER['REMOTE_HOST'])) {
                $remote = gethostbyaddr($remote_addr);
            } else {
                $remote = $_SERVER['REMOTE_HOST'];
            } 
        }
        $received = 'from ' . $remote . ' (';

        /*if (!empty($_SERVER['REMOTE_IDENT'])) {
            $received .= $_SERVER['REMOTE_IDENT'] . '@' . $remote . ' ';
        } elseif ($remote != $_SERVER['REMOTE_ADDR']) {
            $received .= $remote . ' ';
        }
        $received .= '[' . $remote_addr . ']) ';
        $received .= 'by ' . $GLOBALS['conf']['server']['name'] . ' (Horde) 
with HTTP ';
      
        $user = Auth::getAuth();
        if (strpos($user, '@') === false) {
            $user .= '@' . $GLOBALS['conf']['server']['name'];
        }
        $received .= 'for <' . $user . '>; ' . date('r');
*/   
        $this->addHeader('Received', $received);
    }



-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/


More information about the imp mailing list