Troubleshooting Postfix Mail Delivery Failure: Fixing “mail transport unavailable” and Queue Backlog Issues


4 views

After setting up a new Postfix MTA with Amavis-new content filtering, you might encounter this persistent warning:

postfix/qmgr[5078]: warning: connect to transport private/filter: No such file or directory

Even after commenting out the content filter configuration, the warning persists, leading to deferred emails with:

postfix/error[5080]: 254851834107: to=, relay=none, 
delay=13082, delays=13082/0.01/0/0.01, dsn=4.3.0, 
status=deferred (mail transport unavailable)

The root cause typically stems from incorrect transport mapping. Check your Postfix configuration with:

postconf -n | grep transport

Common problematic configurations include:

# Incorrect example causing issues
transport_maps = hash:/etc/postfix/transport
content_filter = amavis:[127.0.0.1]:10024

# Missing master.cf entry
#filter    unix  -       n       n       -       -       pipe
#  flags=Rq user=filter argv=/path/to/filter -f ${sender} -- ${recipient}

For the backlog of 50+ stuck messages, try these approaches:

# View queued messages
postqueue -p

# Flush specific domains (replace example.com)
postqueue -f -s example.com

# Alternative method to requeue all
postsuper -r ALL

Ensure these critical settings are correct in main.cf:

# Proper transport configuration
transport_maps = 
virtual_transport = virtual
local_transport = virtual

And verify master.cf contains proper service definitions:

# Sample working amavis entry
127.0.0.1:10025 inet n  -       n       -       -     smtpd
  -o content_filter=
  -o local_recipient_maps=
  -o relay_recipient_maps=
  -o smtpd_restriction_classes=

When dealing with Postfix mail delivery issues, the warning connect to transport private/filter: No such file or directory typically indicates a misconfiguration in your mail transport pipeline. Even after disabling amavis-new (a common content filter), the persistence of this error suggests deeper configuration problems.

First, check your master.cf configuration:

# Verify transport configuration
postconf -M | grep filter

If you see entries pointing to non-existent transports like:

filter      unix  -       -       n       -       10      smtp

For amavis integration, ensure proper configuration in both main.cf and master.cf:

# In main.cf
content_filter = smtp-amavis:[127.0.0.1]:10024

# In master.cf
smtp-amavis unix -  -   n   -   2   smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes

For the 50 queued messages, try forcing requeue with:

postsuper -r ALL
postqueue -f

If messages remain stuck, inspect them with:

postcat -q [message-id]

For virtual domain delivery issues, verify:

postconf virtual_mailbox_domains
postmap -q domainname.com virtual_mailbox_domains

Example virtual configuration:

virtual_mailbox_domains = hash:/etc/postfix/virtual_domains
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailboxes

Implement proper logging for troubleshooting:

# In main.cf
mailq_path = /usr/bin/mailq
debug_peer_level = 2
debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    ddd $daemon_directory/$process_name $process_id & sleep 5

Remember to reload Postfix after changes:

systemctl reload postfix