Re: filter on header From:

Kris Deugau <[email protected]>
Newsgroups gmane.mail.mimedefang
Organization Vianet Internet Solutions
Message-ID <[email protected]>
Marcus Schopen wrote:
> Hi Kris,
>
> Am Montag, den 08.05.2017, 11:13 -0400 schrieb Kris Deugau:
>> if ($hashfile{$fromaddr}) {
>>    action_add_header("SpecialHeader", "$fromaddr found in list");
>> }
>>
>
> Ah, good idea. Thanks!
>
> But if I just add this to filter_end
>
>   action_add_header("X-SpecialHeader", "$fromAddr test");
>
> to read out $fromAddr, the variable is empty in my case.

You would have to fill it in first, by extracting it from the 
MIME::Entity passed to the filter_end sub;  something like (untested, 
check MIME::Tools documentation):

$fromaddr = $entity->head->get('From');
$fromaddr =~ s/.+<([^>]+)>/$1/;

If you just want to test, you can try $Sender instead, which is the 
envelope sender.

See the man page for mimedefang-filter to see which globals are provided.

-kgd
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.