[SOLVED] - Email was working, but now it isnt

Hi people,
I setup a few domains on my VPS (installed virtualmin via the install.sh on Ubuntu 8.04).

I was testing the email and ftp and such and it seems that incoming email isnt being delivered. Outgoing gets sent fine, but when sending an email i get the following email back saying it didnt work:

This is the mail system at host HOSTNAME.

I’m sorry to have to inform you that your message could not be delivered to one or more recipients. It’s attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

               The mail system

domain@HOSTNAME (expanded from domain@domain.co.uk):
mail for HOSTNAME loops back to myself

Reporting-MTA: dns; HOSTNAME
X-Postfix-Queue-ID: 70EC47FE620
X-Postfix-Sender: rfc822; email address it was sent from
Arrival-Date: Thu, 2 Jul 2009 15:58:45 +0100 (BST)

Final-Recipient: rfc822; domain@HOSTNAME
Original-Recipient: rfc822;domain@domain.co.uk
Action: failed
Status: 5.4.6
Diagnostic-Code: X-Postfix; mail for HOSTNAME loops back to myself

it was working last night (GMT) but has since stopped working correctly. I didn’t make any modifications to the server either.

any help/adivce is appreciated!

What happens if you go into System Settings -> Re-Check Config – does it show anything unusual?


Hmmm, i got this error:

The status of your system is being checked to ensure that all enabled features are available, that the mail server is properly configured, and that quotas are active …
Virtualmin is configured to setup DNS zones, but this system is not setup to use itself as a DNS server. Either add to the list of DNS servers, or turn off the BIND feature on the module config page.

… your system is not ready for use by Virtualmin.

I wonder why it suddenly broke :frowning:

what should i do to fix it? just add to where it says?



yes you need to add the and then save. Not apply configuration else it will disappear again…Webmin - networking - Network Configuration - Hostname and DNS Client - add it to DNS servers and click save, that’s it

Yeah, I’d recommend following Ronald’s advice for adding into the resolv.conf.

As for why it happened – is your server using DHCP? It’s possible the DHCP service is overwriting your resolv.conf file whenever it renews your IP address lease.

Hard coding a static IP could solve that. Or, there may be an option for telling DHCP not to change your DNS servers.


Hi thanks for the advice.

I followed the advice of going into webmin and tested it. I still got the error mail back to the sending address.

How can I test for dhcp?
Where is the resolv.conf? Or does the webmin instructions edit that file?



So just to verify – does the “re-check config” work now?

(we can come back to the DHCP settings in a moment)


Hi. Sorry I should tested that before posting (doh!)

I can confirm that the re-check config is now all good.

Like I said however, I tested emailing an address and still got the error email.


Do emails for other domains work?

Ie, is it just this one domain that’s having trouble, or do they all have similar issues?


hi eric, i can confirm that it is all domains that are having the same issue with emails.
any idea as to what it could be?


No, not really. Things shouldn’t just randomly break :slight_smile:

I can take a quick peek if you like – I’ll need that login info again though – you can send it to eric@virtualmin.com.

Can you include an example email address that isn’t working in your email?



Looks like this may have been a hostname related issue.

I made sure the current hostname was set in “mydestination” in /etc/postfix/main.cf, restarted Postfix – and the test email I sent seemed to go through!


I have to thanks again to Eric. He’s done so much and he knows exactly what he’s doing!

Don’t want to raise threads from the dead, but in case it’s helpful I can report the same problem with 3.72.gpl — which was fixed by modifying /etc/postfix/main.cf as Eric described.



Thanks for the info!

Do you happen to recall if anything on your system changed around the time it stopped working? Had your hostname changed along the way or so?

I’m just trying to piece together how it is this particular issue arises.



I’m not sure if this is the direct cause, but it’s the last thing I remember doing before noticing the email failures:

Under “Edit Virtual Server” --> “Enabled Features” I unchecked the “Mail for domain enabled?” box (which had been checked since the creation of the virtual server).

This, as expected, disabled mail for that domain. However, I later went back to re-enable mail for domain via the same checkbox.

After doing this, I noticed that deliveries to all virtual servers were failing. Mail heading outbound worked fine the whole time.

Thanks again for your generous support. The forum archives have been invaluable to getting my server working.

I can confirm that if you change the host name in VirtualMin’s gui, it does not update etc/postfix/main.cf