Email unable to send out but can receive

13 posts / 0 new
Last post
#1 Sat, 09/29/2012 - 15:10
kelvin

Email unable to send out but can receive

Hi all, I am new to virtualmin and just done the setup with my home server - ubuntu machine + virtualmin + webmin + usermin.

Website is ok. But when I start to test email. I fail to send email out to gmail / yahoo / others website domain email but i can receive others. I already tried lots of google work aroung the net but still no luck on complete this.

I get the email log file: Sep 30 03:50:11 ns1 postfix/pickup[5811]: 6F3AF650FE: uid=33 from= Sep 30 03:50:11 ns1 postfix/cleanup[5975]: 6F3AF650FE: message-id=20120929195011.6F3AF650FE@ns1.mydomain.com Sep 30 03:50:11 ns1 postfix/qmgr[5812]: 6F3AF650FE: from=www-data@ns1.mydomain.com, size=2269, nrcpt=1 (queue active) Sep 30 03:50:17 ns1 postfix/local[5981]: 6F3AF650FE: to=root@ns1.mydomain.com, orig_to=, relay=local, delay=5.7, delays=0.11/0.19/0/5.4, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) Sep 30 03:50:17 ns1 postfix/qmgr[5812]: 6F3AF650FE: removed Sep 30 03:50:39 ns1 postfix/smtp[5814]: connect to alt1.gmail-smtp-in.l.google.com[74.125.142.26]:25: Connection timed out Sep 30 03:51:09 ns1 postfix/smtp[5814]: connect to alt2.gmail-smtp-in.l.google.com[74.125.137.27]:25: Connection timed out Sep 30 03:51:09 ns1 postfix/smtp[5814]: A2FB4650FB: to=mytestemail@gmail.com, relay=none, delay=512, delays=422/0.05/91/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[74.125.137.27]:25: Connection timed out)

I am using a dynamic IP at home and have no-ip service for the domain use with my dynamic ip.

It is my postfix got problem, where can i get a complete step by step guide on setup this part?

This is my post fix config files:

See /usr/share/postfix/main.cf.dist for a commented, more complete version Debian specific: Specifying a file name will cause the first line of that file to be used as the name. The Debian default is /etc/mailname. myorigin = /etc/mailname

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_use_tls=yes 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 = ns1.mydomain.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = ns1.mydomain.com, localhost.mydomain.com, , localhost mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME mailbox_size_limit = 0 recipient_delimiter = + virtual_alias_maps = hash:/etc/postfix/virtual sender_bcc_maps = hash:/etc/postfix/bcc home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination allow_percent_hack = no sender_dependent_default_transport_maps = hash:/etc/postfix/dependent

Looking for forum helper here to give guideline for me to resolve this problem.

Appreciate and thanks so much on help.

Kind Regards,

Kelvin

Sat, 09/29/2012 - 22:52
andreychek

Howdy,

Well, you're seeing "Connection timed out" errors when trying to contact port 25 on the Gmail mail server.

A lot of ISP's block port 25 -- is it possible that's what you're seeing?

-Eric

Sun, 09/30/2012 - 11:08
kelvin

Dear Eric,

Any way i can check my ISP's block port 25?

Regards,

Kelvin

Sun, 09/30/2012 - 16:46
andreychek

Howdy,

You could always use telnet -- both incoming and outgoing -- to test that.

So, from a remote server, you could try telnet'ing into your server on port 25.

And then, while logged into your server, you could try using telnet to access a remote server on port 25.

It doesn't matter which remote server, any server outside of your ISP's network should show that.

However, being as connection attempts to Google on port 25 are timing out, I do suspect that's the issue. You could always confirm that by giving them a call and asking them.

-Eric

Mon, 10/01/2012 - 02:53
kelvin

Hi Eric,

I checked with my ISP with call customer service and they said to me confirm not blocking port 25.

Any other issue might cause this?

Thanks for your help and appreciate on this.

Best Regards,

Kelvin

Mon, 10/01/2012 - 08:48
andreychek

Howdy,

What output do you receive when connecting to port 25 on another host... perhaps the Virtualmin server. You can test that by running this command:

telnet mail.virtualmin.com 25

Mon, 10/01/2012 - 11:16
kelvin

Dear Eric,

I tried telnet mail.virtualmin.com 25

Result:

telnet: Unable to connect to remote host: Connection timed out

It is firewall bloking on it?

Regards,

Kelvin

Tue, 10/02/2012 - 08:09
kelvin

Howdy,

So now i should change to use others smtp relay?

But the port 25 not get through... anyway to trace the problem?

Kelvin

Tue, 10/02/2012 - 09:39
andreychek

Howdy,

