Postfix : Problem with sending mail

Issues related to applications and software problems
Post Reply
karniv.patel
Posts: 6
Joined: 2014/08/11 05:39:26

Postfix : Problem with sending mail

Post by karniv.patel » 2015/01/22 09:51:00

Good day to all :) ,

I am using postfix for mail
OS : Centos6.4
When i am sending any mail to outside network then i got status=deferred & Connection timed out error.
It's works fine for inside network, But not working for outside network.
Please help me, Really i am stuck here.
My configuration are below:

# 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
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost =
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
# /etc/init.d/iptables stop
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
# /etc/init.d/iptables status
iptables: Firewall is not running.
# telnet 64.233.186.26 25
Trying 64.233.186.26...
telnet: connect to address 64.233.186.26: Connection timed out
# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 domain.com ESMTP Postfix
421 4.4.2 domain.com Error: timeout exceeded
Connection closed by foreign host.
I was getting the following in /var/log/maillog
# tail -f /var/log/maillog
postfix/smtp[21730]: 61E0A3583CC: to=<XXXX@yahoo.co>, relay=none, delay=410337, delays=410217/0.03/120/0, dsn=4.4.1, status=deferred (connect to yahoo.co[98.137.236.150]:25: Connection timed out)
postfix/smtp[21984]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4002:c05::1b]:25: Connection timed out
postfix/smtp[27956]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4002:c07::1a]:25: Connection timed out
postfix/smtp[27956]: connect to gmail-smtp-in.l.google.com[74.125.196.26]:25: Connection timed out
postfix/smtp[27956]: connect to alt1.gmail-smtp-in.l.google.com[2607:f8b0:400c:c03::1b]:25: Connection timed out
postfix/smtp[27956]: connect to alt1.gmail-smtp-in.l.google.com[74.125.131.26]:25: Connection timed out
postfix/smtp[27956]: connect to alt2.gmail-smtp-in.l.google.com[2800:3f0:4003:c00::1b]:25: Connection timed out
Waiting for a positive response.
Any kind of help would be appreciated.

Thanks,
Karniv Patel

User avatar
jyoung
Posts: 102
Joined: 2014/09/22 13:40:31
Location: Nashville, TN, USA

Re: Postfix : Problem with sending mail

Post by jyoung » 2015/01/22 13:10:29

It sure looks like there's a firewall blocking your OUTBOUND traffic. Turning off your own firewall doesn't serve any purpose.
-- Jeremy --

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Postfix : Problem with sending mail

Post by Whoever » 2015/01/23 03:44:15

Ask your ISP if they are blocking outbound SMTP traffic (port 25/tcp). Probably they are if you are on a residential connection.

karniv.patel
Posts: 6
Joined: 2014/08/11 05:39:26

Re: Postfix : Problem with sending mail

Post by karniv.patel » 2015/01/23 06:56:18

Thanks for your quick reply,
There are no any firewall
It's working fine for me some days ago

# telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 domain.com ESMTP Postfix
ehlo localhost
250-inextrix.com
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:karniv
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test
.
250 2.0.0 Ok: queued as 3DCA2374183
quit
221 2.0.0 Bye
Connection closed by foreign host.
You can check also
# traceroute google.com
traceroute to google.com (216.58.219.174), 30 hops max, 60 byte packets
1 1-164-111-65.serverpronto.com (65.111.164.1) 0.542 ms 1.144 ms 1.440 ms
2 GW-10G-WEST-MIA.serverpronto.com (69.60.96.97) 0.307 ms 0.350 ms 0.394 ms
3 xe-10-0-0.edge4.Miami1.Level3.net (4.59.90.89) 23.859 ms 23.858 ms 23.837 ms
4 * * *
5 4.68.70.118 (4.68.70.118) 0.454 ms 0.464 ms 0.438 ms
6 209.85.253.118 (209.85.253.118) 25.273 ms 25.194 ms 0.509 ms
7 72.14.235.211 (72.14.235.211) 0.607 ms 0.626 ms 0.564 ms
8 mia07s27-in-f14.1e100.net (216.58.219.174) 0.521 ms 0.484 ms 0.541 ms
# traceroute gmail.com
traceroute to gmail.com (216.58.219.69), 30 hops max, 60 byte packets
1 1-164-111-65.serverpronto.com (65.111.164.1) 0.599 ms 1.208 ms 1.518 ms
2 GW-10G-WEST-MIA.serverpronto.com (69.60.96.97) 0.284 ms 0.332 ms 0.383 ms
3 xe-10-0-0.edge4.Miami1.Level3.net (4.59.90.89) 21.006 ms 20.994 ms 20.978 ms
4 ae-1-51.edge1.Miami2.Level3.net (4.69.138.75) 23.451 ms 23.442 ms 23.464 ms
5 4.68.70.118 (4.68.70.118) 0.440 ms 0.375 ms 0.425 ms
6 209.85.253.74 (209.85.253.74) 0.515 ms 0.478 ms 0.482 ms
7 72.14.233.233 (72.14.233.233) 0.582 ms 0.578 ms 0.540 ms
8 mia07s24-in-f5.1e100.net (216.58.219.69) 0.463 ms 0.462 ms 0.461 ms
# traceroute yahoo.com
traceroute to yahoo.com (98.139.183.24), 30 hops max, 60 byte packets
1 1-164-111-65.serverpronto.com (65.111.164.1) 13.222 ms 13.509 ms 13.810 ms
2 GW-10G-WEST-MIA.serverpronto.com (69.60.96.97) 0.305 ms 0.348 ms 0.394 ms
3 te0-0-1-0.nr11.b015452-0.mia01.atlas.cogentco.com (38.104.90.49) 0.787 ms 0.931 ms 0.977 ms
4 te0-0-1-1.agr12.mia01.atlas.cogentco.com (154.24.31.61) 0.857 ms te0-0-1-1.agr11.mia01.atlas.cogentco.com (154.24.31.57) 0.861 ms te0-0-1-1.agr12.mia01.atlas.cogentco.com (154.24.31.61) 0.903 ms
5 te0-4-1-0.ccr22.mia01.atlas.cogentco.com (154.54.3.173) 0.704 ms te0-4-1-0.ccr21.mia01.atlas.cogentco.com (66.28.4.217) 0.801 ms te0-4-0-0.ccr22.mia01.atlas.cogentco.com (154.54.1.169) 0.712 ms
6 be2055.ccr21.mia03.atlas.cogentco.com (154.54.24.234) 1.077 ms te0-6-0-0.ccr22.mia03.atlas.cogentco.com (154.54.80.50) 0.898 ms be2055.ccr21.mia03.atlas.cogentco.com (154.54.24.234) 0.958 ms
7 te7-1.mag01.mia03.atlas.cogentco.com (154.54.47.154) 40.886 ms te4-2.mag01.mia03.atlas.cogentco.com (154.54.6.57) 40.578 ms te7-1.mag01.mia03.atlas.cogentco.com (154.54.47.154) 40.607 ms
8 yahoo.mia03.atlas.cogentco.com (154.54.13.250) 0.800 ms 0.700 ms 0.759 ms
9 so-0-0-0.pat1.dce.yahoo.com (216.115.96.22) 27.599 ms 27.596 ms 27.572 ms
10 ae-4-0.pat1.nyc.yahoo.com (216.115.104.121) 33.518 ms 33.467 ms 33.728 ms
11 ae-5.pat2.bfz.yahoo.com (216.115.96.67) 41.641 ms ae-2.pat1.bfz.yahoo.com (216.115.100.26) 43.940 ms ae-5.pat2.bfz.yahoo.com (216.115.96.67) 41.553 ms
12 ae-4.msr1.bf1.yahoo.com (216.115.100.25) 61.342 ms ae-3.msr1.bf1.yahoo.com (216.115.100.29) 46.444 ms ae-4.msr1.bf1.yahoo.com (216.115.100.25) 41.852 ms
13 xe-2-0-1.clr1-a-gdc.bf1.yahoo.com (98.139.130.5) 44.278 ms UNKNOWN-98-139-128-X.yahoo.com (98.139.128.19) 46.766 ms xe-11-1-1.clr1-a-gdc.bf1.yahoo.com (98.139.128.17) 46.621 ms
14 et-17-1.fab6-1-gdc.bf1.yahoo.com (98.139.128.47) 44.590 ms UNKNOWN-98-139-128-X.yahoo.com (98.139.128.83) 46.761 ms et-18-25.fab2-1-gdc.bf1.yahoo.com (98.139.128.55) 46.950 ms
15 po-9.bas1-7-prd.bf1.yahoo.com (98.139.129.145) 45.057 ms po-11.bas1-7-prd.bf1.yahoo.com (98.139.129.177) 42.423 ms po-13.bas1-7-prd.bf1.yahoo.com (98.139.129.209) 42.783 ms
# dig google.com mx
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.30.rc1.el6_6.1 <<>> google.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23600
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 4, ADDITIONAL: 12

;; QUESTION SECTION:
;google.com. IN MX

;; ANSWER SECTION:
google.com. 375 IN MX 20 alt1.aspmx.l.google.com.
google.com. 375 IN MX 30 alt2.aspmx.l.google.com.
google.com. 375 IN MX 50 alt4.aspmx.l.google.com.
google.com. 375 IN MX 40 alt3.aspmx.l.google.com.
google.com. 375 IN MX 10 aspmx.l.google.com.

;; AUTHORITY SECTION:
google.com. 113459 IN NS ns1.google.com.
google.com. 113459 IN NS ns2.google.com.
google.com. 113459 IN NS ns3.google.com.
google.com. 113459 IN NS ns4.google.com.

