One of my customers wants to replace all attachs in internal mail (the
sender and all the recipients are in the local domain) greather than
300k with a link to the internal webserver, in order to save diskspace
in the mail server.

I think I can do that with replace_with_url, I was thinking something
along the lines of:

if ($Sender =~/[EMAIL PROTECTED]>?$/) {
    $localmail=1;
LOOP:   foreach $rcpt (@recipients) {
        if ($rcpt !~ /[EMAIL PROTECTED]>?$/) {
            $localmail=0;
            last LOOP;
        }
    }
}

if ($localmail==1) {
    $size = (stat($entity->bodyhandle->path))[7];
    if ($size > 500000) {
        return action_replace_with_url($entity,
            "/usr/local/www/data/mailattachs/",
            "http://www.localdomain.com//mailattachs";,
            "Your attach was for internal personnel only".
                        "and it was bigger then 500k. To see it,".
                        "please click here \n\n\t_URL_\n");
    }
}

So my questions are:

1) does it look good?
2) where should I put it? in filter()? after all the other filtering was
done?
3) is there any other way to do it?

Thanks in advance




                                Fer
_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to