[Mimedefang] Adding boilerplate text for outgoing certain domains only???

Rajesh Bhandari BhandaR at mail.nlm.nih.gov
Tue Nov 5 11:38:00 EST 2002


> 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





More information about the MIMEDefang mailing list