Attempt MX, fallback to relay in case of error only

2009-11-17 Thread cont...@rusanu.com
Is there a way to configure postfix to use a relay only if direct  
delivery is rejected? The case being a web application that has to  
send notification to subscribers, but some servers reject the  
connection (app IP originates from AWS EC2). I want those cases to be  
retried using a paid SMTP relay like authsmtp.com. However I don't  
want to use the relay for everything since it costs per mail.


Thanks,
~ Remus


Attempt MX, fallback to relay in case of error only

2009-11-18 Thread Stan Hoeppner
cont...@rusanu.com put forth on 11/18/2009 10:05 AM:
> Thanks Andreas,
> 
> The reject would be '553 Mail from ... not allowed', so it sounds like a
> dead end trying to configure postfix to handle this.
> Suggestions on how to workaround are welcome.

Given that the Amazon cloud is likely universally smtp blocked and will
continue to be in the foreseeable future, you're probably not going to
be able to work around this rejection problem by tweaking how postfix
delivers mail.  I blocked the Amazon cloud /18 in April, and sometime
around late summer (US) a thread ran through the spam-l list causing
universal blocking via the members.  I'm sure the list of sites blocking
it has only grown since then.

Your best solution is to find a relayhost with good reputation from
which you can send the email, one that doesn't cost you an arm and a leg
to do so.  Or, better yet, ditch the Amazon cloud and sign up with a
decent colo/vps/web hosting shop whose IP space isn't universally smtp
blocked.  There are thousands of such providers out there offering ultra
cheap service.  Do some research and pick one whose IP space isn't in
scorched earth territory.

--
Stan


Re: Attempt MX, fallback to relay in case of error only

2009-11-17 Thread ram

On Tue, 2009-11-17 at 20:55 -0800, cont...@rusanu.com wrote:

> Is there a way to configure postfix to use a relay only if direct  
> delivery is rejected? The case being a web application that has to  
> send notification to subscribers, but some servers reject the  
> connection (app IP originates from AWS EC2). I want those cases to be  
> retried using a paid SMTP relay like authsmtp.com. However I don't  
> want to use the relay for everything since it costs per mail.
> 
> Thanks,
> ~ Remus

 
I think you need a fallback_relay 
http://www.postfix.org/postconf.5.html#fallback_relay





Re: Attempt MX, fallback to relay in case of error only

2009-11-18 Thread lst_hoe02

Zitat von "cont...@rusanu.com" :

Is there a way to configure postfix to use a relay only if direct  
delivery is rejected? The case being a web application that has to  
send notification to subscribers, but some servers reject the  
connection (app IP originates from AWS EC2). I want those cases to  
be retried using a paid SMTP relay like authsmtp.com. However I  
don't want to use the relay for everything since it costs per mail.


If it is rejected with a permanent error code (5xx) no retry an no  
fallback will happen. This is required by RFC.
If the reject is with some temporary reject code or the connection is  
not accepted at all you need the fallback_relay parameter.


Regards

Andreas




Re: Attempt MX, fallback to relay in case of error only

2009-11-18 Thread cont...@rusanu.com

Thanks Andreas,

The reject would be '553 Mail from ... not allowed', so it sounds like  
a dead end trying to configure postfix to handle this.

Suggestions on how to workaround are welcome.

Thanks,
~ Remus

On Nov 18, 2009, at 1:12 AM, lst_ho...@kwsoft.de wrote:


Zitat von "cont...@rusanu.com" :

Is there a way to configure postfix to use a relay only if direct  
delivery is rejected? The case being a web application that has to  
send notification to subscribers, but some servers reject the  
connection (app IP originates from AWS EC2). I want those cases to  
be retried using a paid SMTP relay like authsmtp.com. However I  
don't want to use the relay for everything since it costs per mail.


If it is rejected with a permanent error code (5xx) no retry an no  
fallback will happen. This is required by RFC.
If the reject is with some temporary reject code or the connection  
is not accepted at all you need the fallback_relay parameter.


Regards

Andreas






Re: Attempt MX, fallback to relay in case of error only

2009-11-18 Thread Wietse Venema
cont...@rusanu.com:
> Thanks Andreas,
> 
> The reject would be '553 Mail from ... not allowed', so it sounds like  
> a dead end trying to configure postfix to handle this.
> Suggestions on how to workaround are welcome.

This is essentially the same problem as home office sites trying
to send direct mail from a residential pool with fall-back to some
ISP because their address is listed in zen.spamhaus.org.

/etc/postfix/main.cf:
smtp_fallback_relay=mail.isp.net

/etc/postfix/master.cf:
smtp  unix  -   -   n   -   -   smtp
-o soft_bounce=yes

When the direct-to-destination delivery attempt fails, it will be
the same Postfix SMTP client process that dumps the message to the
fallback host, so 5xx replies will be ignored in both cases, and
mail may remain queued forever.

Ignoring 5xx responses is not kosher use of SMTP, and there is no
enthousiastic support for Postfix to give 5xx replies a treatment
that depends on context.

Wietse

> Thanks,
> ~ Remus
> 
> On Nov 18, 2009, at 1:12 AM, lst_ho...@kwsoft.de wrote:
> 
> > Zitat von "cont...@rusanu.com" :
> >
> >> Is there a way to configure postfix to use a relay only if direct  
> >> delivery is rejected? The case being a web application that has to  
> >> send notification to subscribers, but some servers reject the  
> >> connection (app IP originates from AWS EC2). I want those cases to  
> >> be retried using a paid SMTP relay like authsmtp.com. However I  
> >> don't want to use the relay for everything since it costs per mail.
> >
> > If it is rejected with a permanent error code (5xx) no retry an no  
> > fallback will happen. This is required by RFC.
> > If the reject is with some temporary reject code or the connection  
> > is not accepted at all you need the fallback_relay parameter.
> >
> > Regards
> >
> > Andreas
> >
> >
> 
> 
>