[Mimedefang] splitting traffic

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Fri Aug 10 02:45:09 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 9 Aug 2007, John Rudd wrote:

> I want to take my incoming traffic to my mimedefang boxes and split the 
> traffic so that an exact copy of the original pre-scanned messages goes to my 
> test machines.

I don't understand, your "changes" below (effecting envelope data) in
conjunction with the requirement "exact copy of the original pre-scanned
messages".

> I want to:
>
>  a) replace the sender information with a local address (that goes to 
> /dev/null)
>
>  b) remove any non-local recipients (and if there's none left after that, 
> then drop the split message)
>
>  c) replace local recipients with $userpart at my-test-box
>
> But not disturb the original message in anyway.

If these three items mean the envelope information, don't worry, you'll 
create a new message. Simply use the resend_message() function and prepare 
the array of recipients from the @Recipients, but fake $Sender before 
calling the function.

However, I'd rather using Net::SMTP directly:
$smtp = Net::SMTP->new($test_host);
if($smtp) {
 	$smtp->mail('nobody at ...');	# MAIL FROM
 	$smtp->to(@{$sendMail}, { Notify => ['NEVER'] }); # RCPT TO
         $smtp->data();		# Init DATA phase
 	while(<INPUTMSG>) {
            $smtp->datasend($_);
 	}
         $smtp->dataend();
 	$smtp->quit();
}

You can re-use an existing connection (no new and quit), but you should 
issue reset() before mail(), just in case there was a problem in the last 
transmission.

However, you'll loose many information good for SPAM checking, e.g. 
original sending host, original sender.

Bye,

- -- 
Steffen Kaiser
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iQEVAwUBRrwJd+gJIbZtwg6XAQLPiwf/Tn3e0pnJnvItbfkxoVa6LWsgs82I7IP2
wFItAyZzTunbBY2WXve7fmiR0GG/v5pbppVfAUT0LIJKCxQvHQdvr8w8hAh1kNLs
4AG/gGXWY4tkWsjsf93+im6hgultcDlm24o14roy9Z1qXe1ZfCY4wY9m3vK0MxjS
TkSVyfs9nZ8Yhng8dcEVDqiE8dXOIRwheD5QslvEoiwgi+0wQcNzwmCVZUm2zWhA
cW1+OnpkuKhjLRLVLbPqWvNJbXjsLnaPYwTVYN2EdIoy4oUjWXqlGZdJrN+DhiAo
STDxQeYyKpk/4tTcQjPXW3Yn8HfthUPruu6voL9ocoqh/35v3BJ6PA==
=Mylc
-----END PGP SIGNATURE-----



More information about the MIMEDefang mailing list