Hi,

Problem:
======
Unable to send outbound mail using 'postfix'.

Error Message:
===========
Feb  6 17:09:53 abc-host sendmail[11601]: n16N9rC7011601: from=root,
size=48, class=0, nrcpts=1, msgid=<
200902062309.n16n9rc7011...@abc-host.localdomain>, relay=r...@localhost
Feb  6 17:09:53 abc-host sendmail[11601]: n16N9rC7011601:
to=test-...@test.domain, ctladdr=root (0/0), delay=00:00:00,
xdelay=00:00:00, mailer=relay, pri=30048, relay=[127.0.0.1] [127.0.0.1],
dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

Configuration:
==========
OS - CentOS 5.2

Postfix - postfix-2.3.3-2.1.el5_2

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
relayhost = [smtp.gmail.com]:587
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/gmailpasswd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_cert_file = /etc/postfix/ssl/mail.cert
smtp_tls_enforce_peername = no
smtp_tls_key_file = /etc/postfix/ssl/mail.key
smtp_tls_note_starttls_offer = yes
smtp_tls_scert_verifydepth = 5
smtp_use_tls = yes
smtpd_tls_ask_ccert = yes
smtpd_tls_req_ccert = no
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550

# netstat -natp | grep -i 25
...
tcp        0      0 127.0.0.1:25                0.0.0.0:*
LISTEN      11669/master
...


Test:
===

1) The following test works just fine.
==========================

# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 abc-host.localdomain ESMTP Postfix
ehlo localhost
250-abc-host.localdomain
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: root
250 2.1.0 Ok
rcpt to: test-...@test.domain
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test email.
.
250 2.0.0 Ok: queued as B24FA60112
# tail /var/log/maillog
...
Feb  6 17:19:35 abc-host postfix/smtpd[11678]: connect from
localhost.localdomain[127.0.0.1]
Feb  6 17:20:20 abc-host postfix/smtpd[11678]: B24FA60112:
client=localhost.localdomain[127.0.0.1]
Feb  6 17:20:30 abc-host postfix/cleanup[11682]: B24FA60112: message-id=<
20090206232020.b24fa60...@abc-host.localdomain>
Feb  6 17:20:30 abc-host postfix/qmgr[11672]: B24FA60112: from=<
r...@abc-host.localdomain>, size=375, nrcpt=1 (queue active)
Feb  6 17:20:31 abc-host postfix/smtp[11683]: certificate verification
failed for smtp.gmail.com: num=20:unable to get local issuer certificate
Feb  6 17:20:31 abc-host postfix/smtp[11683]: certificate verification
failed for smtp.gmail.com: num=27:certificate not trusted
Feb  6 17:20:31 abc-host postfix/smtp[11683]: certificate verification
failed for smtp.gmail.com: num=21:unable to verify the first certificate
...

The 'certificate verification failed' messages are ok since i was able to
recieve the mail at the desired destination.


2. The follwowing test fails.
====================

# mailx -s "test email" test-...@test.domain  </dev/null

# tail /var/log/maillog
...
Feb  6 17:09:53 abc-host sendmail[11601]: n16N9rC7011601: from=root,
size=48, class=0, nrcpts=1, msgid=<
200902062309.n16n9rc7011...@abc-host.localdomain>, relay=r...@localhost
Feb  6 17:09:53 abc-host sendmail[11601]: n16N9rC7011601:
to=test-...@test.domain, ctladdr=root (0/0), delay=00:00:00,
xdelay=00:00:00, mailer=relay, pri=30048, relay=[127.0.0.1] [127.0.0.1],
dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
...


NOTE: The firewall is stopped and Selinux disabled.


Thank you.



-- 
Regards,
mantra - Instrument of Thought

Reply via email to