Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have postfix installed and running. The problem is only root can send email. other users failed to do. Here is the log for user www-data which is a web server application. (the same error for other users)

postfix/smtp[32003]: 513765FEB9: to=<xxxx@gmail.com>, relay=127.0.0.1[127.0.0.1]:11125, delay=2.1, delays=0.07/0/1.7/0.32, dsn=5.0.0, status=bounced (host 127.0.0.1[127.0.0.1] said: 550-Verification failed for <www-data@localhost.localdomain> 550-Unrouteable address 550 Sender verify failed (in reply to RCPT TO command))

here is the /etc/postfix/main.cf:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
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
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost = [127.0.0.1]:11125
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/lizard_password
smtp_sasl_security_options =    
mynetworks = 127.0.0.1/8 [::ffff:127.0.0.1]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
myorigin = /etc/mailname
mydestination = $myhostname, localhost.$mydomain, localhost
inet_protocols = ipv4
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination

and here is the section that I added to the /etc/stunnel/stunnel.conf:

[smtp-tls-wrapper]
accept = 11125
client = yes
connect = smtp.mydomain.com:465

I appreciate any help.

share|improve this question

2 Answers 2

up vote 0 down vote accepted
550-Verification failed for <www-data@localhost.localdomain> 550-Unrouteable address 550 Sender verify failed (in reply to RCPT TO command))

Gmail is rejecting the message because the sender address is not routable (i.e. localhost.localdomain doesn't exist in DNS). You need to specify a valid From address when sending your mail.

It's probably not related to your problem, but you shouldn't be using stunnel -- Postfix can do SSL by itself.

share|improve this answer
    
Then, how come root can send email to the same email address at gmail. Thanks for pointing that postfix can handle SSL by itself. I will check that as well –  Arash Jun 18 '12 at 14:49
    
Ok, I changed the domain name to somthing valid and every thing is working fine now. Thanks for the hint. Regarding using stunnel, please check this link out postfix.org/TLS_README.html#client_smtps. –  Arash Jun 18 '12 at 15:38
    
@Arash Gmail supports StartTLS on ports 25 (without authentication) and 587 (with authentication). –  mgorven Jun 18 '12 at 16:29
    
I know that. But I need to use another host as my relay host than gmail. –  Arash Jun 19 '12 at 15:05

Not a postfix expert, but I'm going to guess it has something to do with reject_unauth_destination

From the manual:

reject_unauth_destination
    Reject the request unless one of the following is true:

        Postfix is mail forwarder: the resolved RCPT TO domain matches $relay_domains or a subdomain thereof, and contains no
sender-specified routing (user@elsewhere@domain),
        Postfix is the final destination: the resolved RCPT TO domain matches $mydestination, $inet_interfaces, $proxy_interfaces,
$virtual_alias_domains, or $virtual_mailbox_domains, and contains no
sender-specified routing (user@elsewhere@domain).
share|improve this answer
    
removed reject_unauth_destination, but did not work –  Arash Jun 15 '12 at 21:05
    
@Arash: Never remove reject_unauth_destination. permit_mynetworks and permit_sasl_authenticated should permit you to send emails if everything else is in place. How exactly are you trying to send the email? –  Dennis Jun 15 '12 at 21:24
    
Thanks for the warning. I did it only for testing purpose. I am sending email using sendmail like sendmail xxxx@gmail.com –  Arash Jun 15 '12 at 21:36

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.