Can't receive or send email

21 posts / 0 new
Last post
#1 Tue, 03/11/2014 - 10:55
danyz

Can't receive or send email

Hello,

it's three days I'm trying to get my new Virtualmin install to send and receive emails using Postfix server with no success and I'm getting nuts! o_O

I read a lot of topics on this subject but couldn't really come up with a solution, basically I have Virtualmin installed and Postfix configured and rinning. I created an email account for one of my virtual servers and tried downloading email using an email client (thunderbird) but it just doesn't connect to the email.

So I tried accessing webmail.mydoman.com and https://mydomain.com:20000 but it doesn't connect, it gives a server error.

I have BIND disabled because I'm using an external DNS service where I created A records pointing to my static IP address and an MX record point to mail.mydomain.com

Is there something I'm doing wrong?

The mail log isn't reporting any error, the only thing I'm in doubt of is it's normal that the smtp is point to localhost like in this entry:

Mar 11 16:11:00 localhost postfix/anvil[5003]: statistics: max connection rate 1/60s for (smtp:127.0.0.1) at Mar 11 16:07:40

Thank you very much for the support

Tue, 03/11/2014 - 11:04
Locutus

What's the actual domain name in question? If neither Postfix nor Webmail can be reached, I'm assuming it's a DNS problem.

