oh and while i think about it, beware of < > around the email address

my $newsender=$Sender;
$newsender =~ s/<//gi;
$newsender =~ s/>//gi;
my ($sendusername, $senddomain) = split('@', $Sender);


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mack
Sent: Tuesday 22 February 2005 15:57
To: [email protected]
Subject: RE: [Mimedefang] How can I get just the domain from $sender


my ($sendusername, $senddomain) = split('@', $Sender);

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Jonathan Maliepaard
Sent: Tuesday 22 February 2005 15:53
To: [email protected]
Subject: [Mimedefang] How can I get just the domain from $sender


Hi

Apologies up front for my sad lack of perl, I am sure this is a trivial
request. 

I have to add a disclaimer as an attachment to all outgoing emails on my
server. I managed to do this but the disclaimer is added to all mail (in
and out)

I want to be able to add the disclaimer only if the domain = abc.com I
can get the whole mail address from $sender but I do not know how to use
perl to strip just the domain from this. Or is there another way?

If someone can give me an example on how to test for the domain then use
that variable in some kind of if-then-else statement to add the
disclaimer it would be most appreciated.

I have the example from the manual:

sub filter_end {
        my($entity) = @_;
        # If we have both plain-text and HTML, nuke the HTML 
        remove_redundant_html_parts($entity);
        # Sigh... lawyers insist on this
        if (message_is_outgoing()) {
        append_text_boilerplate($entity,'Silly legal boilerplate', 0);
        append_html_boilerplate($entity,'<em>Silly</em> legal
boilerplate', 0);
        }
}

I need help with the "message_is_outgoing" definition please

Thanks

Jon.

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

This Email Has Been Anti-Virus Scanned


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

This Email Has Been Anti-Virus Scanned


_______________________________________________
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