All mail for all virtual-hosts going to the default servers Maildir.

Moved here form support of the commercial version - repost.

Hi there,

I am using webmin/virtualmin since many many years and am totally happy with it. I set up endless numbers of servers with it and never had any problems I couldn’t solve.

But now, apparently I ran into one:

On a webmin/virtualmin instance that runs since like 2 years without any problems, we suddenly experience issues w. email. I guess some update messed things up, but I am not sure about that or even which packet might be the cause. The current configuration of the box is a debian 7 wheezy with the latest stable updates, postfix mail_version = 2.7.1, webmin 1.7, Virtualmin 4.09gpl.

As described in the title, since like 2 weeks postfix resp. procmail is delivering ALL email to ALL virtual-servers to ONE single mailbox resp. Maildir, namely to the default account that we used when we originally set up the server hostname@hostname.tld.

Virtualmin “Re-check and refresh configuration” didn’t show any problems.

We compared postfix main.cf and master.cf to one of our other virtualmin-boxes, one which works fine: they are basically the same and /etc/procmailrc and /etc/webmin/postfix/config on both boxes are 100% identical, so the bug doesn’t seem to live there (that’s why we didn’t post them here). We stopped spamassassin, to see if this somehow caused the problem: no, same thing. greylisting is not installed. The server that is working and that we used for comparison is Virtualmin 4.08gpl though.

Reading http://www.virtualmin.com/node/34015 we tired removing the refs to the hostname at the beginning of /etc/postfix/virtual rendering all incoming mail to become undeliverable. Could our problem still be related to this post?

/var/log/mail.log always, for every mail that comes in, says like:

Aug 25 21:17:04 [hostname] postfix/local[3504]: 9D669419C62: to=<[hostname]@[hostname.tld]>, orig_to=<[username]@[hosted-domain-name] >, relay=local, delay=15, delays=0.44/0.01/0/14, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Aug 25 21:17:04 [hostname] postfix/qmgr[31448]: 9D669419C62: removed

hostname gives the current hostname. It is identical w. the domain-name which is used for the server itself and the default/first virtual-host (maybe this setup is not recommended but it worked fine for us since decades and also with this server until recently :slight_smile:

mydestination = /etc/postfix/virtual

We tried putting the actual hostname here, “hardcoded”, but this resulted in all incoming mails being returned as undeliverable.
/etc/postfix/virtual exist and contains ~250 lines.

As I said, we compared these files with the corresponding files on a working Virtualmin 4.0.8.gpl instance and couldn’t find relevant differences. Still this 4.0.9 system doesn’t deliver mail (it did until it was upgraded recently), while the 4.0.8 one does.

And reading the other post mentioned above, we are unsure, wether this is cause by the latest version of virtualmin, to which the machine was recently updated or if maybe some other package that might have been upgraded causes this erratic behaviour of the server.

Your feedback is appreciated!

Thanks,
Hans

Howdy,

My suggestion would be to change your hostname to “host.domain.tld”, a name with no existing Virtual Server, and then to troubleshoot the issue that occurs at that point (which is the user unknown problem you were describing).

However, nothing in in the Virtualmin or Postfix packages has changed that would cause this – the issue you’re seeing likely began due to some other change, perhaps some kind of setting that was enabled. If you can figure out what that was and undo it, it may resolve your issue.

Since that issue can occur though, my recommendation is to not have a Virtual Server with the same name as your hostname, and to always use a hostname with the format “host.domain.tld”.

And if you have a problem when changing to use the “host.domain.tld” format, then we could certainly troubleshoot that particular issue.

-Eric

Hello Eric,

thank you for your reply. I hope I got you right:
I logged in as root, set hostname to some “unrelated” domain, one that has no virtual host on the box, set up the domain in DNS, sent a test mails to the existing vhosts and…: all mails again ended up in the default mbox. Changing the hostname unfortunately didn’t affect or even solve the issue.

What else could we try?

Cheers,
~H.

P.S: the good news (at least for you guys :wink: is, that it doesn’t seem to be a problem that is caused by virtualmin, because it stared occurring 7 days, before we updated to 4.0.9gpl and like 3 weeks before we upgraded webmin to 1.7

Have you looked at your alias maps? It’s almost like there’s an alias that’s catching everything coming out of postfix?

Thanks Peter. Aliases seems o.k. - deactivating the domain with the hostname via virtualmin for a brief test, renders mail undeliverable again.

Fiddling and fumbling w. the box, now mail for all virtualhosts - except for one - is being delivered properly as it seems.

The one being - of course - the one that raised the issue in the 1st place. We now tried forwarding to an external address, different local mailboxes, auto-reply, literally all possible options within virtualmin, but they are all ignored and mail still goes to the default-mbox of the server. Only for this single virtualhost - all others meanwhile seem to be o.k. mail-wise…

Do I really have to delete this singel virtual host and set it up from scratch?! Any other ideas?

Thanks! :slight_smile:

this is peculiar, maybe s.o. can explain…

User has (had;) a catch all forwarding set up on this virtual-host, that recently seized to work. They had 2 addresses to which all mail for their domain was forwarded to in the past.

Following Peters train of thought I looked again into aliases and in Mail Aliases on the Postfix page of webmin deactivated the clients default-[userdomain.tld]-entry.

In the Mail Aliases part of virtualmin, I now set “All mailboxes” to an external email address. Now mail is delivered properly to this external address. The entry on the Postfix page remain deactivated.

When I add a second line w. a second address to the catch-all via virtualmin, the Mail Alias on the Postfix page of webmin is re-activated, now carries the 2 external addresses, but all mail for this domain again ends up in the default mbox of the server. Why?

userdomain.tld is not similar to the hostname, the latter being the default domain-name of the server.

i have exactly same problem, this getting me crazy, anyone can help please?

my “solution”: I set up a new server and moved everything to the new box (anyways had to do that for diff. reasons, not just the problem w. mail)

This time I used a hostname for the server, that doesn’t have a virtual host (hence no mail).

Now mail incl. aliases for all my virtual hosts works great again.

That confirms, what Eric said in the 1st answer in reply to my original post :slight_smile:

So if you don’t want to set up a new instance, make sure the hostname of the actual server does not appear anywhere in postfix, as it seems to (over-)prioritize this hostname, sending every single mail that the entire server incl. all virtual hosts receive to that account.

Good luck! :slight_smile: