Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running a server with Ubuntu 12.04 and we have some cron jobs that generate emails we want to receive. For handling that and other mails like that, I installed postfix and configured it to only listen on localhost since I don't want random people even trying to use it as SMTP relay.

I can successfully send mail by running:


but when cron runs, it somehow tries to connect to the public IPs of the machine, which fails, because they are not bound by postfix:

Jul 19 09:29:01 einstein cron[5503]: (postgres) RELOAD (crontabs/postgres)
Jul 19 09:29:01 einstein CRON[12119]: (postgres) CMD (ls /)
Jul 19 09:29:01 einstein postfix/pickup[11890]: 5F43928ACE: uid=109 from=<postgres>
Jul 19 09:29:01 einstein postfix/cleanup[12068]: 5F43928ACE: message-id=<>
Jul 19 09:29:01 einstein postfix/qmgr[11891]: 5F43928ACE: from=<>, size=647, nrcpt=1 (queue active)
Jul 19 09:29:01 einstein postfix/smtp[12073]: connect to[]:25: Connection refused
Jul 19 09:29:01 einstein postfix/smtp[12073]: connect to[2a01:5800::96f1]:25: Connection refused
Jul 19 09:29:01 einstein postfix/smtp[12073]: 5F43928ACE: to=<>, orig_to=<postgres>, relay=none, delay=0.01, delays=0/0/0/0, dsn=4.4.1, status=deferred (connect to[2a01:5800::96f1]:25: Connection refused)

I'm not even sure which program is connecting to the wrong IPs, so I don't know how to start solving it. Can anyone point me in the right direction?

My Postfix configuration is pretty standard:

# This file is managed by puppet, any manual changes will be lost.
# See /usr/share/postfix/ for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localdomain, localhost, localhost.localdomain, localhost
relayhost = 
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
myorigin = /etc/mailname
inet_protocols = all
share|improve this question
up vote 2 down vote accepted

By definition, cron does not connect anywhere to send email; it uses the sendmail(1) interface exposed by postfix and other MTAs.

As your log shows, postfix is trying to send the mail to itself via SMTP; this happens because postfix does not know it should handle mail for

Add the domain to mydestination and reload postfix.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.