procmail
[Top] [All Lists]

Re: Possible formail problem?

1998-08-08 15:03:52
Mark Miller, who actually has more of a procmail-biff problem than a formail 
problem, wrote,

| I've discovered that biff will not work when formail (or any other
| program such as cat) is used to send the mail to a file.  For example,
| 
| :0:
| * ^(Apparently-)?(To:|Cc:).*mjm
| $DEFAULT
| 
| will send mail to the $DEFAULT mailbox, and create a log entry
| procmail: Notified comsat: "mjm(_at_)67865-/var/mail/mjm"
| 
| However, if the following is used
| 
| :0:
| * ^(Apparently-)?(To:|Cc:).*mjm
| | $FORMAIL -A"X-Sorted: Default Mail" >> $DEFAULT
| 
| biff will notify the terminal with the first message in the default mail
| folder (/var/mail/$USER, in this case), not using any offset or anything.
| It creates the following Log entry:
| 
| procmail: Notified comsat: "mjm(_at_)- $FORMAIL -A"X-Sorted: Default" 
$DEFAULT"

It's not a formail problem: maybe it's a procmail problem in that it doesn't
stop to consider that $LASTFOLDER isn't very meaningful to comsat when
$LASTFOLDER is a pipe.  Maybe it's a biff problem in that it can't deal with
being told that the thrower or the LDA delivered to a command instead of a
file.

| Notice how the offset and the mailbox location are not printed.  Is there
| any way to get around this while still using formail process the mail?

Well, yes.

  :0fwh
  * ^(Apparently-)?(To:|Cc:).*mjm
  | $FORMAIL -A"X-Sorted: Default Mail"
  :0A:
  $DEFAULT

or if you're already at the end of your .procmailrc, skip the explicit save
to $DEFAULT and let procmail put it there by default (hence its name).

On another consideration, generally it's easier to set PATH to a colon- 
separated list of directories where executables lie and thereafter to
refer to programs by their basenames than to define a variable for the
path to every single program and then call them all by the variables.
And it's certainly easier to update only $PATH if the admins rearrange
the locations of executables.

Finally, you might want to consider changing the condition on that
recipe to use procmail's ^TO_ token (or the ^TO token if your version of
procmail doesn't support ^TO_):

  * ^TO_mjm

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