Tue, 03/11/2014 - 11:14 (Reply to #2)
danyz

Thank you Locutus for answering. The domain name is http://umiditabrescia.it.

The DNS settings I have are:

Record A

ftp.umiditabrescia.it my public IP address

mail.umiditabrescia.it my public IP address

umiditabrescia.it my public IP address

www.umiditabrescia.it my public IP address

Record MX

mail.umiditabrescia.it my public IP address

Do I have to add something?

Tue, 03/11/2014 - 11:58
Locutus

That domain name resolves to the IP 5.249.140.66. That IP does not react to connections on any of the usual email ports (25, 110, 143) and also not on 20000.

You might want to make sure that no external, local or hoster-based firewall is blocking those ports (check the local firewall with iptables -n -L), that the respective daemons are listening on it (check with netstat -tpln) and/or that the ports are forwarded properly if you use NAT.

Tue, 03/11/2014 - 12:20 (Reply to #4)
danyz

This is the result of iptables -n -L

Chain INPUT (policy ACCEPT)

target     prot opt source               destination    
   
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED

ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0          

ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0          

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:80

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:10000

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:21

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:20

ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpts:35000:35999 flags:0x17/0x02

REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited


Chain FORWARD (policy ACCEPT)

target     prot opt source               destination        

REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination   

And this is the result of netstat -tpln:

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  

tcp        0      0 0.0.0.0:110                 0.0.0.0:*                   LISTEN      1534/dovecot       

tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN      1682/perl          

tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      1624/httpd         

tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN      1342/vsftpd        

tcp        0      0 127.0.0.1:11000             0.0.0.0:*                   LISTEN      1668/lookup-domain-

tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1614/master        

tcp        0      0 0.0.0.0:443                 0.0.0.0:*                   LISTEN      1624/httpd         

tcp        0      0 0.0.0.0:20000               0.0.0.0:*                   LISTEN      1675/perl          

tcp        0      0 0.0.0.0:995                 0.0.0.0:*                   LISTEN      1534/dovecot       

tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      1510/mysqld        

tcp        0      0 :::110                      :::*                        LISTEN      1534/dovecot       

tcp        0      0 :::995                      :::*                        LISTEN      1534/dovecot

I can actually see with this last test that ports 25, 110 and 20000 are listening.

Tue, 03/11/2014 - 14:49
Locutus

Okay your iptables firewall is blocking those ports, you need to add the proper allow rules to it in Webmin's firewall module.

Tue, 03/11/2014 - 15:30
danyz

Okay Locutus, we're getting there thanks to to your help.

I enabled the ports 25, 110, 143 and 20000 on the Linux Firewall and now I can access them through the browser, however when adding the email account to the client (Thunderbird) it doesn't connets and the client error says "The server answers with: +"

While the error log now says:

Mar 11 21:06:24 localhost dovecot: pop3-login: Disconnected (auth failed, 2 attempts): user=<info@umiditabrescia.it>, method=PLAIN, rip=2.235.177.51, lip=5.249.140.66, TLS

Mar 11 21:06:49 localhost dovecot: pop3-login: Login: user=<info.umiditabrescia>, method=PLAIN, rip=2.235.177.51, lip=5.249.140.66, mpid=14110, TLS

Mar 11 21:06:49 localhost dovecot: pop3(info.umiditabrescia): Error: user info.umiditabrescia: Initialization failed: mail_location not set and autodetection failed: Mail storage autodetection failed with home=/home/umiditabrescia/homes/info

Mar 11 21:06:49 localhost dovecot: pop3(info.umiditabrescia): Error: Invalid user settings. Refer to server log for more information.
Tue, 03/11/2014 - 16:22
andreychek

Howdy,

You may have some problems with your Dovecot settings... what output do you receive when running this command:

dovecot -n

Also, what distro/version are you using?

-Eric

Wed, 03/12/2014 - 03:38
danyz

When I run dovecot -n I get the following:

# 2.0.9: /etc/dovecot/dovecot.conf

# OS: Linux 2.6.32-358.2.1.el6.x86_64 x86_64 CentOS release 6.4 (Final)
mbox_write_locks = fcntl
passdb {
  driver = pam
}

protocols = pop3

ssl_cert = </etc/pki/dovecot/certs/dovecot.pem

ssl_key = </etc/pki/dovecot/private/dovecot.pem

userdb {
  driver = passwd
}

About the distro/version I'm on Red-Hat.

Wed, 03/12/2014 - 04:22
danyz

Ok so I add to dovecot.conf the following line:

mail_location = maildir:~/Maildir

and now the email client connects to the email! However it works fine when sending emails but the email itslef is not receiving anything. I've tried sending a couple of emails to info@mydomain.com but it's they're not being received. I also checked in Webmin > Server > Postfix Mail Server > User Mailboxes > account but there's nothing.

Wed, 03/12/2014 - 09:13
andreychek

Howdy,

You may want to take a look at the email logs in /var/log/maillog, as well as the procmail log in /var/log/procmail.log, to see what is occurring when sending that email.

Also, are you able to send email to addresses that aren't on your server?

-Eric

Wed, 03/12/2014 - 09:37
danyz

Hello andreychek,

the maillog isn't reporting any error while the procmail.log is empty actually.

Yes I can send email to other servers other than mine, I've tried sending to yahoo mail and it works great.

The problem is I can't receive emails. I've tried sending an email from within Webmin to the email address I created and the email comes back with Returned email: see transcript for details

----- Transcript of session follows -----

... while talking to [127.0.0.1]:

>>> DATA

<<< 554 5.7.1 <info@umiditabrescia.it>: Relay access denied

554 5.0.0 Service unavailable

<<< 554 5.5.1 Error: no valid recipients
Wed, 03/12/2014 - 10:14
Locutus

Please post an excerpt from /var/log/mail.log (or the equivalent in your distro) at the time of delivery attempt, and the contents of /etc/postfix/virtual.

Wed, 03/12/2014 - 11:10
danyz

This is the excerpt from maillog on the time of sending the internal email:

Mar 12 15:15:06 localhost sendmail[25655]: s2CEF6YZ025655: from=umiditapavia@localhost, size=445, class=0, nrcpts=1, msgid=<1394633706.25621@localhost>, relay=root@localhost

Mar 12 15:15:06 localhost postfix/smtpd[25656]: connect from localhost[127.0.0.1]

Mar 12 15:15:06 localhost postfix/smtpd[25656]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <info@umiditabrescia.it>: Relay access denied; from=<umiditapavia@localhost.localdomain> to=<info@umiditabrescia.it> proto=ESMTP helo=<localhost.localdomain>

Mar 12 15:15:06 localhost sendmail[25655]: s2CEF6YZ025655: to=info@umiditabrescia.it, ctladdr=umiditapavia@localhost (502/501), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30445, relay=[127.0.0.1] [127.0.0.1], dsn=5.7.1, stat=Service unavailable

Mar 12 15:15:06 localhost sendmail[25655]: s2CEF6YZ025655: s2CEF6Ya025655: DSN: Service unavailable

Mar 12 15:15:06 localhost postfix/smtpd[25656]: 421E982DCE: client=localhost[127.0.0.1]

Mar 12 15:15:06 localhost postfix/cleanup[25660]: 421E982DCE: message-id=<201403121415.s2CEF6Ya025655@localhost.localdomain>

Mar 12 15:15:06 localhost postfix/qmgr[786]: 421E982DCE: from=<>, size=2678, nrcpt=1 (queue active)

Mar 12 15:15:06 localhost sendmail[25655]: s2CEF6Ya025655: to=umiditapavia@localhost, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31469, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 421E982DCE)

Mar 12 15:15:06 localhost postfix/smtpd[25656]: disconnect from localhost[127.0.0.1]

Mar 12 15:15:06 localhost postfix/local[25665]: 421E982DCE: to=<umiditapavia@localhost.localdomain>, relay=local, delay=0.12, delays=0.06/0.02/0/0.04, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail)

