[Mimedefang] Removing redundant html part and header for one user incoming.

Lars Sorensen lars at daxzuli.com
Wed Mar 20 11:26:14 EDT 2013


On Mar 20, 2013, at 4:04 PM, David F. Skoll wrote:

> On Wed, 20 Mar 2013 15:52:02 +0100
> Lars Sorensen <lars at daxzuli.com> wrote:
> 
> =====================================================
> sub filter_begin {
>    open (IN, "<./COMMANDS");
>    while(<IN>) {
>        if(/R<email\@mydomain\.com>/i) {
>            action_delete_all_headers("X-Header-to-delete");
>            last;
>        }
>    }
>    close(IN);
> }
> =====================================================
> 
> Wow, that's going about it the hard way!  You should NEVER have to read
> ./COMMANDS yourself.  That can be replaced with one line:
> 
> action_delete_all_headers('X-Header-to-delete') if grep { /<email\@mydomain\.com>/i } @Recipients;
> 
>> Same thing for the "remove_redundant_html_parts($entity);"
>> The problem I was having, was looking for the recipient in the
>> HEADERS as opposed to the COMMANDS file, thereby missing when when
>> Bcc's and list email recipients was specified.
> 
> Use the @Recipients array to get the envelope recipients.
> 
> Regards,
> 
> David.

David,

Yeah, that looks a lot cleaner! ;)
Thank you very much for the help.

-Lars






More information about the MIMEDefang mailing list