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, company.com, tdunphy-VirtualBox, localhost.localdomain, localhost
myhostname = noreply.company.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = smtpout.us.companyworld.company.com
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" tdunphy@company.com < 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[127.0.0.1] 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
19 views
1 Answers

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


credit: Esa Jokinen
Answered July 11, 2018
Your Answer
D:\Adnan\Candoerz\CandoProject\vQA