Mar 12 15:15:06 localhost postfix/qmgr[786]: 421E982DCE: removed

And this is from etc/postfix/virtual:

trovaziende@trovaziende.net trovaziende

trovaziende.net trovaziende.net

Should I set something else in virtual?

Wed, 03/12/2014 - 11:21
andreychek

Hmm, in Virtualmin, if you look at the "Enabled Features" for the "umiditabrescia.it" domain, is the "Mail for Domain" feature enabled?

-Eric

Wed, 03/12/2014 - 11:32
danyz

Yup, Mail for Domain is enabled

Mon, 03/17/2014 - 12:00
danyz

Hello, I've created another virtual server with another email account and set all the DNS like the former one but now I can't receive any email neither from within the server or using an email client and can't even send them.

Ports 25, 110, 143, 20000 are open. This is what the maillog says:

Mar 17 17:33:55 localhost dovecot: pop3-login: Login: user=<info@trovaziende.net>, method=PLAIN, rip=93.56.192.24, lip=5.249.140.66, mpid=13203, TLS

Mar 17 17:33:55 localhost dovecot: pop3(info@trovaziende.net): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

Mar 17 17:36:34 localhost dovecot: pop3-login: Login: user=<info@trovaziende.net>, method=PLAIN, rip=93.56.192.24, lip=5.249.140.66, mpid=13296, TLS

Mar 17 17:36:34 localhost dovecot: pop3(info@trovaziende.net): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

So appartently there's no problem but I can't receive or send emails. I have a doubt though. A have dns A and MX records pointing to mail.mydomain.com. Should I have to create a subdomin for the mail.mydomain.com?

Mon, 03/17/2014 - 12:07
Locutus

"Doesn't work" is not an error description. ;) What exactly happens when you try to send or receive email? Please tell us the error messages the client gets and what gets logged in the mail log at the moment of delivery attempt.

Also please tell us the actual domain name instead of the placeholder, otherwise we can't do tests if there are missing A/MX records.

Mon, 03/17/2014 - 12:58
danyz

Sorry. So the domain is trovaziende.net and I've tried with umiditabrescia.it which is on th same server.

CLIENT THUNDERBIRD:

When trying to send email from info@trovaziende.net with thunderbird it shows an error saying: "Couldn't connet to server mail.trovaziende.net. The server could be unreacheble or it doesn't accept SMTP connections". The settings are set to port 25, correct username and password. Authentication is STARTTLS and normal password.

When trying to receive it connects correctly but it doensn't download anything because I can't receive any email.

SENDING EMAIL FROM Webmin > Servers > Postfix Mail Server > User Mailboxes

If I try to send emails from Webmin I get the confirmation that the massage was sent correctly but then no message is received. I've tried sending to a yahoo email address and another internal email account but no message was recieved in both cases.

