Hello,

I've been running a small volume Postfix mail server on a fixed IP for
15+ years or so.

Recently, my provider forced me from ADSL (being phased out here) to
VDSL, and I now find myself sending mail from a "dynamic" IP address...

As expected, some destinations refuse to accept my outgoing mail with a
550 (usually with a "you're blacklisted" message on top of it).


So, I am now looking for some magic that would make Postfix:

a) first attempt to deliver outgoing mail straight to the destination MX
(as it does now), and,

b) if that fails with a "550 Bad IP" (or equivalent), fall back to my
ISP relay server and send it through them.


These 2 steps would have to happen for each message separately, every
time. Even if the destination doesn't like my IP right now, it might
accept it in a few hours from now (happened this morning).

Ideally, that mechanism should be able to "predict" if it's worth a
relay attempt. For example, relaying will (hopefully) fix a "550 This IP
is blacklisted", but it won't help with a "550 No such user".


The "smtp_fallback_relay" param does not seem suitable for this, as the
destination host *can* be found and *is* reachable, it's just being rude
to me <g>.

I am currently "fixing" it with a transport map for the "rude" domains
(such as postfix.org <g>), but that is only a stopgap measure. If my IP
changes next week, other domains may dislike the new one although they
had no problems with the one before it.

Relaying *all* the outgoing mail through my ISP is *not* an option. As
long as the message sits on my own box, I can see what's going on (e.g.
greylisting). And if it's handed from here to the destination directly,
I have all the details on hand to help them debug it at their end. But I
loose all that control when I hand the message over to my ISP.

So please, no philosophical arguments, I promise I won't be impressed <g>.

To paraphrase: relaying through my ISP *must* be kept to an absolute
minimum, along the lines described above.



The question is: does Postfix have something like this ?

Or do I have to write something myself? If yes, any suggestions?

I have been RTFM, peeking in the smtpd.c client source, pondered about a
special bounce handler (to detect "bad IP" and forward to my ISP),
thought of playing with "smtp_dns_reply_filter" (add the relay server at
the end of the "real" MX's) etc., but had no "AHA!" experiences yet.

I will continue my search, but I thought I'd ask here as well, just in
case this wheel has been invented already.

If not, building a new one would certainly be cheaper (for me) than
obtaining a fixed IP. If available at all, they cost an arm and a leg
over here. Better keep my 2 arms and use them to type some code

NB: I'm running Postfix 3.2.0 now. Upgrading to 3.3.1 is planned, but
(from the readme) currently as low priority.

Many thanks in advance,

Luc

Reply via email to