[TriLUG] more spamassassin, procmail, sendmail

Jeremy Portzer jeremyp at pobox.com
Wed Apr 16 16:53:27 EDT 2003


On Wed, 2003-04-16 at 16:18, Turnpike Man wrote:
> > 
> > If you don't use the trailing colon on an "mbox" format file (the
> > default, traditional Unix mailbox format), you could end up with big
> > problems if multiple instances of procmail try to write to the folder at
> > the same time.  (Or if your MUA tries to write to it while procmail also
> > does.)  The :0: tells it to lock the file, so that nothing else can
> > write to it while procmail does.  (It releases the lock when it's done.)
> > 
> > You don't need the colon for recipes that don't involve mbox files, like
> > the $DELIVERTO macro when using procmail on TriLUG, or sending mail
> > through a pipe to spamassassin, or to /dev/null, etc.
> > 
> > --Jeremy
> 
> I think that is more confusing Jeremy, for a lesser like me!  If it locks the
> file, won't the next process queue up?  I mean, as far as ~/mail/inbox, only
> one message can be written at a time if it expects to keep order.

Right, that's the point: "only one message can be written at a time if
it expects to keep order."  There must be some mechanism to make sure
that only one message gets written at a time.  But by default, one
procmail process doesn't know if another one is running.  That's where
file locking comes in; if one process has a lock on the file, then the
other one won't write to it simultaneously.

Yes, if it locks the file the next process will "queue up" but that all
happens fast enough that you won't notice.  You *will* however notice if
you don't enable locking and get a corrupted mailbox!

> I use sendmail, so I don't suppose I have to worry about '.mbox' formats,
> correct?

Wrong -- "mbox" format is the name for the standard mailbox format
that's been around *nix forever, including the default format used by
sendmail.  These is the format used by /var/spool/mail/<your login name>
and the format used by the files in ~/mail.  (There is traditionally no
file extension for this type of file.)  It's possible that some people
call this format something other than "mbox" -- however the name mbox is
used by the UW IMAP/Pine developers whose mail tools I'm most familiar
with.

> Also, what is this $DELIVERTO macro?

That's only if you're using procmail on moya.trilug.org, the TriLUG mail
server.  I put that there for others following this thread who are using
that.

> Does that relate to the mutt
> lines someone wrote about earlier in the thread?  I tried using mutt... ick...
> IMHO, each to his own.

Yeah, I don't like mutt either.  But it's very "Unix-y" with lots of
arcane commands, its own macro language, etc. :-)

> Also, I presume by piping to spamassassin, you mean
> this:
> 
> :0fw: spamassassin.lock
> | /usr/bin/spamassassin

Yes, that's what I meant.  The '|' character is called a pipe and is
used to redirect the output of one program to the input of another.  In
this case, you're telling procmail to use its output (your email
message) as the input to the /usr/bin/spamassassin program.

> What about the trailing colon on this one?

Not really needed, I don't think, because spamassassin doesn't care if
it gets called multiple times at once.  I guess it can't hurt.
Note that because spamassassin is a program, not a mbox format file, the
procmail recipe specifies what file to use as a lock file
(spamassassin.lock).  You can't lock a program, but you can specifify
that file for each procmail instance to check.

> Also, I noticed it takes significantly more time to deliver a message that the
> .procmailrc sends through spamassassin.  Is this large of a difference to be
> expected?  I went from 2-3 seconds to over 10-15 seconds on a P2 450 with 192
> RAM, 9GB SCSI drive.  I am the only person using the machine, as it is my play
> box.

Yeah, spamassassin is not instantaneous. It runs a LOT of tests on the
email.  It is known for using lots of RAM; 192 MB is not a huge amount,
especially if you're running X, so your kernel might have to start
swapping when running SA.  Swapping of course slows things down
tremendously.

Hope this helps,
Jeremy

-- 
/=====================================================================\
| Jeremy Portzer       jeremyp at pobox.com       trilug.org/~jeremy     |
| GPG Fingerprint: 712D 77C7 AB2D 2130 989F  E135 6F9F F7BC CC1A 7B92 |
\=====================================================================/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://www.trilug.org/pipermail/trilug/attachments/20030416/d9d1e7ea/attachment.pgp>


More information about the TriLUG mailing list