[Mimedefang] How can I get just the domain from $sender
Mack
roaringpenguin.com at bass-speaker.com
Tue Feb 22 10:56:39 EST 2005
my ($sendusername, $senddomain) = split('@', $Sender);
-----Original Message-----
From: mimedefang-bounces at lists.roaringpenguin.com
[mailto:mimedefang-bounces at lists.roaringpenguin.com]On Behalf Of
Jonathan Maliepaard
Sent: Tuesday 22 February 2005 15:53
To: mimedefang at lists.roaringpenguin.com
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
MIMEDefang at lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
This Email Has Been Anti-Virus Scanned
More information about the MIMEDefang
mailing list