[Pymilter] Unknown command and further processing

Larry G. Wapnitsky LWapnitsky at ph.wrtdesign.com
Wed May 23 15:20:23 EDT 2012


It does continue on, but since there are invalid parts to the message,
it only sends the body, not the attachments, nor any modified
attachments that the initial milter added.

 

Larry G. Wapnitsky MBA, MCSE, MCP+I
IT SUPPORT & ADMINISTRATION COORDINATOR
WRT <http://www.wrtdesign.com/>   |  Wallace Roberts & Todd, LLC
<http://www.wrtdesign.com/> 
1700 Market Street, 28th Fl
Philadelphia, PA 19103
T  215.430.5068
C  215.713.8635
E  lwapnitsky at WRTdesign.com <mailto:lwapnitsky at WRTdesign.com> 

 

From: Stuart D Gathman [mailto:stuart at bmsi.com] 
Sent: Wednesday, May 23, 2012 3:18 PM
To: Larry G. Wapnitsky
Cc: pymilter at bmsi.com
Subject: Re: [Pymilter] Unknown command and further processing

 

On 05/23/2012 03:12 PM, Larry G. Wapnitsky expounded in part: 

OK, so here's the issue.

 

My original milter would "crap out" when an unknown command was sent to
Postfix.  That milter is designed to remove attachments from a message,
save them and replace them with a single HTML file pointing to where the
attachments have been saved.  I was never able to diagnose why until I
saw the postfix logs having Unknown commands at the exact same time as
the message was received.  I started logging these and, lo and behold,
coincidence.  

 

Now, I have a milter that comes before my original that just passes on
e-mail with unknown commands, but logs when they occur, to whom they
were sent, etc.  

 

I've just written yet another milter (evolved from the original) that I
want to call when the unknown commands are hit.  This one would log the
headers, et. al. to a database, with the attachments as blobs.

 

My concern is that this one will fail as well.  How do I tell my milter
to only to the DB stuff if the unknown command is received?  Should that
be  a true/false value as the trigger when unknown is hit?

 

Let me know if you'd like to see the code to my milters for
clarification.

 

Sure, just set a flag in the unknown callback, and log headers and body
only when hitting that.

You could also just set a flag in your original milter, and avoid
rejecting the message in later callbacks.

It is not clear that you have verified whether postfix does indeed go on
processing the mail after seeing an unknown command.






----wrtmail--%3423wrt%----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gathman.org/pipermail/pymilter/attachments/20120523/5dc8276b/attachment.html>


More information about the Pymilter mailing list