It's likely either being blocked by a firewall on your server, a device on your LAN (such as a router or hardware firewall), or your ISP.

Even though they said they aren't, I still have my suspicions about your ISP :-) It's very common to block port 25 on systems with a dynamic IP address.

However, you could verify that it's not a firewall on your server by running the command "iptables -L -n".

Also, you can setup a mail relay by going into Webmin -> Servers -> Postfix -> General Options, and set "Send outgoing mail via host".

-Eric

Wed, 10/31/2012 - 12:13 (Reply to #9)
PepinYaco

Hi Eric, using Webmin -> Servers -> Postfix -> General Options, and set "Send outgoing mail via host". (as u proposed) can you give me an example of what the settings should be if I use gmail as the relay mail? Please?

thx Eric

Tue, 10/30/2012 - 12:52
itdoug

I'm having the same issue of not being able to send. No problems telnetting out, but messages stay in the queue.

root@example:~# telnet mta7.am0.yahoodns.net 25 Trying 98.136.216.26... Connected to mta7.am0.yahoodns.net. Escape character is '^]'. 220 mta1040.mail.gq1.yahoo.com ESMTP YSmtpProxy service ready

root@example:~# telnet aspmx.l.google.com 25 Trying 173.194.77.27... Connected to aspmx.l.google.com. Escape character is '^]'. 220 mx.google.com ESMTP mg8si662166obb.147

See /usr/share/postfix/main.cf.dist for a commented, more complete version Debian specific: Specifying a file name will cause the first line of that file to be used as the name. The Debian default is /etc/mailname. myorigin = /etc/mailname

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_use_tls=yes 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 = server.example.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname

myorigin = server.example.com

mydestination = server.example.com, localhost.example.com, server.example, localhost

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

mynetworks = 127.0.0.0/8 1.1.1.1/32 mailbox_size_limit = 0 recipient_delimiter = +

inet_interfaces = all

inet_protocols = ipv4 virtual_alias_maps = hash:/etc/postfix/virtual sender_bcc_maps = hash:/etc/postfix/bcc home_mailbox = Maildir/ smtpd_sasl_auth_enable = yes broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination allow_percent_hack = no mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

tail -f /var/log/mail.log Oct 30 13:34:47 example postfix/local[11495]: D07B112C88A: to=root@server.example.com, orig_to=, relay=local, delay=0.01, delays=0/0/0/0.01, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) Oct 30 13:34:47 example postfix/qmgr[9754]: D07B112C88A: removed Oct 30 13:34:58 example postfix/smtp[12329]: connect to alt1.aspmx.l.google.com[74.125.137.26]:25: Connection timed out Oct 30 13:35:28 example postfix/smtp[12329]: connect to alt2.aspmx.l.google.com[173.194.68.26]:25: Connection timed out Oct 30 13:35:47 example postfix/pickup[12328]: C3D3212C88A: uid=0 from= Oct 30 13:35:47 example postfix/cleanup[10748]: C3D3212C88A: message-id=20121030173547.C3D3212C88A@server.example.com Oct 30 13:35:53 example postfix/qmgr[9754]: C3D3212C88A: from=root@server.example.com, size=10377, nrcpt=1 (queue active) Oct 30 13:35:53 example postfix/local[12370]: C3D3212C88A: to=root@server.example.com, orig_to=, relay=local, delay=6.3, delays=5.9/0/0/0.34, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME) Oct 30 13:35:53 example postfix/qmgr[9754]: C3D3212C88A: removed Oct 30 13:35:58 example postfix/smtp[12329]: connect to aspmx2.googlemail.com[74.125.137.26]:25: Connection timed out Oct 30 13:36:28 example postfix/smtp[12329]: connect to aspmx3.googlemail.com[173.194.68.26]:25: Connection timed out Oct 30 13:36:28 example postfix/smtp[12329]: 831F912C87D: to=webmaster@example.com, relay=none, delay=2214, delays=2064/0.01/150/0, dsn=4.4.1, status=deferred (connect to aspmx3.googlemail.com[173.194.68.26]:25: Connection timed out)

Tue, 10/30/2012 - 16:03
itdoug

Here's my config in a code wrapper. Oops.

/etc/postfix.main.cf

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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_use_tls=yes
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 = server.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#myorigin = server.example.com
mydestination = server.example.com, localhost.example.com, server.example, localhost
#mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks = 127.0.0.0/8 1.1.1.1/32
mailbox_size_limit = 0
recipient_delimiter = +
#inet_interfaces = all
inet_protocols = ipv4
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
allow_percent_hack = no
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
Thu, 11/01/2012 - 11:40
itdoug

CSF Firewall had an smtp block which allowed outbound telnet. Once disabled it started working.

Topic locked