procmail
[Top] [All Lists]

Re: Procmail as local mailer problems

1997-08-15 09:24:00
lhecking(_at_)nmrc(_dot_)ucc(_dot_)ie (Lars Hecking) writes:
This is on a SunOS4.1.3 machine with sendmail 8.6.8.1.

I need to make a backup of email sent to a certain user and thought
procmail can do it. So I configured procmail as local mailer in sendmail.cf

Mlocal,                P=/usr/local/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=10/
30, R=20/40,
              T=DNS/RFC822/X-Unix,
              A=procmail -Y -a $h -d $u

(taken from cf/mailer/procmail.m4 from sendmail-8.8.7)

This is a mistake.  sendmail 8.6.8.1 doesn't support all the flags in
the F directive that you have on that mailer, and while sendmail will
just ignore unknown flags, you may be missing something that it does
need.  In general, do not mix cf and binary versions.  Either upgrade
to sendmail 8.8.7 all around, or use an 8.6.8.1 cf file.  If you can't
use the m4 config generators, then the correct way to change the local
mailer to use procmail is to:

a)      Change the P directive to the correct path to procmail
b)      Add the following flags to the F directive, if they're
        not already present: hnfPS
c)      Remove the following flags from the F directive if they're
        present: mrE
d)      Change the A directive to "procmail -Y -a $h -d $u"

Nothing else should be modified.



and created /etc/procmailrc

:0c
* ^TO_user
/path/to/backup

Well, you should be keying off of the envelope recipient, which at this
point will be in the LOGNAME variable:

        :0 c
        * LOGNAME ?? ^^user^^
        /path/to/backup

However, is there some reason you don't just create a .procmailrc for
the user himself or herself containing the simpler:

        :0 c
        /path/to/backup

That won't slow down everyone else's mail like the /etc/procmailrc solution.

Alternatively, what's wrong with a .forward file that says:

        /path/to/backup,\user

Both the .forward and ~user/.procmailrc solution will write the backup file
as the user, which is generally what you want.  If you _really_ want to
write the file as a system user, so that the user can't munge the file,
then you could put the following in /etc/aliases instead:

        user: /path/to/backup, \user

Once again, that won't slow down everyone else's delivery.


Now, with this setup mail to user is stored in the backup file,
but mail to all other users fails to deliver. I figured that

"fails to deliver".  Can you be more specific?  Does the mail bounce?
What does the sendmail log show?  Have you tried turning on VERBOSE
logging from the /etc/procmailrc?


I need to set DEFAULT, but how to? Mail for user goes

Are you _sure_ you need to set DEFAULT?  Procmail does that automatically,
and the /etc/procmailrc you show above would not have affected it.

Philip Guenther

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