Can not get email to work

Hi, i am new to virtualmin.
I am using Ubuntu and Debian.
I allready managed to get a couple of virtual servers created.
The thing i struggle with is the email part.
I have read many docs but still can’t figure out how to get this to work.

I configured virtualmin to receive email and also forward that email to my gmail. Both seem not to work.

Do i need to enable the following:
server config–>email settings–>BCC incoming email to Not currently enabled in your Postfix configuration.

In my main.cf i can not find the following lines:

virtual_alias_domains = example.com # virtual_alias_domains = example.com moredomains.com .. virtual_alias_maps = hash:/etc/postfix/virtual

Also i see the following in mail.log:

Each time hostname dhcp change and i really don’t know any of them. They are not mine.

postfix/smtpd[23082]: disconnect from unknown[202.144.141.174] Jun 16 11:52:41 ns3309703 postfix/smtpd[23082]: warning: hostname dhcp174.paro-rrco.druknet.bt does not resolve to address 202.144.141.174: Name or service not known Jun 16 11:52:41 ns3309703 postfix/smtpd[23082]: connect from unknown[202.144.141.174] Jun 16 11:52:47 ns3309703 postfix/smtpd[23082]: warning: unknown[202.144.141.174]: SASL LOGIN authentication failed: authentication failure Jun 16 11:52:47 ns3309703 postfix/smtpd[23082]: lost connection after AUTH from unknown[202.144.141.174] Jun 16 11:52:47 ns3309703 postfix/smtpd[23082]: disconnect from unknown[202.144.141.174] Jun 16 11:52:47 ns3309703 postfix/smtpd[23082]: warning: hostname dhcp174.paro-rrco.druknet.bt does not resolve to address 202.144.141.174: Name or service not known Jun 16 11:52:47 ns3309703 postfix/smtpd[23082]: connect from unknown[202.144.141.174] Jun 16 11:52:53 ns3309703 postfix/smtpd[23082]: warning: unknown[202.144.141.174]: SASL LOGIN authentication failed: authentication failure Jun 16 11:52:53 ns3309703 postfix/smtpd[23082]: lost connection after AUTH from unknown[202.144.141.174] Jun 16 11:52:53 ns3309703 postfix/smtpd[23082]: disconnect from unknown[202.144.141.174] Jun 16 11:52:54 ns3309703 postfix/smtpd[23082]: warning: hostname dhcp174.paro-rrco.druknet.bt does not resolve to address 202.144.141.174: Name or service not known Jun 16 11:52:54 ns3309703 postfix/smtpd[23082]: connect from unknown[202.144.141.174] Jun 16 11:52:58 ns3309703 postfix/smtpd[23082]: warning: unknown[202.144.141.174]: SASL LOGIN authentication failed: authentication failure Jun 16 11:52:59 ns3309703 postfix/smtpd[23082]: lost connection after AUTH from unknown[202.144.141.174] Jun 16 11:52:59 ns3309703 postfix/smtpd[23082]: disconnect from unknown[202.144.141.174] Jun 16 11:52:59 ns3309703 postfix/smtpd[23082]: warning: hostname dhcp174.paro-rrco.druknet.bt does not resolve to address 202.144.141.174: Name or service not known Jun 16 11:52:59 ns3309703 postfix/smtpd[23082]: connect from unknown[202.144.141.174]

Any help appreciated

Hi,

  • First of all if you forwarding emails to your gmail, please check spam folder if those emails are not ending up there
  • check where mail.yourdomain.com is going to…
  • check open ports on your router - if that is being hosted in your home

then we can go from there…

Hi,

  1. I checked spam. I don’t receive any mails.
  2. Not sure what you mean by where mail.domain.com is going to.Please explain question in details
  3. My site is not hosted in my home but on a dedicated server outside my home.

Hope this helps
thank you

Hi, well if that is hosted outside then you should not need to worry about ports at all. I just read your log you posted here and based on that log I would check your servers IP in corporations like spamhaus.org if your server is not black listed. I think thats why your emails not working. If your server is listed there and in other ‘antispam’ corporations you may ask them to remove your servers ip from black list.

I very strongly suggest you to install fail2ban and enable it for proftpd, sasl, dovecot and postfix along with ssh which is on by default… and change ban time from 10 minutes to something like 24 hours at least or more. Also check postfix in webmin tab for mail queue and if there are any, have look at the emails you was not send out. If any are there, remove them. Those lines from log suggesting me that your server is possibly under attack. If you already changed servers IP in past I would advice you to change your passwords too (for your root as well), to something like 16 characters mixed with capitals and numbers.

Well i checked out the spamhaus.org but my server ip address is not blacklisted.
I installed fail2ban and enabled it for proftpd,sasls,davecot,ssh and postfix and change ban time from 600sec to 86400s with action jails.I then restarted fail2ban server and start at boot:YES.

Should i also do the following:IP addresses to never ban Default (127.0.0.1/8) and then enter my computer ip address?
I then went into Servers–>postfix mail servers–>mail queue. -->No mail messages are currently queued for delivery.

I still don’t receive any mails after doing all the above. Maybe any incorrect mail configuration?
Any help appreciated
thank you

Very strange.
I created a new email user on one of my new domain names and the mail is working fine instantly on both server side and on my gmail, but then i did it for the other 2 domain names and its not working. The other 2 domain names where allready configured before and i am not sure what i did wrong. So i deleted the old user emails and did the same as the working one but now when i check if i have received a mail on the server this time i get a message that i received one but when i check in my maildir folder there is nothing there also i dont receive mail in my gmail.

What could be the cause that one is working fine and the others ones are not.

Well i am getting there.

Howdy,

What you may want to try, is to log into Usermin or RoundCube as a user in one of these problem domains, send an email – and then take a look in /var/log/mail.log to see what shows up there.

The logs should be showing what exactly is happening to that email as it leaves your server.

Feel free to paste them here, and we can help you sort out what they’re showing.

-Eric

Hi, good we have done some progress. As Eric suggested you may want to have look at mail logs which will tell you what is happening when you send out emails. It would be good if you can investigate this however you said that you created new user on new domian and emails worked instantly… you may would like to backup public_html to your hdd and recreate that server, recreate email users and reupload public_html back there to see if that worked or not. This is a bit drastic step, but I still would look at the mail logs just out of curiosity at least what is happening there. Im also glad that you set up fail2ban as well.