[Mimedefang] Adding boilerplate text for outgoing certaindomains only???

Jon Paterson JPaterson at itchannel.net
Tue Nov 5 11:46:01 EST 2002


Hi Rajesh, thanks very much for that.  I am trying to learn the code by
example, will this only select the outgoing mails, and if so, which part
of it "knows" that the mail is inbound and not outbound?


Thanks again,


Jon

-----Original Message-----
From: Rajesh Bhandari [mailto:BhandaR at mail.nlm.nih.gov] 
Sent: 05 November 2002 16:36
To: mimedefang at lists.roaringpenguin.com
Subject: Re: [Mimedefang] Adding boilerplate text for outgoing
certaindomains only???


> Jon Paterson asked
> I would like to add a boilerplate text message to outgoing mails only,

> and then, only from address's at a certain domain.

You could something like:
in filter_begin
------
sub filter_begin () {
        if (stream_by_domain()) {
                return;
        }
}
------
And then in filter_end
------
sub filter_end ($) {
    my($entity) = @_;

    my ($boilerplate) = "This is the boilerplate message.\n The slash n
starts a new line";

    if ( ($RelayAddr =~ "^192\.168\.10") && ($Sender =~
/your\.domain\.com/i )) {
               # Do boilerplate
               append_text_boilerplate($entity,$boilerplate, "0")
    }
}
---------
I haven't tried this, but it should work.

I don't use append_text_boilerplate so please check the syntax on that.
Use 'man mimedefang-filter'.  The boilerplate message is written into
the $boilerplate variable.  You can use \n's to create a multiline
message.  An example of this is the quarantine message in the mimedefang
example filter. Also, replace 192.168.10 with your subnet that your
internal mailserver resides on.

HTH,
Rajesh


_______________________________________________
MIMEDefang mailing list
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang




More information about the MIMEDefang mailing list