Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a postfix server - for several weeks without problems, but now mails bounce. After one day, I got the following mail from gmail, when I tried to send a mail to my server:

[...]
Delivery to the following recipient has been delayed:

     <the mailadress>@<myserver>

Message will be retried for 2 more day(s)

[...] 
[mx.<myserver>. (0): Connection refused]

The logs mail.log, mail.err and mail.warn are empty except of some strange errors of the form:

postfix/trivial-rewrite[22141]: warning: regexp map /etc/postfix/virtual, line 12: ignoring unrecognized request

The virtual aliases is also the only thing I changed in the last time (but afterwards it was still working).

Any hints how I could troubleshoot this?

Note that sending a mail to a local user from a local user works.

Also there is a open port although "127.0.0.2" looks strange to me...

$ netstat -a|grep smtp
tcp        0      0 127.0.0.2:smtp          *:*                     LISTEN     
tcp        0      0 localhost.localdom:smtp *:*                     LISTEN   

My main.cf:

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_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
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 = <my servername>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
#virtual_alias_maps = regexp:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual

myorigin = /etc/mailname
mydestination = <myserver>, localhost
relayhost = <my external smtp>
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = smtp
relay_transport = smtp
inet_protocols = ipv4
share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

Your inet_interfaces parameter is set to loopback-only. This is why local mail delivery is working.

Change this to all and it will be listening on all interfaces.

share|improve this answer
    
Uh... I think I added this, because because I don't want it to be an open relay... Of course it shouldn't be a spambot. See this Q&A for example. –  lumbric Feb 18 '12 at 15:00
    
Yes, but if you want to accept mail from remote systems then you have to have the MTA listening on your ethernet interfaces, not just loopback. If it's an outbound-only system, then add a firewall rule to block port access from remote networks. –  James O'Gorman Feb 18 '12 at 16:29
add comment

Apparently, your email server is listening to the loopback address only as it is shown by netstat output. You can try commenting out the following line in your config.

#inet_interfaces = loopback-only

Don't forget to reload/restart your postfix process. It is a good idea to confirm this change was successful using netstat.

share|improve this answer
add comment

Your Answer

 
discard

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.