I am so close to going live with my VP site (and dropping my current service provider, though well-intentioned, cannot keep their SMTP server off of various blacklists) that I can almost taste it. I seem to have one ‘major’ issue and one minor one.
The major issue:
I configured an email account within MS Outlook to use the new server for POP and SMTP. Since the DNS records have not yet been moved, I simply used the IP address. I clicked the button ‘Test Account Settings’ and everything seemed to proceed normally, however, I never received the test message.
When I checked out /var/log/maillog, I found the reason: postfix (I assume) rewrote the send-to address from user@mydomain to user-mydomain@mydomain. Under virtualmin->Edit Users, I see user@mydomain and under webmin->System->Users and Groups I see both user@mydomain and user-mydomain, however, the two ‘users’ are the same as the User ID is the same. (My system is configured such that when user@mydomain is created from virtualmin, that both user@mydomain and user-mydomain are created under webmin.)
I need to ensure that this rewrite does not happen. My guess is that I am one simple setting from resolving this problem, but I do not know where to look. Please help.
Regarding the minor problem: I noticed that the time reported in /var/log/maillog is wrong. This is a virtual server and I know that I cannot change the actual clock. However, I did the following:
ln -sf /usr/share/zoneinfo/EST localtime
and after doing this, the date command and the webserver both report the proper time. However, the time reported in maillog is off by two hours. Any suggestions for how this can be fixed?
Hmm, so in the scenario you’re describing – where is the email going? Is it being delivered somewhere? Or is it bouncing?
In all honesty, I have no idea. Since I do not have a catch-all defined, it was never received; and no bounce was returned.
I just tried again, sending a test email to firstname.lastname@example.org via the VPS. Following are the relevant maillog entries:
Nov 12 02:48:54 server postfix/smtpd: connect from c-xx-xx-xx-xx.hsd1.mi.comcast.net[xx.xx.xx.xx]
Nov 12 02:48:54 server postfix/smtpd: E9CC053C100F: client=c-xx-xx-xx-xx.hsd1.mi.comcast.net[xx.xx.xx.xx], sasl_method=LOGIN, email@example.com
Nov 12 02:48:55 server postfix/cleanup: E9CC053C100F: message-id=<firstname.lastname@example.org>
Nov 12 02:48:55 server postfix/qmgr: E9CC053C100F: from=, size=4025, nrcpt=1 (queue active)
Nov 12 02:48:55 server postfix/error: E9CC053C100F: to=, orig_to=, relay=none, delay=0.17, delays=0.11/0.03/0/0.03, dsn=5.0.0, status=bounced (User unknown in virtual alias table)
Nov 12 02:48:55 server postfix/cleanup: 1788553C1F95: message-id=<20131111234855.1788553C1F95@server.mydomain.tld>
Nov 12 02:48:55 server postfix/qmgr: 1788553C1F95: from=<>, size=5962, nrcpt=1 (queue active)
Nov 12 02:48:55 server postfix/bounce: E9CC053C100F: sender non-delivery notification: 1788553C1F95
Nov 12 02:48:55 server postfix/qmgr: E9CC053C100F: removed
Nov 12 02:48:55 server postfix/error: 1788553C1F95: to=, orig_to=, relay=none, delay=0, delays=0/0/0/0, dsn=5.0.0, status=bounced (User unknown in virtual alias table)
Nov 12 02:48:55 server postfix/qmgr: 1788553C1F95: removed
Nov 12 02:48:57 server postfix/smtpd: disconnect from c-xx-xx-xx-xx.hsd1.mi.comcast.net[xx.xx.xx.xx]
Ah, I think I might understand the issue now… if you run the command “hostname”, what shows up – is it a domain in the format “domain.tld”, and not an FQDN such as “host.domain.tld”?
Sounds like you have an idea!
I telnet’ed to the server and typed hostname. The response was server.mydomain.tld.
server.mydomain.tld is the name I assigned to the virtualmin ‘server’. I created mydomain.tld as a virtual server.
Someone - please show some mercy and help. I am completely dead in the water until this issue is resolved.
It is actually correct that Postfix rewrites the destination as user-domain@serverdomain. This is how Virtualmin configures Postfix’ virtual domain table.
I can’t say exactly what’s wrong in your setup, but a correct setup should be like follows.
The rewriting line should look like so:
Nov 20 09:46:32 australis postfix/local: A54BA40913: to=<email@example.com>, orig_to=<firstname.lastname@example.org>, relay=local, delay=3.4, delays=0.4/0/0/3, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -a "$EXTENSION" -d $LOGNAME)
Make sure your
/etc/mailname contains the server’s FQDN (which should be of the form “host.domain.tld”) and that
/etc/postfix/main.cf contains these lines:
myhostname = serverhost.serverdomain.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_alias_maps = hash:/etc/postfix/virtual
myorigin = /etc/mailname
mydestination = serverhost.serverdomain.de, localhost.serverdomain.de, , localhost
Also make sure that Webmin -> Servers -> Postfix -> Virtual Domains has the setting "Domain mapping lookup table: Map specification
hash:/etc/postfix/virtual" and the map list below contains all your email addresses, in the form “Name: email@example.com MAPS TO user-domain.de”.
Thank you for the detailed reply.
Starting from the bottom of your message:
- Domain mapping table is defined
- map contains all email addresses
The problem may be this - I could not find /etc/mailname. I looked in the directory /etc and also tried using locate, but nothing was found.
I examined /etc/postfix/main.cf and found the following:
- myhostname is not defined - it is commented out
- alias_maps is defined properly
- alias_database is defined properly
- virtual_alias_maps is defined properly
- myorigin is defined to be $mydomain and mydomain is not defined (commented out)
- mydestination is defined using myhostname and mydomain which are not defined
Given your notes, I am confident that I can update main.cf. However, I do not know how to resolve the problem with /etc/mailname. Any suggestions?
One question for clarification: My virtualmin host has a FQDN of server.mydomain.tld and the one virtual server I am running is firstvps.mydomain.tld. In your notes above, is ‘serverhost’ server or firstvps?
Again, thank you.
The missing “mailname” file might be a distribution thing - what distro are you using?
You could always just try to adjust your main.cf to the values I listed (make a copy first), create the /etc/mailname file with your server’s FQDN as contents, and see if it works then.
My “serverhost” would be your server, not the first vps.
Thanks for the reply - I will try doing as you suggest.
I am using CentOS 6.4 (64 bit)
Thank you - it seems to work. I had to comment out the myorigin line, but I sent a test email and it was delivered.
Nice, glad you got it working!