how to use procmail as a MDA for postfix? (mailbox_command)
postfix executes mailbox_command
with uid of the recipient. It should make -d ${USER}
unnecessary.
http://www.postfix.org/postconf.5.html#mailbox_command
mailbox_command (default: empty)
Optional external command that the local(8) delivery agent should use for mailbox delivery. The command is run with the user ID and the primary group ID privileges of the recipient. Exception: command delivery for root executes with $default_privs privileges.
Related videos on Youtube
amerov
Updated on September 18, 2022Comments
-
amerov almost 2 years
I am trying to setup procmail as a mail delivery agent (MDA) for postfix. I understand that I should use the
mailbox_command
option in postfix for this, but an internet search revealed contradicting advice on how exactly to do this:-
Several sources suggest to just use
mailbox_command = /usr/bin/procmail
-
Some sources suggest using the
-f
option, e.g. as inmailbox_command = /usr/bin/procmail -f-
See for example here. This seems to adjust the date in From lines.
-
Some sources suggest using procmail in "delivery mode", i.e. using the
-d
option:mailbox_command = /usr/bin/procmail -d ${USER}
(There are many variations of these three approaches, e.g. using
-a
to pass information to the procmail recipes or settingMAILDIR
.)What are the advantages and disadvantages of the three approaches? And in particular, what is the effect of using "delivery mode"?
-
tripleee almost 9 years
-d
is for when Procmail is invoked as root; but withmailbox_command
, it won't be -- Postfix will already run it with the recipient's UID and GID. Similarly,-f-
is probably not necessary with Postfix, as there should not be aFrom_
line on the incoming message.
-