Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

creating a loop with smtp_fallback_relay

61 views
Skip to first unread message

Cyber Dog

unread,
Jun 19, 2007, 10:37:14 PM6/19/07
to
My scenario (in essence): I have two mx machines: a primary and a
backup. The backup is running Postfix 2.3.8-2 (Ubuntu). Both
machines currently run on dynamic IPs... I'm well aware of the
implications of this, and plan on getting a static IP eventually (most
likely when I can afford to get a decent hosting plan). As a result,
I've always had the primary configured to forward outgoing mail to my
ISP's smtp servers in the event direct delivery is denied.

The creation of the backup host was only very recent. The idea is
that when my primary goes offline for whatever reason (the utilities
around here are less than reliable), I will have an mx in a different
location to collect and queue my mail until I can bring the primary
back online. In my main.cf, I defined my mail domains as
relay_domains, and placed all the valid addresses on the primary
machine in a relay_recipient_maps file. It seems to work quite well;
the server will collect mail for my domains, and forward them to the
primary server any time it's available.

Out of curiousity (I'm still exploring Postfix), I wanted to see if I
could duplicate the behavior of my primary server, which sends
outgoing mail both directly first, then to the ISP server if
necessary. smtp_fallback_relay seemed to be the right tool for the
job, and according to the man page, "To prevent mailer loops between
MX hosts and fall-back hosts, Postfix version 2.3 and later will not
use the smtp_fallback_relay feature for destinations that it is MX
host for."

But alas, it was not to be. It seems smtp_fallback_relay does not
consider relay_domains to be "destinations that it is mx host for."
Outgoing mail will work fine, of course, but incoming mail is no
longer queued correctly. If the primary server goes down, the
secondary now tries, fails, and forwards the mail to my ISP. The ISP,
seeing my two mx servers, then sends the mail right back to the backup
mx... and thus it loops into the aether.

I'm not sure how to react to this. On the one hand, I feel like
seasoned Postfix pros may look on and say "duh... he should know
better!" But on the other hand, I feel like the server could be just
a little smarter than this. It seems there (c|s)ould be a way to say
"only use this fallback for /outgoing/ mail, please." Of course,
Postfix is powerful, and I may simply be missing the right formula.

Ultimately it's not a big deal either way; I can just avoid sending
outgoing mail through the backup altogether. But I always enjoy a
good puzzle...

Thoughts?

Thanks,
Matt

Victor Duchovni

unread,
Jun 19, 2007, 10:50:03 PM6/19/07
to
On Tue, Jun 19, 2007 at 10:37:14PM -0400, Cyber Dog wrote:

> But alas, it was not to be. It seems smtp_fallback_relay does not
> consider relay_domains to be "destinations that it is mx host for."

No, not quite right, the default definition of "relay_transport"
in 2.3.8 is "relay", and the "relay" entry in master.cf is (as of
postfix-2.2-20050203):

relay unix - - n - - smtp
-o fallback_relay=

Finally, the default for "smtp_fallback_relay" is "$fallback_relay". So
with default settings everything works as advertised. Now the parameter
"fallback_relay" got renamed to "smtp_fallback_relay" in Postfix 2.3,
but the master.cf entry was not updated, this should be corrected. Feel
free to update your master.cf, and ensure that any transport(5) entries
for relay domains use the "relay" and not the "smtp" transport.

relay unix - - n - - smtp
-o smtp_fallback_relay=

--
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majo...@postfix.org?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

0 new messages