[Pymilter] Playing with quarantine and setmlreply

Stuart D. Gathman stuart at bmsi.com
Sat Aug 21 14:23:48 EDT 2004


I got sendmail-8.13.1 installed, and tried out quarantine with Python 
milter.

You must set Milter.QUARANTINE in the flags.
You can call Milter.Milter.quarantine(reason) from eom() only.
You must then return Milter.ACCEPT or CONTINUE.  Quarantine is a 
modification of normal delivery.  It goes into the queue to be delivered,
but marked as Quarantined, and is not delivered until unquarantined.

How does it get unquarantined?  The mailq command has options to list 
quarantined messages with the reason.  The sendmail command has options to 
unquarantine messages selected by reason.

What is this good for?  The obvious application is a TDMA scheme where
delivery is delayed while an autoreply asking for confirmation from a
human is sent.  (Be sure to check SPF before autoreplying.)  The reason
should contain an ID which can be used to unquarantine when the response
comes back.

Another topic:  I coded and did simple testing of the setmlreply call.  
The decision to use setreply or setmlreply is transparent to the Python 
code, for example:

         self.log('REJECT: %s: %s' % (name,val))
         self.setreply('550','5.7.1','Email advertising not accepted here.',
               "Please advertise on google where I'll read it when I want",
               'to buy something.'
         )
         return Milter.REJECT

If miltermodule.c was compiled with a sendmail that doesn't support
setmlreply, only the first line of the reply is used.  I'm not sure what
happens if miltermodule.c is compiled with setmlreply, but used with an
old sendmail.  I think that an error would be returned from setmlreply,
and perhaps miltermodule could fall back to setreply in that case.  I'm
not sure how important such a fallback would be.

-- 
	      Stuart D. Gathman <stuart at bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.




More information about the Pymilter mailing list