procmail
[Top] [All Lists]

Re: Please explain lockfiles.

1996-11-21 14:29:41
hugh(_at_)s055(_dot_)aone(_dot_)net(_dot_)au asked,

| I am using procmail to intercept mail to a particular domain and forward
| it to different addresses depending on the user.  Sometimes the one
| message gets forwarded to multiple receipients using a nested block.  Do I
| need to use lockfiles in either of the above situations?

Very unlikely; if you are doing the forwarding with procmail's "!" operator
and thus referring the items back to the MTA (mail transfer agent), the MTA
will do its own job of keeping pieces of mail separate while it handles them.
The same goes if you are piping them to $SENDMAIL.

You probably don't need a nested block, though.  If a single message is to
be forwarded to several recipients, it is more efficient (and simpler) to
send it to all of them at once:

 :0 flags
 * conditions
 ! recipient1 recipient2 recipient3 recipient4 ...

However, if you are doing the forwarding by having procmail save copies to
the recipients' mailboxes, then yes, you need lockfiles (and a nested block
or a string of recipes with `A' flags as well as `c' flags, since each save
needs a separate recipe).

| I am aware that procmail can start multiple sessions etc but I am not
| really understanding what/why/when the lockfile is needed.  If two
| messages arrive for the one outgoing address would this cause a problem if
| lockfiles were not used?  (Yes you are right another escapee from the DOS
| world).

Again, it depends on how the copies are getting into the forwardees' mail-
boxes, as I have explained above.

| Also can you clear something up for me?  When using to *TO in a receipe,

... I hope Hugh meant "^TO", not "*TO" ...

| will it also be good for the following:  cc,CC,Cc,bcc,BCC,Bcc!  I am not
| using D (which I think means that procmail does not care about the case),

Right; that's what the absence of the `D' flag means.

| so I believe that it does but I have no way of knowing for sure.

Yes, it works.  ^TO is case-insensitive by default.  Stephen once told me
something to the effect that tokens like ^TO, ^TO_, ^FROM_DAEMON, and
^FROM_MAILER are *always* case-insensitive, even if the recipe has the `D'
flag, but I'm not positive that that was what he was saying, and we never
pursued it.  Certainly they are insensitive to case if there is no `D'.

<Prev in Thread] Current Thread [Next in Thread>