[Mimedefang] Re: How to accept whole message at beginning

Yizhar Hurwitz yizhar at mail.com
Sat May 10 16:17:54 EDT 2008


HI.

> I'm trying to hack our mimedefang-filter so that mail from internal 
> machines or that is authed is accepted before any filtering occurs, but 
> after the body is received, so that I can add a header.  Before the 
> requirement to add a header popped up, I would check for internal 
> machines and authed users in filter-recipient and accept with no more 
> filtering.
>
>   
Since you probably consider skipping spamassassin check but maybe still 
virus scan outgoing mails,
the simple solution that I am using is just something like:


sub filter_end {
.....
    if (($Features{"SpamAssassin"}) and ($RelayAddr !~ /$SafeRelay/ )) {
        if (-s "./INPUTMSG" < 200*1024) {
..... 
 spamassassin check goes here
....

This is similar to blindly accepting the mail (but it's better), because 
SA checks are those that make the delay normally.

In my case $SafeRelay is localhost + internal hosts if applicable, 
because I don't allow authenticated relay from outside.
You can simply modify my example to suite your needs - for example check 
for SMTP AUTH.

Yizhar Hurwitz
http://yizhar.mvps.org




More information about the MIMEDefang mailing list