Small (?) mail-issue. Trouble sending to same domain at google apps

16 posts / 0 new
Last post
#1 Mon, 04/12/2010 - 10:24
gfors

Small (?) mail-issue. Trouble sending to same domain at google apps

Hey,

It's probably my own incompetence and lack of knowledge but I can't figure this out.

I have Virtualmin set up on my VPS-hosted server. I use Google Apps for mail. The host has controls for managing DNS settings, so I have BIND DNS turned off in Virtualmin. All the DNS records are correct and working for Google Apps, everything works fine with the mail. The mail features are turned off in virtualmin. (no Mail for Domain)

The problem arises when I use one of my webforms (PHP Mail) to send a mail to any address at my own domain (which is handled by Google Apps). For instance I want my "contact us" form to send to info@mydomain.se.

It works fine when I set the receiving address to any other recipient, such as my personal e-mail elsewhere.

I get this from mail.log:

Apr 12 17:07:37 grey postfix/pickup[9585]: 886D319FCCE7: uid=33 from= Apr 12 17:07:37 grey postfix/cleanup[17832]: 886D319FCCE7: message-id=20100412150737.886D319FCCE7@mydomain.se Apr 12 17:07:37 grey postfix/qmgr[9588]: 886D319FCCE7: from=<www-data@se>, size=384, nrcpt=1 (queue active) Apr 12 17:07:37 grey postfix/local[17834]: 886D319FCCE7: to=info@mydomain.se, relay=local, delay=0.04, delays=0.03/0/0/0, dsn=5.1.1, status=bounced (unknown user: "info") Apr 12 17:07:37 grey postfix/cleanup[17832]: 8FDFA19FCCED: message-id=20100412150737.8FDFA19FCCED@mydomain.se Apr 12 17:07:37 grey postfix/bounce[17835]: 886D319FCCE7: sender non-delivery notification: 8FDFA19FCCED Apr 12 17:07:37 grey postfix/qmgr[9588]: 886D319FCCE7: removed Apr 12 17:07:37 grey postfix/qmgr[9588]: 8FDFA19FCCED: from=<>, size=1973, nrcpt=1 (queue active) Apr 12 17:07:37 grey postfix/local[17834]: 8FDFA19FCCED: to=<www-data@se>, relay=local, delay=0.01, delays=0/0/0/0, dsn=5.2.0, status=bounced (can't create user output file. Command output: procmail: Unable to treat as directory "/var/$ Apr 12 17:07:37 grey postfix/qmgr[9588]: 8FDFA19FCCED: removed

I'm guessing the mailserver tries to find a local account since it's the same domain, and trashes the mail since there is no "info" account. But where can I turn this off so that it just sends even though it's the same domain as a recipient?

PLEASE, does anyone have any help for me? I'm going nuts here. Thank you!

Mon, 04/12/2010 - 10:41
andreychek

I'm guessing the mailserver tries to find a local account since it's the same domain, and trashes the mail since there is no "info" account. But where can I turn this off so that it just sends even though it's the same domain as a recipient?

I suspect you're right, that it's trying to deliver the messages locally rather than sending them along to Google Apps.

One cause of that is if the "Mail for Domain" feature is enabled. To disable that, you can go into Edit Virtual Server -> Features, and disable "Mail for Domain".

-Eric

Mon, 04/12/2010 - 11:24 (Reply to #2)
gfors

Yeah that was my guess to, but like I said, I have disabled "Mail for Domain".

BIND DNS is off, Mail for Domain is off, and it's still screwing with me...

Mon, 04/12/2010 - 11:27
andreychek

Take a peek in /etc/postfix/virtual ... it's possible that an entry managed to get in there that's causing problems.

If you aren't accepting any mail for your domain on that server, then your domain name shouldn't appear in the virtual file.

If it does, delete any lines you see containing your domain name, and then run this command:

postmap /etc/postfix/virtual

And see if that helps!

-Eric

Mon, 04/12/2010 - 11:45 (Reply to #4)
gfors

thanks for the effort, but no dice =(

There where some entries for like hostmaster, abuse etc. for the domain, and I cleared all lines as per your recommendation, and then did the postmap command. Nothing...

The log gives the exact same error as before, by the way.

Mon, 04/12/2010 - 17:25
andreychek

Hmm... what does the command "postconf -n" show? I'm particularly interested in the "mydestination" line, does "mydomain.se" show up on there?

-Eric

Tue, 04/13/2010 - 02:51 (Reply to #6)
gfors

Yeah it does! Show up like this:

mydestination = $myhostname, localhost.$mydomain, $mydomain

myhostname = mydomain.se

Tue, 04/13/2010 - 10:37
andreychek

Okay, yeah, that'll certainly cause the trouble you're seeing :-)

I'd remove $myhostname from the mydestination line, and then restart Postfix using "/etc/init.d/postfix restart".

-Eric

Tue, 04/13/2010 - 10:41 (Reply to #8)
gfors

That sounds great, only one minor question...

Uhm, which file should I edit it out from? :-) (please excuse my stupidity)

Tue, 04/13/2010 - 10:42
andreychek

That's in /etc/postfix/main.cf.

Look for the line beginning with "mydestination", and you should be in good shape!

-Eric

Tue, 04/13/2010 - 10:54 (Reply to #10)
gfors

AWESOME! Works fine now.

Thank you so much!

Wed, 06/08/2011 - 13:24
llynix

I have exactly the same setup, followed the exact solution. However now Virtualmin fails it's configuration check:

Virtualmin's configuration has not been checked since it was last updated. Click the button below to verify it now.

If I click the button I get:

  Your Postfix configuration is missing the system's mail hostname fallsgeek.com from the mydestination line, which will cause mail to bounce.

.. your system is not ready for use by Virtualmin.

Mail doesn't seem to be bouncing.

Wed, 06/08/2011 - 14:35
andreychek

Howdy,

Your Postfix configuration is missing the system's mail hostname fallsgeek.com from the mydestination line, which will cause mail to bounce.

You can get rid of that message by editing /etc/postfix/main.cf, and adding "fallsgeek.com" to the end of the "mydestination" line.

-Eric

Wed, 06/08/2011 - 14:49 (Reply to #13)
llynix

That would put us back to the problem of the original thread. Mail isn't handled by this server (using Google apps). Then localy sent mail wouldn't go out to Google.

Wed, 06/08/2011 - 14:55 (Reply to #14)
andreychek

Ah... okay.

So, I think the problem in this case is that your system's hostname is also one of the Virtual Server names... and that's causing some troubles.

Typically, we suggest using a FQDN, such as "host.domain.tld" for your server's hostname. You'd want a hostname that doesn't exist in Virtualmin as a Virtual Server.

My recommendation would be to set your hostname an FQDN, and to make sure that name doesn't already exist in Virtualmin.

When changing your hostname, make sure you set it in /etc/hosts, as well as in /etc/postfix/main.cf on the mydestination line.

-Eric

Wed, 06/08/2011 - 15:45 (Reply to #15)
llynix

That worked splendidly. I setup the subdomain webhost for the server and now everything is handled fine.

Topic locked