So I am hosting a domain’s website only. We have the site setup and all that good stuff. We will call this domain, mydomain.com.
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 firstname.lastname@example.org. The problem we are running into is if you check the virtualmin mailbox it has a bunch of mail delivery failures saying that email@example.com 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 mydomain.com I get:
mydomain.com has address 184.108.40.206
mydomain.com mail is handled by 10 mx.mydomain.com.
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.
host mydomain.com mydomain.com has address 220.127.116.11 mydomain.com mail is handled by 10 mx.mydomain.com.
What does mx.mydomain.com resolve to?
mx.mydomain.com has address 18.104.22.168
Does “mydomain.com” appear anywhere in /etc/postfix/virtual or /etc/postfix/main.cf?
Yes it does
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
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:
You already backed up the “virtual” file, right?
Remove the above 4 lines from your virtual file
Regenerate the virtual file by running: postmap /etc/postfix/virtual
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 @mydomain.com. I have the form sending to gmail as well as another hosted site, @physikal.com and they all receive it no problems except for the one @mydomain.com
Okay, can I log in and take a look? As what you’re trying to do should certainly work
If that’s okay, what I’d need are:
Root login details
The domain name in question
The address your trying to email
You can email those details to me using firstname.lastname@example.org. 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: ADFF020E0864: uid=504 from=
Jun 26 12:46:57 hostname postfix/cleanup: ADFF020E0864: email@example.com
Jun 26 12:46:57 hostname postfix/qmgr: ADFF020E0864: firstname.lastname@example.org, size=6899, nrcpt=3 (queue active)
Jun 26 12:46:59 hostname postfix/smtp: ADFF020E0864: email@example.com, relay=gmail-smtp-in.l.google.com[22.214.171.124]: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: ADFF020E0864: firstname.lastname@example.org, relay=mx.mydomain.com[126.96.36.199]:25, delay=2, delays=0.04/0.02/1.7/0.26, dsn=4.0.0, status=deferred (host mx.mydomain.com[188.8.131.52] said: 450 email@example.com: Sender address rejected: Domain not found (in reply to RCPT TO command))
Jun 26 12:47:04 hostname postfix/smtp: ADFF020E0864: firstname.lastname@example.org, relay=ASPMX.L.GOOGLE.com[184.108.40.206]: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.