Sending slow mail to a mailbox

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sending slow mail to a mailbox

Simon Buchanan
Hi There,

Sorry if i havent got the terminolgy correct here...

What im wondering is that can a postfix server act as a primary mx
host, send the mail for a domain to smtp:some.host, but if some.host
is down or not contactable, send it to a mailbox?

Thanks

Simon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Victor Duchovni
On Tue, May 20, 2008 at 11:46:55AM +1200, Simon wrote:

> Sorry if i havent got the terminolgy correct here...
>
> What im wondering is that can a postfix server act as a primary mx
> host, send the mail for a domain to smtp:some.host, but if some.host
> is down or not contactable, send it to a mailbox?

Any single delivery failure or protracted down-time? While you could
use fallback_relay (and a suitable transport table in the fallback
instance main.cf), this is too unpredictable. A more complex approach
based on persistent delivery failure is better, but requires updating
the transport table periodically (parsing the logs, and/or examining the
queue).

--
        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:[hidden email]?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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Simon Buchanan
On Tue, May 20, 2008 at 12:26 PM, Victor Duchovni
<[hidden email]> wrote:

> On Tue, May 20, 2008 at 11:46:55AM +1200, Simon wrote:
>
>> Sorry if i havent got the terminolgy correct here...
>>
>> What im wondering is that can a postfix server act as a primary mx
>> host, send the mail for a domain to smtp:some.host, but if some.host
>> is down or not contactable, send it to a mailbox?
>
> Any single delivery failure or protracted down-time? While you could
> use fallback_relay (and a suitable transport table in the fallback
> instance main.cf), this is too unpredictable. A more complex approach
> based on persistent delivery failure is better, but requires updating
> the transport table periodically (parsing the logs, and/or examining the
> queue).

Scenario is: Exchange box in the office (DSL), mail server in data
centre. The mail server currently filters then routes mail thru to the
exchange server (firewall rules to only allow our mail server access).
If the DSL link goes down, mail to fallback_relay to a mailbox.
Exchange server is poping the mail accounts every 15mins as well as
rec mail via SMTP.

I think fallback_relay would work OK? and its simple.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

JOHN ROMAN
Simon wrote:
On Tue, May 20, 2008 at 12:26 PM, Victor Duchovni
[hidden email] wrote:
  
On Tue, May 20, 2008 at 11:46:55AM +1200, Simon wrote:

    
Sorry if i havent got the terminolgy correct here...

What im wondering is that can a postfix server act as a primary mx
host, send the mail for a domain to smtp:some.host, but if some.host
is down or not contactable, send it to a mailbox?
      
Any single delivery failure or protracted down-time? While you could
use fallback_relay (and a suitable transport table in the fallback
instance main.cf), this is too unpredictable. A more complex approach
based on persistent delivery failure is better, but requires updating
the transport table periodically (parsing the logs, and/or examining the
queue).
    

Scenario is: Exchange box in the office (DSL), mail server in data
centre. The mail server currently filters then routes mail thru to the
exchange server (firewall rules to only allow our mail server access).
If the DSL link goes down, mail to fallback_relay to a mailbox.
Exchange server is poping the mail accounts every 15mins as well as
rec mail via SMTP.

I think fallback_relay would work OK? and its simple.

  
fallback relay sounds good, but if its just an alert for dsl line down, maybe a script would be better? 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Simon Buchanan
On Tue, May 20, 2008 at 12:49 PM, john roman <[hidden email]> wrote:

> fallback relay sounds good, but if its just an alert for dsl line down,
> maybe a script would be better?

Its not an alert as such, just somewhere to put the mail until the DSL
comes back up:

If DSL is up: Inbound Mail -> Postfix Server -> Exchnage
If DSL is down: Inbound Mail -> Postfix Server -> Mailbox Server

then once the DSL is back up, the exchnage server will pop the
mailboxes and postfix will resume sending via SMTP.

Postfix uses mysql to store its relay domains as well as the aliases,
so how do i setup smtp_fallback_relay for a single domain?

Thanks

