Problems with retrieving the header fields

Jacob d'Andrade jacob at andrade.dk
Wed Nov 9 14:05:53 CET 2011


Hi'

 

I'm trying to hack amavisd-new via amavisd-custom to get all Received lines
from the body headers. 

 

But I only get the "first" line, but I want all of them, so I can see the IP
addresses of the servers the email has passed, so I can determine if the
email is in or outbound.

 

I've tried this perl code:

 

sub checkInboundOutbound {

    my($msginfo) = @_;

    undef my $line;

    my @received_from = $msginfo->get_header_field_body('received');

    foreach $line (@received_from){

        do_log(-1, "############## INOUT: $line");

    }

}

 

Output:

Nov  9 14:03:02 amavis amavis[20237]: (20237-01) (!)############## INOUT:
by amavis.mydomain.com (Postfix, from userid 0)\n\time CCE60861; Wed,  9 Nov
2011 14:03:01 +0100 (CET)\n

 

Can anyone tell me what I'm doing wrong? Or what the fieldname is to the
rest of the lines?

 

Kind regards

Jacob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.amavis.org/pipermail/amavis-users/attachments/20111109/22b7f570/attachment.html>


More information about the amavis-users mailing list