LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ubuntu mailser not receiving emails (http://www.linuxquestions.org/questions/linux-newbie-8/ubuntu-mailser-not-receiving-emails-823553/)

raspino 08-02-2010 09:02 AM

ubuntu mailser not receiving emails
 
I recently setup a mailserver on ubuntu server. I am able to send emails correctly. However, no emails show up when sent to me on this server. I can send emails to myself on the server but not outside email like yahoo.com or gmail or any other emails can reach me. My MX and A record appear to have been set up correctly. My router seems to receive hits when I receive emails. When I check the logs of the router it tells me that there was a remote attempt to send traffic to the router forwarded to the server but I don't see this traffic in any mailbox. When I do pingability.com for my site, I get the following error message:
Error There was a problem while talking with the mail server. Got 'Socket Timeout Exception: connect timed out'

So somehow, the email traffic seems to get to my router and my router appears to forward it to my server but it does timeout. The emails eventually bounce back into my gmail with the following error message:

mail.raspinostores.com. (10): Connection timed out]

Here is the content of my main.cf

# 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 = mail.raspinostores.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#myorigin = raspinostores.com
mydestination = mail.raspinostores.com, raspinostores.com, localhost.raspinostores.com, localhost
relayhost = $mydomain
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
41,1 Bot


Any help will be appreciated.

raspino 08-02-2010 09:24 AM

here is my postconf -n
 
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = mail.raspinostores.com, raspinostores.com, localhost.raspinostores.com, localhost
myhostname = mail.raspinostores.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = $mydomain
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
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
smtpd_use_tls = yes

repo 08-02-2010 09:47 AM

Any firewall?

lartman 08-02-2010 10:12 AM

Quote:

When I do pingability.com for my site, I get the following error message:
Error There was a problem while talking with the mail server. Got 'Socket Timeout Exception: connect timed out'

So somehow, the email traffic seems to get to my router and my router appears to forward it to my server but it does timeout. The emails eventually bounce back into my gmail with the following error message:

mail.raspinostores.com. (10): Connection timed out]
To test connectivity 'telnet mail.raspinostores.com 25' and you should get a greeting from the smtp server.

Those error messages indicate the traffic isn't reaching your server. First check the firewall on the server is open to email. Then check the network.

nslookup shows mail should go to:
Code:

raspinostores.com      mail exchanger = 10 mail.raspinostores.com.
mail.raspinostores.com  internet address = 68.83.209.139

however traceroute only gets as far as
Code:

traceroute to mail.raspinostores.com (68.83.209.139), 30 hops max, 40 byte packets
...
19  68.85.130.86 (68.85.130.86)  230.766 ms  230.560 ms  230.341 ms
20  68.85.67.25 (68.85.67.25)  231.010 ms  230.962 ms  230.964 ms
21  68.85.67.17 (68.85.67.17)  247.763 ms  247.606 ms  247.961 ms
22  68.85.80.146 (68.85.80.146)  247.731 ms  247.783 ms  247.744 ms
23  * * *

This hop is probably where the traffic is being lost. Is the mail server behind a NAT firewall? If so port 25 needs to be forwarded to the mail server.

raspino 08-02-2010 10:44 AM

Quote:

Originally Posted by lartman (Post 4052670)
To test connectivity 'telnet mail.raspinostores.com 25' and you should get a greeting from the smtp server.

Those error messages indicate the traffic isn't reaching your server. First check the firewall on the server is open to email. Then check the network.

This is correct.

nslookup shows mail should go to:
Code:

raspinostores.com      mail exchanger = 10 mail.raspinostores.com.
mail.raspinostores.com  internet address = 68.83.209.139

however traceroute only gets as far as
Code:

traceroute to mail.raspinostores.com (68.83.209.139), 30 hops max, 40 byte packets
...
19  68.85.130.86 (68.85.130.86)  230.766 ms  230.560 ms  230.341 ms
20  68.85.67.25 (68.85.67.25)  231.010 ms  230.962 ms  230.964 ms
21  68.85.67.17 (68.85.67.17)  247.763 ms  247.606 ms  247.961 ms
22  68.85.80.146 (68.85.80.146)  247.731 ms  247.783 ms  247.744 ms
23  * * *

This hop is probably where the traffic is being lost. Is the mail server behind a NAT firewall? If so port 25 needs to be forwarded to the mail server.

Correct. The server was down when you tested. I had to leave for work so I powered it off. But you probably would not have reached the server anyway.

Also, I have forwarded port 25 to the IP address of the server.

I am inclined to think that it is a firewall issue or it is probably a configuration problem but I have not idea. Help, I need :-)

repo 08-02-2010 10:46 AM

Quote:

I am inclined to think that it is a firewall issue or it is probably a configuration problem but I have not idea. Help, I need :-)
Do you have a firewall?
If yes disable it, and try again.

raspino 08-02-2010 11:07 AM

Quote:

Originally Posted by repo (Post 4052705)
Do you have a firewall?
If yes disable it, and try again.

you mean a firewall on the server? I am not sure. It was probably installed by default when I installed the server. Do you know how I can check to see if I have one?

repo 08-02-2010 11:10 AM

In a terminal type
Code:

# iptables -L
Make sure port 25 is forwarded to the server on the router.

raspino 08-02-2010 11:17 AM

Quote:

Originally Posted by repo (Post 4052730)
In a terminal type
Code:

# iptables -L
Make sure port 25 is forwarded to the server on the router.

the last time I tried iptables it looks like it was not installed. I will give it a try this evening and post a reply. Thanks for your help...very much appreciated.

repo 08-02-2010 11:18 AM

You need to issue the command as root

raspino 08-02-2010 06:30 PM

Quote:

Originally Posted by repo (Post 4052738)
You need to issue the command as root

I was able to see the results. Is there anything in particular I should be looking for?

raspino 08-02-2010 06:49 PM

Quote:

Originally Posted by repo (Post 4052738)
You need to issue the command as root

OK. I was able to open port 25 and that did the trick. Thanks a lot for saving me all those sleepless nights.

repo 08-03-2010 06:57 AM

Quote:

Correct. The server was down when you tested. I had to leave for work so I powered it off. But you probably would not have reached the server anyway.
Do you have a backupserver configured to receive the mail in case your server is down ?

raspino 08-04-2010 10:45 AM

Quote:

Originally Posted by repo (Post 4053764)
Do you have a backupserver configured to receive the mail in case your server is down ?

Unfortunately not. I think I will eventually setup a backup server.

BTW, I ran into the same problem again. By reading around, I saw that I did not save the changes I made when I opened Port 25 on the server and even after supposedly saving it, I am still having the a similar problem like the one I first reported. I
when I opened the port again by doing

sudo iptables -A INPUT -p tcp --dport 25 -j ACCEPT

again and I was still not receiving emails. Pingability indicates that it cannot reach the server. However, I do not see any logs in my router to indicate that traffic was forwarded (like I used to see before the I opened the port) which may mean that they are forwarded and logged somewhere on the server, I looked at the logs briefly but did not understand much. I have the server currently turned off. I will turn it back on later today and try to see if I can fix it. If not, I will post a message here. If you have any tips too, please let me know.
Thanks,

raspino 08-04-2010 09:12 PM

I am getting a connection refused when I send a mail. So now I can't send a mail nor receive one. I may have to search for another solution. I think this was caused by trying to configure squirrelmail yesterday.


All times are GMT -5. The time now is 11:00 AM.