I'm trying to set up postfix relay access via SMTP using gmail using the many tutorials on the net. It looks as though I am missing a prerequites. I've reinstalled postfix a couple of times with the same issue.
Below are the logs.
1. The line that says relay=none indicates that the relaying to gmail isn't happening. Even though it says bounced, i doubt it is even getting there.
2. I tried telnet-ing into [smtp.gmail.com] on port 587 and it works, so not network issues.
Code:
Jun 30 14:59:43 Flash postfix/pickup[8848]: 3667B2D32B: uid=1000 from=<kiren>
Jun 30 14:59:43 Flash postfix/cleanup[8853]: 3667B2D32B: message-id=<20120630125943.3667B2D32B@Flash>
Jun 30 14:59:43 Flash postfix/qmgr[8849]: 3667B2D32B: from=<kiren@Flash>, size=328, nrcpt=1 (queue active)
Jun 30 14:59:43 Flash postfix/error[8855]: 3667B2D32B: to=<kp1@gmail.com>, relay=none, delay=0.02, delays=0.01/0/0/0, dsn=5.0.0, status=bounced ([smtp.gmail.com]:587)
Jun 30 14:59:43 Flash postfix/cleanup[8853]: 39CEA2D32D: message-id=<20120630125943.39CEA2D32D@Flash>
Jun 30 14:59:43 Flash postfix/bounce[8856]: 3667B2D32B: sender non-delivery notification: 39CEA2D32D
Jun 30 14:59:43 Flash postfix/qmgr[8849]: 39CEA2D32D: from=<>, size=1923, nrcpt=1 (queue active)
Jun 30 14:59:43 Flash postfix/qmgr[8849]: 3667B2D32B: removed
Jun 30 14:59:43 Flash postfix/local[8857]: 39CEA2D32D: to=<kiren@Flash>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jun 30 14:59:43 Flash postfix/qmgr[8849]: 39CEA2D32D: removed
My main.cnf
Code:
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_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 = Flash
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = Flash, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
#inet_interfaces = all
default_transport = error
relay_transport = error
# sets gmail as relay
relayhost = [smtp.gmail.com]:587
# use tls
smtp_use_tls=yes
# use sasl when authenticating to foreign SMTP servers
smtp_sasl_auth_enable = yes
# path to password map file
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
# list of CAs to trust when verifying server certificate
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
# eliminates default security options which are imcompatible with gmail
smtp_sasl_security_options =
debug_peer_list=smtp.gmail.com
debug_peer_level=3