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 using the FQDN of dur.bounceme.net which I want to resolve(?) to localhost. That is, I want mail to user@dur.bounceme.net to get delivered to user@localhost.

I've tried following the Ubuntu guide on this and seem to be going in circles a bit.

root@dur:~#
root@dur:~# postfix stop
postfix/postfix-script: stopping the Postfix mail system
root@dur:~# postfix start
postfix/postfix-script: starting the Postfix mail system
root@dur:~# telnet dur.bounceme.net 25
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused
root@dur:~#
root@dur:~# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 dur.bounceme.net ESMTP Postfix (Ubuntu)
ehlo dur
250-dur.bounceme.net
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:telnet@dur.bounceme.net
250 2.1.0 Ok
rcpt to:thufir@dur.bounceme.net
451 4.3.0 <thufir@dur.bounceme.net>: Temporary lookup failure
rcpt to:thufir@localhost
451 4.3.0 <thufir@localhost>: Temporary lookup failure
quit
221 2.0.0 Bye
Connection closed by foreign host.
root@dur:~#
root@dur:~# grep telnet /var/log/mail.log
Aug 28 00:24:45 dur postfix/smtpd[18256]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <thufir@localhost>: Temporary lookup failure; from=<telnet@dur.bounceme.net> to=<thufir@localhost> proto=ESMTP helo=<dur>
Aug 28 00:24:58 dur postfix/smtpd[18256]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <thufir@dur.bounceme.net>: Temporary lookup failure; from=<telnet@dur.bounceme.net> to=<thufir@dur.bounceme.net> proto=ESMTP helo=<dur>
Aug 28 00:54:55 dur postfix/smtpd[18825]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <thufir@dur.bounceme.net>: Temporary lookup failure; from=<telnet@dur.bounceme.net> to=<thufir@dur.bounceme.net> proto=ESMTP helo=<dur>
Aug 28 00:55:08 dur postfix/smtpd[18825]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 451 4.3.0 <thufir@localhost>: Temporary lookup failure; from=<telnet@dur.bounceme.net> to=<thufir@localhost> proto=ESMTP helo=<dur>
root@dur:~#
root@dur:~# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/var/lib/mailman/data/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
default_transport = smtp
home_mailbox = Maildir/
inet_interfaces = loopback-only
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m "${EXTENSION}"
mailbox_size_limit = 0
mailman_destination_recipient_limit = 1
mydestination = dur, dur.bounceme.net, localhost.bounceme.net, localhost
myhostname = dur.bounceme.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relay_domains = lists.dur.bounceme.net
relay_transport = relay
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-mail.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-mail.key
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
root@dur:~# 
share|improve this question

2 Answers 2

Firstly, you've got the alias for dur.bounceme.net set up wrong - it tries to connect to 127.0.1.1 instead of 127.0.0.1.

Secondly, you need to tell postfix what domain it should consider local. The web page you link to is about setting up a mailing list service; you should take a look at the postfix documentation instead. There's information about what you need to have "fake domains" work at the readme file.

share|improve this answer
    
that didn't even register about 127.0.1.1, thanks. –  Thufir Aug 28 '12 at 10:07
2  
It's always easier to see someone else's typos that your own :-) –  Jenny D Aug 28 '12 at 10:08
    
only I see that This mapping happens ONLY when mail leaves the machine; not when you send mail between users on the same machine. which doesn't explain why this mail between users on the same machine failed above. –  Thufir Aug 28 '12 at 10:29
    
Sorry, I misread a little. Have a look at postfix.org/BASIC_CONFIGURATION_README.html instead, especially the section about what domains to accept mail for. –  Jenny D Aug 28 '12 at 16:51
    
This site is for professional sysadmins. If you haven't read the basic documentation for the system you're working with before asking, you will get downvoted. –  Jenny D Aug 28 '12 at 17:12
up vote 0 down vote accepted

Well I'm not sure that I understand the answer Jenny gave in entirety, the question was flawed (of course). The solution is to use two loopbacks, this will achieve the desired result as demonstrated below:

thufir@dur:~$ 
thufir@dur:~$ 
thufir@dur:~$ swaks --to thufir@localhost
=== Trying localhost:25...
=== Connected to localhost.
<-  220 dur.bounceme.net ESMTP Postfix (Ubuntu)
 -> EHLO dur.bounceme.net
<-  250-dur.bounceme.net
<-  250-PIPELINING
<-  250-SIZE 10240000
<-  250-VRFY
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250 DSN
 -> MAIL FROM:<thufir@dur.bounceme.net>
<-  250 2.1.0 Ok
 -> RCPT TO:<thufir@localhost>
<-  250 2.1.5 Ok
 -> DATA
<-  354 End data with <CR><LF>.<CR><LF>
 -> Date: Sun, 08 Jun 2014 04:24:58 -0700
 -> To: thufir@localhost
 -> From: thufir@dur.bounceme.net
 -> Subject: test Sun, 08 Jun 2014 04:24:58 -0700
 -> X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/
 -> 
 -> This is a test mailing
 -> 
 -> .
<-  250 2.0.0 Ok: queued as 2FDAB221E21
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.
thufir@dur:~$ 
thufir@dur:~$ swaks --to thufir@dur.bounceme.net
=== Trying dur.bounceme.net:25...
=== Connected to dur.bounceme.net.
<-  220 dur.bounceme.net ESMTP Postfix (Ubuntu)
 -> EHLO dur.bounceme.net
<-  250-dur.bounceme.net
<-  250-PIPELINING
<-  250-SIZE 10240000
<-  250-VRFY
<-  250-ETRN
<-  250-STARTTLS
<-  250-ENHANCEDSTATUSCODES
<-  250-8BITMIME
<-  250 DSN
 -> MAIL FROM:<thufir@dur.bounceme.net>
<-  250 2.1.0 Ok
 -> RCPT TO:<thufir@dur.bounceme.net>
<-  250 2.1.5 Ok
 -> DATA
<-  354 End data with <CR><LF>.<CR><LF>
 -> Date: Sun, 08 Jun 2014 04:25:05 -0700
 -> To: thufir@dur.bounceme.net
 -> From: thufir@dur.bounceme.net
 -> Subject: test Sun, 08 Jun 2014 04:25:05 -0700
 -> X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/
 -> 
 -> This is a test mailing
 -> 
 -> .
<-  250 2.0.0 Ok: queued as A7365221E21
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.
thufir@dur:~$ 
thufir@dur:~$ 

Mail to localhost and mail to dur.bounceme.net are correctly delivered.

I'm unclear on the distinction between a loopback of 127.0.0.1 and 127.0.1.1, as:

IPv4 network standards reserve the entire 127.0.0.0/8 address block for loopback purposes. That means any packet sent to one of those 16,777,214 addresses (127.0.0.1 through 127.255.255.254) will be looped back.

http://en.wikipedia.org/wiki/Localhost#Name_resolution

In any event, the specific problem was not caused by either Postfix or Dovecot, as their default configurations, as the mail stack installed by the http://packages.ubuntu.com/trusty/mail-stack-delivery package, functions correctly without additional configuration.

I'm unclear as to why a specific IP address is reserved for localhost, but will read further.

share|improve this answer

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.