Simon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Victor Duchovni
In reply to this post by Simon Buchanan
On Tue, May 20, 2008 at 12:38:34PM +1200, Simon wrote:

>
> Scenario is: Exchange box in the office (DSL), mail server in data
> centre. The mail server currently filters then routes mail thru to the
> exchange server (firewall rules to only allow our mail server access).
> If the DSL link goes down, mail to fallback_relay to a mailbox.
> Exchange server is poping the mail accounts every 15mins as well as
> rec mail via SMTP.
>
> I think fallback_relay would work OK? and its simple.

Implementing a multi-drop mailbox (really maildir) is not that
simple (unless your Exchange server has only one user). How will
Exchange know which user to deliver the mail to? Will it parse
X-Original-To?

Under no circumstances must it try to guess this from To/Cc, there
be dragons...


--
        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:[hidden email]?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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Victor Duchovni
In reply to this post by Simon Buchanan
On Tue, May 20, 2008 at 12:58:50PM +1200, Simon wrote:

> On Tue, May 20, 2008 at 12:49 PM, john roman <[hidden email]> wrote:
>
> > fallback relay sounds good, but if its just an alert for dsl line down,
> > maybe a script would be better?
>
> Its not an alert as such, just somewhere to put the mail until the DSL
> comes back up:
>
> If DSL is up: Inbound Mail -> Postfix Server -> Exchnage
> If DSL is down: Inbound Mail -> Postfix Server -> Mailbox Server

Why not just queue the mail? What's wrong with that?

--
        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:[hidden email]?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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Stefan Förster-4
* Victor Duchovni <[hidden email]> wrote:

> On Tue, May 20, 2008 at 12:58:50PM +1200, Simon wrote:
>
>> On Tue, May 20, 2008 at 12:49 PM, john roman <[hidden email]> wrote:
>>
>>> fallback relay sounds good, but if its just an alert for dsl line down,
>>> maybe a script would be better?
>>
>> Its not an alert as such, just somewhere to put the mail until the DSL
>> comes back up:
>>
>> If DSL is up: Inbound Mail -> Postfix Server -> Exchnage
>> If DSL is down: Inbound Mail -> Postfix Server -> Mailbox Server
>
> Why not just queue the mail? What's wrong with that?

Perhaps they need to access the mail by different means, for example
some kind of web interface when that Exchange server is not reachable.
In that case, using a content_filter which makes those mails available
e.g. in a web interface might be a reasonable solution.

I do wonder, however, how accessing those mails is accomplished if
they don't have a working DSL connection.

Anyways, in response to the original question: If you simply need to
have a look at incoming mails, you can always use postcat -q
<QUEUE-ID>.  If you need to store that mail for an extended period of
time and you do not want Postfix to try delivery again and again, you
can route mail to that domain through a dedicated transport, declare
this transport as "defer only" and then make use of Postfix's ETRN
implementation.

But as Victor stated, queuing the mail is not a bad thing, even for a
large volume of mail, as stated in QSHAPE_README:

