Email issues with Virtualmin Pro server.

So I am hosting a domain’s website only. We have the site setup and all that good stuff. We will call this domain,

All of his email and other needs are hosted through a shared hosting service he pays for. I will only be hosting the web files, mysqldb, and thats about it.

We are running into an issue where we are using Joomla as a CMS, and we have built a little form that people can fill out, then once they hit send it emails to The problem we are running into is if you check the virtualmin mailbox it has a bunch of mail delivery failures saying that does not exist. I believe the problem is, it thinks it is hosting the mail so its just sending it locally. Its not actually reaching out to the net and sending to his actual mail server.

To fix this I disabled mail completely for all of virtualmin. Yet it still will not send. Any ideas?

Disable mail in the virtual server in Virtualmin (Enabled Features in Edit Virtual Server).

That is exactly what I thought. So I did that and I am still having issues.

Web virtual server enabled? MySQL login enabled?
IP-based virtual FTP enabled? Webmin login enabled?
Allow Subversion repositories?

Those are the only enabled features.

A few thoughts – have you verified that the MX record is setup correctly?

If you log into your server over SSH, what do you get if you type:


The second line there should say “mail is handled by XXX” – is the “XXX” correct?

Also, are you sure the bounce messages you’re seeing aren’t from the remote server? That is, if the admin@ email address doesn’t exist on the shared server, that could certainly cause the trouble you’re seeing.


so when I SSH into the server that I am hosting his webfiles on (The Virtualmin Pro server) I then type host I get:

host has address mail is handled by 10

also about the bounce msg. I’m positive because I’m logged into the account we’re trying to send to waiting to see if it receives the msgs. So I know it exists.

The account does NOT exist on my Virtualmin server, which I’m hosting the web stuff on.


Any ideas?

host has address mail is handled by 10

What does resolve to? has address

Does “” appear anywhere in /etc/postfix/virtual or /etc/postfix/

Yes it does

For /etc/postfix/virtual: username username username username username

For /etc/postfix/
It does not appear to be in here.

Alright, here’s what I’d do:

First, backup your /etc/postfix/virtual file. I’m still trying to catch up on my sleep from the conference, and I’m not entirely sure I’m thinking straight yet :slight_smile:

Second, I don’t think there should be any reference to a domain in the virtual file (on the left-hand side anyhow), if your system isn’t accepting email for it. I’m not sure how those above lines snuck in there, but they should probably not exist in that file.

I would do this to correct it:

  1. You already backed up the “virtual” file, right?

  2. Remove the above 4 lines from your virtual file

  3. Regenerate the virtual file by running: postmap /etc/postfix/virtual

  4. Try sending an email again and see if it does the trick

Damn, I really hoped that would work!

Does not seem to have worked. It still will not mail to the address I have the form sending to gmail as well as another hosted site, and they all receive it no problems except for the one

Okay, can I log in and take a look? As what you’re trying to do should certainly work :wink:

If that’s okay, what I’d need are:

  1. Root login details

  2. The domain name in question

  3. The address your trying to email

You can email those details to me using Thanks!


this is from /var/log/maillog when I just did that test after editing what you told me to edit:

Jun 26 12:46:57 hostname postfix/pickup[15974]: ADFF020E0864: uid=504 from=
Jun 26 12:46:57 hostname postfix/cleanup[17399]: ADFF020E0864: message-id=9ecfe2b3b157affb08b422d9e969df11@
Jun 26 12:46:57 hostname postfix/qmgr[3274]: ADFF020E0864: from=username@hostname.localdomain, size=6899, nrcpt=3 (queue active)
Jun 26 12:46:59 hostname postfix/smtp[17401]: ADFF020E0864:,[]:25, delay=1.4, delays=0.04/0.01/0.74/0.64, dsn=2.0.0, status=sent (250 2.0.0 OK 1246046168 11si3180189yxe.85)
Jun 26 12:46:59 hostname postfix/smtp[17402]: ADFF020E0864:,[]:25, delay=2, delays=0.04/0.02/1.7/0.26, dsn=4.0.0, status=deferred (host[] said: 450 username@hostname.localdomain: Sender address rejected: Domain not found (in reply to RCPT TO command))
Jun 26 12:47:04 hostname postfix/smtp[17403]: ADFF020E0864:,[]:25, delay=6.6, delays=0.04/0.04/6/0.53, dsn=2.0.0, status=sent (250 2.0.0 OK 1246046173 39si392075agb.13)


It looks like the form may not be setting the “from” address correctly.

Is there an option to set that in there somewhere?


That is normally removed when you disable the mail feature in Virtualmin.

I guess you’ll need to remove it manually. I have no idea why it would still be there.

The issue was related to the hostname.

Although the script in question was setting the From address correctly, Google was seeing the “Return-Path” header with a hostname that wasn’t resolving correctly.

Making sure the hostname was set as desired, as well as resolvable, took care of the problem he was running into.