This is what the maillog says:

Mar 17 18:27:39 localhost sendmail[14854]: s2HHRd3m014854: to=info@trovaziende.net, ctladdr=info@umiditabrescia.it (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30473, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 6D7F3844CD)

Mar 17 18:27:39 localhost postfix/smtpd[14855]: disconnect from localhost[127.0.0.1]

Mar 17 18:27:39 localhost postfix/smtp[14860]: 6D7F3844CD: to=<info-trovaziende.net@localdomain.localdomain>, orig_to=<info@trovaziende.net>, relay=none, delay=0.08, delays=0.06/0.01/0.01/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found)

Mar 17 18:27:39 localhost postfix/cleanup[14859]: 8629E84DAE: message-id=<20140317172739.8629E84DAE@DMGItalia.localdomain>

Mar 17 18:27:39 localhost postfix/qmgr[13117]: 8629E84DAE: from=<>, size=2956, nrcpt=1 (queue active)

Mar 17 18:27:39 localhost postfix/bounce[14861]: 6D7F3844CD: sender non-delivery notification: 8629E84DAE

Mar 17 18:27:39 localhost postfix/qmgr[13117]: 6D7F3844CD: removed

Mar 17 18:27:39 localhost postfix/smtp[14860]: 8629E84DAE: to=<info-umiditabrescia.it@localdomain.localdomain>, orig_to=<info@umiditabrescia.it>, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found)

Mar 17 18:27:39 localhost postfix/qmgr[13117]: 8629E84DAE: removed

Mar 17 18:28:06 localhost sendmail[14907]: s2HHS6nc014907: from=info@trovaziende.net, size=462, class=0, nrcpts=1, msgid=<1395077286.14905@trovaziende.net>, relay=root@localhost

Mar 17 18:28:06 localhost postfix/smtpd[14855]: connect from localhost[127.0.0.1]

Mar 17 18:28:06 localhost postfix/smtpd[14855]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <danielmarchini@yahoo.it>: Relay access denied; from=<info@trovaziende.net> to=<danielmarchini@yahoo.it> proto=ESMTP helo=<localhost.localdomain>

Mar 17 18:28:06 localhost sendmail[14907]: s2HHS6nc014907: to=danielmarchini@yahoo.it, ctladdr=info@trovaziende.net (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30462, relay=[127.0.0.1] [127.0.0.1], dsn=5.7.1, stat=Service unavailable

Mar 17 18:28:06 localhost sendmail[14907]: s2HHS6nc014907: s2HHS6nd014907: DSN: Service unavailable

Mar 17 18:28:06 localhost postfix/smtpd[14855]: 52612844CD: client=localhost[127.0.0.1]

Mar 17 18:28:06 localhost postfix/cleanup[14859]: 52612844CD: message-id=<201403171728.s2HHS6nd014907@localhost.localdomain>

Mar 17 18:28:06 localhost postfix/qmgr[13117]: 52612844CD: from=<>, size=2648, nrcpt=1 (queue active)

Mar 17 18:28:06 localhost sendmail[14907]: s2HHS6nd014907: to=info@trovaziende.net, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31486, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 52612844CD)

Mar 17 18:28:06 localhost postfix/smtp[14860]: 52612844CD: to=<info-trovaziende.net@localdomain.localdomain>, orig_to=<info@trovaziende.net>, relay=none, delay=0.04, delays=0.04/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found)

Mar 17 18:28:06 localhost postfix/qmgr[13117]: 52612844CD: removed

Mar 17 18:28:06 localhost postfix/smtpd[14855]: disconnect from localhost[127.0.0.1]

Mar 17 18:28:45 localhost dovecot: pop3-login: Login: user=<info@umiditabrescia.it>, method=PLAIN, rip=2.235.177.51, lip=5.249.140.66, mpid=14917, TLS

Mar 17 18:28:45 localhost dovecot: pop3(info@umiditabrescia.it): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

