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

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

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?

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.

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.

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

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=, 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.

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

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.

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.

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

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

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.

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

-Eric

Yup, Mail for Domain is enabled

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=, 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?

“Doesn’t work” is not an error description. :wink: 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.

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. :slight_smile: 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. :slight_smile: )

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.