These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Make Postfix stop considering domains as local on the new forum.
Hello!
is there any way to make Postfix stop considering certain virtual domains as "local" in its delivery?
I have disabled mail services for these domains by editing the "enabled features" in Virtualmin, because the mail is handled externally by google-apps, but when trying to send mail to one of these domains from within their website, Postfix still thinks that it should deliver them locally and consequently bounces the mail since there is no user by that name.
I checked the "virtual domains" table in Webmin->Servers->Postfix, and the domains are not listed there.
This is on a Debian 4 installation that was created by running the Virtualmin GPL installation script.
Check mydestination. It probably contains the offending hostname, or a variable that contains that name.
--
Check out the forum guidelines!
Oh, yeah, and relay_domains.
--
Check out the forum guidelines!
Many thanks for your suggestions!
mydestination is set to the name of the whole server, it doesn't show any of the virtual domains.
> mydestination = 213-239-211-137.clients.your-server.de
relay_domains isn't defined at all (so it defaults to mydestination)
The entire Postfix setup is as Virtualmin defined it during installation ...
Where does Virtualmin store the table of virtual domains that it sets up mail services for?
<hash:/etc/postfix/virtual> seems to list only the exception mappings, and I did remove the domains that i am trying to stop Postfix from treating as local, but it still says it's looping back to itself when trying to send mail to an address in one of these domains.
<div class='quote'>Where does Virtualmin store the table of virtual domains that it sets up mail services for?</div>
/etc/postfix/virtual
It sounds like your systems hostname is actually the domain you're trying to send elsewhere, and you just don't realize it. ;-)
Postfix gets this from a gethostbyname call, and not from the various hostname configuration files. What do you get when you run:
hostname -f
?
--
Check out the forum guidelines!
hostname -f gives:
213-239-211-137.clients.your-server.de
This is the domain name that Hetzner gave to the physical machine hosting Virtualmin with IP 213.239.211.137.
The domain whose mail i am trying to off-load is daimon.ch, with a different IP (78.47.27.54 - Non-default shared address)
"Mail for domain enabled?" is deactivated in the Virtualmin domain feature list, yet when a webscript sends out mail to anything@daimon.ch, Postfix tries to deliver it locally.
That's really strange. But I guess you know that already. ;-)
Does grep find that domain anywhere in /etc/postfix?
e.g.:
cd /etc/postfix
grep -R daimon.ch *
--
Check out the forum guidelines!
As a work-around, i found that I could add an entry to the transport mappings to explicitly direct outgoing mail to the google server that's hosting mail services for daimon.ch:
transport:daimon.ch smtp:gmail-smtp-in.l.google.com
That's the only line that grep found in etc/postfix
This way, I do manage to get the mail out, but I was hoping I could just get Postfix to ignore any special handling and treat this a non-local domain.
But don't waste your time any more on this, I really appreciate your efforts !
How about the MX record? (Can you tell I'm bothered by not being able to figure this out?) ;-)
--
Check out the forum guidelines!
Yes, it is very nagging not to know the reason!
At the level of the public domain name server, the two MX entries point to the google-server:
MX1 aspmx.l.google.com
MX2 alt1.aspmx.l.google.com
But on the local BIND-DNS record, there is one line mentioning MX locally -- should I try to take that out? (but it actually looks like a spam filter entry, no?):
$ttl 38400
@ IN SOA issole.info. root.issole.info. (
1210509047
10800
3600
604800
38400 )
@ IN NS issole.info.
daimon.ch. IN A 78.47.27.54
www.daimon.ch. IN A 78.47.27.54
ftp.daimon.ch. IN A 78.47.27.54
m.daimon.ch. IN A 78.47.27.54
localhost.daimon.ch. IN A 127.0.0.1
<b>daimon.ch. IN TXT "v=spf1 a mx a:daimon.ch ip4:78.47.27.54 ?all"</b>
ns.daimon.ch. IN A 78.47.27.54
webmail.daimon.ch. IN A 78.47.27.54
mssql.daimon.ch. IN A 78.47.27.54
lists.daimon.ch. IN CNAME daimon.ch.
That's the SPF record, and shouldn't be confusing Postfix. You could try removing it temporarily (but you'll want it back, eventually, and you'll want to add the Google outgoing servers if you use those for outgoing mail from your domain).
--
Check out the forum guidelines!
Hi Joe,
A friend finally pointed me in the right direction to solving the mystery!
The solution was to add MX records to the local BIND server, that point to the remote server that's meant to handle the mail:
daimon.ch. IN MX 10 aspmx.l.google.com.
daimon.ch. IN MX 20 alt1.aspmx.l.google.com.
In the absence of the MX records, Postfix seems to somehow think that because the www ip is local, so is MX, rather than look up the MX entries in the registrar's name server (which did already have the above definitions).
Many thanks for your help on the way!
Robert