I want to begin using Procmail in order to perform filtering on specific accounts in virtual domains as received by Postfix on my Centos 7 server. In various articles it seems that there are two common ways to direct the Postfix emails to Procmail:
Method 1):
/etc/postfix/main.cf:
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
Method 2):
/etc/postfix/main.cf:
virtual_transport = virtualprocmail:dummy
virtualprocmail_destination_recipient_limit = 1
/etc/postfix/master.cf
virtualprocmail unix - n n - - pipe flags=DRXhuq user=virtualuser
argv=/usr/bin/procmail -m E_SENDER=$sender E_RECIPIENT=$recipient ER_USER=$user ER_DOMAIN=$domain ER_DETAIL=$extension NEXTHOP=$nexthop
I'm unsure of which method to use with my Postfix virtual domains. What are the Pros and Cons of each of these methods for sending the emails to Procmail?
EDIT: Thanks! Yes, the Postfix Maildrop page does clarify this matter.
In summary: Method 1) requires the use of system user accounts, while Method 2) allows the use of virtual domains and virtual aliases.
so… this problem is solved.
Best Answer
Page MAILDROP README from postfix documentation will you give some technical information about both of method. In this section I'll quote the snippet when you should use
mailbox_command
method or usevirtual_transport
.Use
mailbox_command
if you have multiple user configured with local system account. Usually the domain would fall inmydestination
parameter. Snippet from the pageOtherwise, you should use
virtual_transport
method.Anyway, you should understand the concept of four domain classes in postfix. In fact, virtual_transport would fall in virtual address class and mailbox would serves local address class.