;; ADDITIONAL SECTION:
alt1.aspmx.l.google.com. 88 IN A 74.125.131.27
alt2.aspmx.l.google.com. 5 IN A 64.233.186.26
alt4.aspmx.l.google.com. 277 IN A 64.233.167.26
alt4.aspmx.l.google.com. 211 IN AAAA 2a00:1450:400c:c0a::1b
alt3.aspmx.l.google.com. 285 IN A 74.125.138.26
alt3.aspmx.l.google.com. 68 IN AAAA 2a00:1450:400b:c01::1b
aspmx.l.google.com. 219 IN A 74.125.196.26
aspmx.l.google.com. 35 IN AAAA 2607:f8b0:4002:c06::1b
ns3.google.com. 119237 IN A 216.239.36.10
ns4.google.com. 119237 IN A 216.239.38.10
ns2.google.com. 119237 IN A 216.239.34.10
ns1.google.com. 119237 IN A 216.239.32.10

;; Query time: 1 msec
;; SERVER: 69.60.125.253#53(69.60.125.253)
;; WHEN: Fri Jan 23 01:44:34 2015
;; MSG SIZE rcvd: 436


# netstat -ntpul | grep master
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1461/postmaster
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 19100/master
tcp 0 0 :::5432 :::* LISTEN 1461/postmaster
tcp 0 0 :::25 :::* LISTEN 19100/master
# netstat -ntpul | grep dovecot
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 19114/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 19114/dovecot
tcp 0 0 0.0.0.0:993 0.0.0.0:* LISTEN 19114/dovecot
tcp 0 0 0.0.0.0:995 0.0.0.0:* LISTEN 19114/dovecot
tcp 0 0 :::110 :::* LISTEN 19114/dovecot
tcp 0 0 :::143 :::* LISTEN 19114/dovecot
tcp 0 0 :::993 :::* LISTEN 19114/dovecot
tcp 0 0 :::995 :::* LISTEN 19114/dovecot
# tail -f /var/log/maillog
postfix/smtp[19894]: 661463582F0: to=<info@domain.org>, relay=none, delay=92337, delays=92306/0.03/30/0, dsn=4.4.1, status=deferred (connect to mail.ucebox.co.za[197.242.152.131]:25: Connection timed out)
postfix/smtp[19893]: 6F0BC3583CD: to=<info@domain.org>, relay=none, delay=404011, delays=403980/0.02/30/0, dsn=4.4.1, status=deferred (connect to mail.ucebox.co.za[197.242.152.131]:25: Connection timed out)
postfix/smtp[19892]: DD1D23582F6: to=<info@domain.org>, relay=none, delay=179942, delays=179912/0.03/30/0, dsn=4.4.1, status=deferred (connect to mail.ucebox.co.za[197.242.152.131]:25: Connection timed out)
All are working fine otherwise i got "status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2800:3f0:4003:c00::1a]:25: Connection timed out)"
- hide quoted text -

Waiting for a positive response.
Any kind of help would be appreciated.

Thanks,
Karniv Patel

tigalch
QA Team
Posts: 522
Joined: 2012/06/23 17:28:41
Location: Austria

Re: Postfix : Problem with sending mail

Post by tigalch » 2015/01/23 09:24:55

all your examples don't say anything about outbound email connectivity being blocked. The email log says otherways. Try 'telnet 197.242.152.131 25'. Do you get a successfull connection like when connecting to localhost?

karniv.patel
Posts: 6
Joined: 2014/08/11 05:39:26

Re: Postfix : Problem with sending mail

Post by karniv.patel » 2015/01/23 09:41:13

Hello All,
Thanks for your reply

# telnet 197.242.152.131 25
Trying 197.242.152.131...
telnet: connect to address 197.242.152.131: Connection timed out
Do i miss anything? Please let me know. Any help would be appreciated.

Thanks in advance,

Karniv Patel

tigalch
QA Team
Posts: 522
Joined: 2012/06/23 17:28:41
Location: Austria

Re: Postfix : Problem with sending mail

Post by tigalch » 2015/01/23 10:17:29

No. Just as already stated above, you can't reach outbound email servers. Something is blocking outbound connections to port 25.

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Postfix : Problem with sending mail

Post by Whoever » 2015/01/23 16:32:55

It took me literally less than 1 minute to find this link:
https://www.serverpronto.com/accounts/k ... ticle&id=1
Direct email delivery is disabled on the network for server packaged ordered after 5/15/2012.

All customers have access to our email relay service. To access the relay services configure your SMTP server to use mailout.infolink.com as a smarthost.
As stated above, many times, your outgoing email is blocked. The blocking is done by your ISP.

karniv.patel
Posts: 6
Joined: 2014/08/11 05:39:26

Re: Postfix : Problem with sending mail

Post by karniv.patel » 2015/01/27 05:05:48

Thanks for reply

Now it's working

Post Reply