[Mimedefang] How can I get just the domain from $sender

Jonathan Maliepaard jon at enetworks.co.za
Tue Feb 22 10:52:52 EST 2005


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.




More information about the MIMEDefang mailing list