How to fix Postfix "No route to host" Problem :: May 25 2014
Categories :
Server Management

yesterday , i have a email server to config and as my usual i start to config MTA with postfix ,
i was configured anything right and server didnt not work correctly ,
i try to read /var/log/maillog and i find No route to host error on port 25 to any mail server that i tried to send mail to ,

example log :

May 24 17:30:20 server postfix/smtp[6502]: connect to[]:25: No route to host

i wonder and get a little angry whats wrong with this postfix(censored :D) ..

at first step i ping mail server of google ( to test if google blocked my server ip ,
and anything was fine ,
i recieved icmp reply from server ,

if you cant receive icmp reply , first of all stop firewall with service iptables stop and retest again , if problem continues try to search your ip on google maybe your ip abused before and listed in spamlists ... in this case its better to contact your service provider instead of contact directly to spamlist providers.

then i did a extra check with nmap and i suprisely find ports are blocked in network,

so i guess maybe its a network limitation and search on service provider website for mail problems and i find out they limited any access to other mail servers and start a local relay server for sendmail (for security reasons) ,

so so , i find relay server address and add relay server to my /etc/postfix/ like this :


then restart postfix by :

service postfix restart

and problem was gone ....