dlmtp perl api
Communicate with dspam daemon from a different pc, and use any
dspam options you want, not just one set of options in dspam.conf
in ServerParameters as you would be constrained to do via plain
lmtp.
Required: 3.6.2 dspam(3.5.2 dspam seg faults after perl dlmtp)
/etc/dspam/dspam.conf
LocalMX 192.168.1.35
ServerMode auto
ServerPass.here "secret"
ClientIdent "secret@here"
ClientPort 24
Here's how it goes on the perl side in qpsmtpd--
$lmtp = Net::LMTP->new(
'192.168.1.35' , 24 ,
Timeout=>60 ,
Hello => 'here' ) ;
if ( $lmtp ) {
$lmtp->_MAIL ( 'FROM: <secret@here>'
. 'DSPAMPROCESSMODE="--mail-from=' . $sender
. ' --deliver=innocent,spam -d %u"' ) ;
# DSPAMPROCESSMODE="[any dspamc options]"
# ...possibly: --classify=spam --source=error !!!
# the first mail from has <>, but the second one,
# after --mail-from, does NOT. dspam takes the
# first from address as dlmtp ident when it sees
# DSPAMPROCESSMODE, then rewrites the from
# address according to --mail-from user@dom.tld
# DSPAMPROCESSMODE="double quoted", and don't
# forget perl has a hard time with @, so either generate
# @ by a sub, or have it in a variable, or single
# quote it, or escape @ if double quoted(if not
# single quoted inside the double quotes).
$lmtp->to( $to ) ;
# previous line is redundant, but dspam waits/blocks for it
$lmtp->data ;
$lmtp->datasend( $transaction->header->as_string ) ;
$transaction->body_resetpos ;
$lmtp->datasend( $line )
while $line = $transaction->body_getline ;
$lmtp->dataend ;
$lmtp->quit ;
}
-Bob D
Received on Mon Dec 12 23:04:58 2005
This archive was generated by hypermail 2.1.8 : Wed Dec 14 2005 - 00:00:01 EST