Mar 17 18:29:15 localhost dovecot: pop3-login: Login: user=<info@trovaziende.net>, method=PLAIN, rip=2.235.177.51, lip=5.249.140.66, mpid=14919, TLS

Mar 17 18:29:15 localhost dovecot: pop3(info@trovaziende.net): Disconnected: Logged out top=0/0, retr=0/0, del=0/0, size=0

Mar 17 18:29:42 localhost sendmail[14934]: s2HHTg2j014934: from=info@trovaziende.net, size=462, class=0, nrcpts=1, msgid=<1395077382.14932@trovaziende.net>, relay=root@localhost

Mar 17 18:29:42 localhost postfix/smtpd[14855]: connect from localhost[127.0.0.1]

Mar 17 18:29:42 localhost postfix/smtpd[14855]: 2AEF1844CD: client=localhost[127.0.0.1]

Mar 17 18:29:42 localhost postfix/cleanup[14859]: 2AEF1844CD: message-id=<1395077382.14932@trovaziende.net>

Mar 17 18:29:42 localhost postfix/qmgr[13117]: 2AEF1844CD: from=<info@trovaziende.net>, size=839, nrcpt=1 (queue active)

Mar 17 18:29:42 localhost sendmail[14934]: s2HHTg2j014934: to=info@umiditabrescia.it, ctladdr=info@trovaziende.net (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30462, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 2AEF1844CD)

Mar 17 18:29:42 localhost postfix/smtp[14860]: 2AEF1844CD: to=<info-umiditabrescia.it@localdomain.localdomain>, orig_to=<info@umiditabrescia.it>, relay=none, delay=0.07, delays=0.06/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found)

Mar 17 18:29:42 localhost postfix/cleanup[14859]: 3FEFF84DAE: message-id=<20140317172942.3FEFF84DAE@DMGItalia.localdomain>

Mar 17 18:29:42 localhost postfix/smtpd[14855]: disconnect from localhost[127.0.0.1]

Mar 17 18:29:42 localhost postfix/qmgr[13117]: 3FEFF84DAE: from=<>, size=2951, nrcpt=1 (queue active)

Mar 17 18:29:42 localhost postfix/bounce[14861]: 2AEF1844CD: sender non-delivery notification: 3FEFF84DAE

Mar 17 18:29:42 localhost postfix/qmgr[13117]: 2AEF1844CD: removed

Mar 17 18:29:42 localhost postfix/smtp[14860]: 3FEFF84DAE: to=<info-trovaziende.net@localdomain.localdomain>, orig_to=<info@trovaziende.net>, relay=none, delay=0.03, delays=0.02/0/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=localdomain.localdomain type=AAAA: Host not found)

Mar 17 18:29:42 localhost postfix/qmgr[13117]: 3FEFF84DAE: removed
Mon, 03/17/2014 - 13:44
Locutus

Hmm, I see a lot of errors in the log pertaining to an attempt to resolve "localdomain.localdomain". Is that what you set as the FQDN of your server? That's a problem then... If you'd like to host email and DNS zones on your server, it needs a resolvable fully qualified domain name, like "myserver.mydomain.com" where all of that has to be valid existing names.

The name "mail.trovaziende.net" resolves to the IP 5.249.140.66, and indeed port 25 is unreachable on that IP. You need to verify that no local or external firewall is blocking that port.

Otherwise, this issue is unfortunately getting a little too complex and time-consuming to try to solve via the forum. :) I can offer personal support via instant messenger/screen sharing, which I can do for free for a certain amount of time (about an hour). If you'd like that, please contact me on Skype (user "Loc2262"), I'm in timezone UTC+1.

(If you aren't using this server for production purposes yet, it might be easier to reinstall and cleanly start over, considering the amount of issues you're facing. :) )

Sat, 03/22/2014 - 09:43
danyz

Thank you Locutus for your support. I finally managed to get it working. It was a problem with the DNS and the wrong FQDN. Now it's all working, I can send and receive emails correctly but I have to add every IP I use to access emails to "mynetworks" in etc/postifx/main.cf otherwise I can't download or send emails using THunderbird.