,----[ QUSHAPE_README ]
| but as a rule of thumb the deferred queue scales to somewhere between
| 100,000 and 1,000,000 messages with good performance unlikely above
| that "limit"
`----


Ciao
Stefan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Simon Buchanan
In reply to this post by Victor Duchovni
On Tue, May 20, 2008 at 3:18 PM, Victor Duchovni
<[hidden email]> wrote:

> On Tue, May 20, 2008 at 12:38:34PM +1200, Simon wrote:
>
>>
>> Scenario is: Exchange box in the office (DSL), mail server in data
>> centre. The mail server currently filters then routes mail thru to the
>> exchange server (firewall rules to only allow our mail server access).
>> If the DSL link goes down, mail to fallback_relay to a mailbox.
>> Exchange server is poping the mail accounts every 15mins as well as
>> rec mail via SMTP.
>>
>> I think fallback_relay would work OK? and its simple.
>
> Implementing a multi-drop mailbox (really maildir) is not that
> simple (unless your Exchange server has only one user). How will
> Exchange know which user to deliver the mail to? Will it parse
> X-Original-To?
>
> Under no circumstances must it try to guess this from To/Cc, there
> be dragons...

On this, we only have 8 users, so i was going to setup 8 mail boxes on
the external mail server, then as we are running Exhange within SBS,
we would use the POP3 Connector to download the mail once it comes
back online.

Postfix uses mysql to store its relay domains as well as the aliases,
so how do i setup smtp_fallback_relay for a single domain?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Victor Duchovni
On Wed, May 21, 2008 at 03:38:46PM +1200, Simon wrote:

> On Tue, May 20, 2008 at 3:18 PM, Victor Duchovni
> <[hidden email]> wrote:
> > On Tue, May 20, 2008 at 12:38:34PM +1200, Simon wrote:
> >
> >>
> >> Scenario is: Exchange box in the office (DSL), mail server in data
> >> centre. The mail server currently filters then routes mail thru to the
> >> exchange server (firewall rules to only allow our mail server access).
> >> If the DSL link goes down, mail to fallback_relay to a mailbox.
> >> Exchange server is poping the mail accounts every 15mins as well as
> >> rec mail via SMTP.
> >>
> >> I think fallback_relay would work OK? and its simple.
> >
> > Implementing a multi-drop mailbox (really maildir) is not that
> > simple (unless your Exchange server has only one user). How will
> > Exchange know which user to deliver the mail to? Will it parse
> > X-Original-To?
> >
> > Under no circumstances must it try to guess this from To/Cc, there
> > be dragons...
>
> On this, we only have 8 users, so i was going to setup 8 mail boxes on
> the external mail server, then as we are running Exhange within SBS,
> we would use the POP3 Connector to download the mail once it comes
> back online.
>
> Postfix uses mysql to store its relay domains as well as the aliases,
> so how do i setup smtp_fallback_relay for a single domain?

Use a dedicated clone "smtp" transport, and in master.cf define a
non-default smtp_fallback_relay via a "-o var=val" override. This
must deliver to a 2nd Postfix instance, where the domain is routed to
a maildir.


--
        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:[hidden email]?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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Simon Buchanan
On Thu, May 22, 2008 at 6:21 AM, Victor Duchovni
<[hidden email]> wrote:

> Use a dedicated clone "smtp" transport, and in master.cf define a
> non-default smtp_fallback_relay via a "-o var=val" override. This
> must deliver to a 2nd Postfix instance, where the domain is routed to
> a maildir.

FYI. this is working perfectly. Thank you for your's and others help
in getting this sorted.

Regards,

Simon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Victor Duchovni
On Thu, May 22, 2008 at 09:54:24AM +1200, Simon wrote:

> On Thu, May 22, 2008 at 6:21 AM, Victor Duchovni
> <[hidden email]> wrote:
>
> > Use a dedicated clone "smtp" transport, and in master.cf define a
> > non-default smtp_fallback_relay via a "-o var=val" override. This
> > must deliver to a 2nd Postfix instance, where the domain is routed to
> > a maildir.
>
> FYI. this is working perfectly. Thank you for your's and others help
> in getting this sorted.

Periodically, random messages will end up taking this path even when
connectivity to the destination is not lost. You need to poll the maildir
mailboxes frequently even when all is well... IMHO this design is fragile,
but it can be made to work, so if it suits your needs despite all the
warnings, by all means, enjoy!

--
        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:[hidden email]?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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sending slow mail to a mailbox

Simon Buchanan
On Thu, May 22, 2008 at 2:03 PM, Victor Duchovni
<[hidden email]> wrote:

> Periodically, random messages will end up taking this path even when
> connectivity to the destination is not lost. You need to poll the maildir
> mailboxes frequently even when all is well... IMHO this design is fragile,
> but it can be made to work, so if it suits your needs despite all the
> warnings, by all means, enjoy!

Yea - i had thought that, so mailboxes are polling every 15mins, and
with a 5Mbit download from our data centre, individual mail size
should not be an issue.

Simon
Loading...