Skip to main content

unable to use mail relay in postfix: delivered to command: procmail [Resolved]

I'm trying to setup a mail relay server on a local test VM. I'm using Ubuntu 18.04.

When I send email using my postfix config, the mail is never received and I see this entry in my mail log:

status=sent (delivered to command: procmail -a "$EXTENSION")

This is my postfix config:

tdunphy@tdunphy-dev:~$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname,, tdunphy-VirtualBox, localhost.localdomain, localhost
myhostname =
mynetworks = [::ffff:]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_sasl_auth_enable = no
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

I'm sending email on the command line using this command:

 mail -s "Test Subject" < mail_test.txt

This is what I see in the logs:

Jul  9 14:31:22 tdunphy-VirtualBox postfix/local[7906]: 1C485E36C: to=, relay=local, delay=35, delays=35/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Jul  9 14:31:22 tdunphy-VirtualBox postfix/qmgr[7890]: 1C485E36C: removed
Jul  9 14:31:25 tdunphy-VirtualBox postfix/smtpd[7901]: disconnect from localhost[] ehlo=1 mail=1 rcpt=1 data=1 quit=1 unknown=0/1 commands=5/6

But the email never arrives. How do I resolve that?

Question Credit: user99201
Question Reference
Asked July 11, 2018
Posted Under: Network
1 Answers

Your mydestination has in it. Therefore, all mail sent to * is handled locally (relay=local) instead of sending them to the server specified in relayhost.

credit: Esa Jokinen
Answered July 11, 2018
Your Answer