Archive for November, 2007

queue aliasing changes and smtp

Thursday, November 29th, 2007

i’ve been trying to re-write the smtp agent over the past few nights using the new generic bongoagent style (which is much cleaner than the old system).  in trying to get it to go nicely i found that it’s not really easy in the current system to have two threads with connection pools to the queue agent.  the smtp agent did this so that it could listen to to both queue 6 and 7 both.  the really stupid thing about the nmap protocol was that if it wasn’t know if a user was remote or local, one must assume it is remote.  but the remote delivery queue comes after the local delivery queue.  so by the time we get to queue 7 we’d have missed our chance to deliver locally.  thus queue 6 was born.  smtp’s *only* job on queue 6 was to rewrite the envelope to be a local destination if it really was.  the new patch (r559) attemts to move that responsibility into the queue.  as bongoqueue is rewriting the envelope (the reason for which escapes me really, but it turned out to be useful), i use the aliasing code that i added earlier to resolve if a user is remote or local and replace the recipient lines to correctly reflect destination.

whew!  this being done, now i can continue on with the smtp rewrite.  for lack of a better name, i named it bongosmtp_o for outbound.  i’m sure there is a better name for the “agent that delivers smtp mail to remote systems” (vs “the agent that receives smtp mail from remote systems — which i’d planed on naming bongosmtp_i).  suggestions are very welcome .

in getting ready for the generic style bongo agent i’ve made a few modifications to core libraries to clean out a bit of un-needed code.  the next commit will touch a bunch of files, though the changes are pretty minimal for all except the new smtp.

antispam

Wednesday, November 21st, 2007

I’ve come to the realization that the antispam code needs a good rewrite.  it is incredibly messy.  after adding an insane abount of debugging statements to the queue i finally figured out why i was getting c*.001 files left in the spool.  every time the antispam agent was called it would modify the message envelope then delete it.  the delete would happen, but the remaining w file would still be there and dutifully renamed into a c file later on.  the queue needs a ton of work for file IO.  i know MA did a bunch to optimize it but i didn’t realize how bad we really were in terms of file IO.  http://www.feltonline.com/p_c/bongo/queue-io.txt shows how bad it is for one message passing through the queue being replaced by the message with the spam headers attached.  ick!