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

Deliver mail to multiple queues

3 views
Skip to first unread message

Joseph L. Casale

unread,
Oct 7, 2010, 3:30:21 PM10/7/10
to
Is it possible to duplicate mail into a new queue (such as my existing "defer" queue)
so that I could trigger the delivery of that mail again to the intended mailbox server
it was originally headed to as defined in my transports file?

Thanks!
jlc

Jeroen Geilman

unread,
Oct 7, 2010, 3:34:57 PM10/7/10
to
On 10/07/2010 09:30 PM, Joseph L. Casale wrote:
> Is it possible to duplicate mail into a new queue (such as my existing "defer" queue)
>

That makes absolutely zero sense.
In case you were under the impression that queues somehow had something
to do with delivery paths - they don't.

> so that I could trigger the delivery of that mail again to the intended mailbox server
>

Why ?

> it was originally headed to as defined in my transports file?
>

Postfix will retry delivery if that is required.
It needs no human intervention.

--
J.

Wietse Venema

unread,
Oct 7, 2010, 3:36:55 PM10/7/10
to
Joseph L. Casale:

> Is it possible to duplicate mail into a new queue (such as my
> existing "defer" queue) so that I could trigger the delivery of
> that mail again to the intended mailbox server it was originally

> headed to as defined in my transports file?

Please describe the problem that you are trying to solve, instead
of the solution that you have come up with (queue duplication).

Wietse

Joseph L. Casale

unread,
Oct 7, 2010, 3:43:26 PM10/7/10
to
>Please describe the problem that you are trying to solve, instead
>of the solution that you have come up with (queue duplication).

Sorry guys, just trying to be brief. I have an unrelated issue with other
software whereby a rollback this weekend will likely take place on the
mailbox server (client access will be prevented all weekend).

My Postfix gateway will be receiving inbound mail and unfortunately
I don't have the option this time to change DNS entries and some of
the maintenance will require receiving mail for this domain.

Normally, whenever we do maintenance, we edit the transport file
from "domain.com smtp:[10.0.0.5]" to "domain.com hold:[10.0.0.5]"
which references a "defer_transports = hold" in the main.cf.

I need to be able to replay any inbound mail back into our mailbox
server if it gets rolled back (virtual server) and this will be the easiest
way.

Thanks!
jlc

Wietse Venema

unread,
Oct 7, 2010, 4:00:10 PM10/7/10
to
Joseph L. Casale:

What is the problem? Your gateway server forwards mail to the
mailbox server as usual, but then the mailbox server is "reset" to
some earlier checkpoint, causing all mail to be lost that was
delivered since that earlier checkpoint. The mail is no longer on
your gateway server, so there is no mail to replay.

The proper solution is not to deliver that mail to the mailbox server.

For example, turn off the mail software on the mailbox server before
making the checkpoint, or do something on the gateway server that
keeps it from sending mail to the mailbox server. Besides playing
games with defer_transports, you could use a firewall rule or
something else that prevents mail from traveling to the mailbox
server.

Wietse

Charles Marcus

unread,
Oct 7, 2010, 4:18:47 PM10/7/10
to
On 2010-10-07 3:43 PM, Joseph L. Casale wrote:
> My Postfix gateway will be receiving inbound mail and unfortunately I
> don't have the option this time to change DNS entries and some of the
> maintenance will require receiving mail for this domain.
>
> Normally, whenever we do maintenance, we edit the transport file from
> "domain.com smtp:[10.0.0.5]" to "domain.com hold:[10.0.0.5]" which
> references a "defer_transports = hold" in the main.cf.
>
> I need to be able to replay any inbound mail back into our mailbox
> server if it gets rolled back (virtual server) and this will be the
> easiest way.

If I'm reading this right, I *think* you can just set your postfix
gateway to hold all mails by adding "static:HOLD" to the TOP of your
smtpd_sender_restrictions:

smtpd_sender_restrictions = static:HOLD, blah, blah

Then once your mailbox server is back up, comment out that line and then
issue

postsuper -r ALL

?

--

Best regards,

Charles

Joseph L. Casale

unread,
Oct 7, 2010, 4:33:55 PM10/7/10
to
>What is the problem? Your gateway server forwards mail to the
>mailbox server as usual, but then the mailbox server is "reset" to
>some earlier checkpoint, causing all mail to be lost that was
>delivered since that earlier checkpoint. The mail is no longer on
>your gateway server, so there is no mail to replay.
>
>The proper solution is not to deliver that mail to the mailbox server.

I need to receive mail for that domain from various external clients
during this period. Only me, so I can do it any way, doesn't need to
be User convenient.

>For example, turn off the mail software on the mailbox server before
>making the checkpoint, or do something on the gateway server that
>keeps it from sending mail to the mailbox server.

I normally do this during maintenance windows with the defer_transports = hold
statement.

>Besides playing
>games with defer_transports, you could use a firewall rule or
>something else that prevents mail from traveling to the mailbox
>server.

Ok, so I can stop mail at the firewall. When I apply for an SSL cert on the
weekend and the SSL company uses the WHOIS DB to send a confirmation
email to me, how do I get my cert _this weekend_ to have that stage of
my maintenance completed? The conf mail will have bounced?

If I roll back the mailbox server during this period, delivering mail back into
it would be most convenient. I don't want, but need mail delivery working
and I cannot change DNS records for this, the window is to short and abrupt.
I don't want to setup a new mailbox server and deliver there as that's more
work, then I have to migrate that mail out and in.

Thanks,
jlc

Joseph L. Casale

unread,
Oct 7, 2010, 4:47:49 PM10/7/10
to
>If I'm reading this right, I *think* you can just set your postfix
>gateway to hold all mails by adding "static:HOLD" to the TOP of your
>smtpd_sender_restrictions:
>
>smtpd_sender_restrictions = static:HOLD, blah, blah
>
>Then once your mailbox server is back up, comment out that line and then
>issue
>
>postsuper -r ALL

You are reading it right, but I can defer mail very easily now, the issue
is we must receive mail all weekend and some that should be help will
get delivered. Duplicating all mail and resending it would just make my life
so much easier than worrying about dumping it out of the new MB server
which I can do, but don't want to.

Thanks!
jlc

Charles Marcus

unread,
Oct 7, 2010, 4:48:38 PM10/7/10
to
On 2010-10-07 4:33 PM, Joseph L. Casale wrote:
> When I apply for an SSL cert on the weekend and the SSL company uses
> the WHOIS DB to send a confirmation email to me, how do I get my cert
> _this weekend_ to have that stage of my maintenance completed? The
> conf mail will have bounced?

Get the SSL cert BEFORE you take your server down?

--

Best regards,

Charles

Wietse Venema

unread,
Oct 7, 2010, 4:55:36 PM10/7/10
to
Joseph L. Casale:
> Ok, so I can stop mail at the firewall. When I apply for an SSL cert on the

> weekend and the SSL company uses the WHOIS DB to send a confirmation
> email to me, how do I get my cert _this weekend_ to have that stage of
> my maintenance completed? The conf mail will have bounced?

The idea is that you ***QUEUE*** the mail for the mailbox server
on the gateway. The default postfix maximal_queue_lifetime setting
of five days should be sufficient to survive a weekend outage of
the mailbox server.

> If I roll back the mailbox server during this period, delivering
> mail back into it would be most convenient.

You mis-understand.

1) If you don't ***QUEUE*** the mail on the gateway, there is
nothing to replay, because the mail is already delivered to the
mailbox server.

2) If you do ***QUEUE*** the mail on the gateway, then all you need
to do is turn on the flow to the mailbox server when you're done,
and Postfix will deliver it to the mailbox server.

Wietse

Joseph L. Casale

unread,
Oct 7, 2010, 5:05:19 PM10/7/10
to
>Get the SSL cert BEFORE you take your server down?

Lol, I can't, no way to make a CSR as its being upgraded, plus
I have customer mail to address...

Trust me, it's the simplest approach given all my conditions:)

jlc

Joseph L. Casale

unread,
Oct 7, 2010, 5:09:49 PM10/7/10
to
>The idea is that you ***QUEUE*** the mail for the mailbox server
>on the gateway. The default postfix maximal_queue_lifetime setting
>of five days should be sufficient to survive a weekend outage of
>the mailbox server.

This is what I normally do during maint.

>> If I roll back the mailbox server during this period, delivering
>> mail back into it would be most convenient.
>
>You mis-understand.

Not quite:)

>
>1) If you don't ***QUEUE*** the mail on the gateway, there is
>nothing to replay, because the mail is already delivered to the
>mailbox server.
>
>2) If you do ***QUEUE*** the mail on the gateway, then all you need
>to do is turn on the flow to the mailbox server when you're done,
>and Postfix will deliver it to the mailbox server.

hence why I wanted to duplicate the delivery queue (or whatever queue
would be involved) and redirect a *copy* into a new queue that holds/defers.

When I am done, I can suspend incoming mail temporarily at the firewall,
drop the mb server, then reconfigure the queues and deliver.

I would simply defer all weekend as I have done for years, but this time
around my need came too quick to implement more orthodox methods
and I need to interact with several recipients mail in the meantime.

Thanks for all the help so far guys!
jlc

Victor Duchovni

unread,
Oct 7, 2010, 5:15:05 PM10/7/10
to
On Thu, Oct 07, 2010 at 09:09:49PM +0000, Joseph L. Casale wrote:

> >2) If you do ***QUEUE*** the mail on the gateway, then all you need
> >to do is turn on the flow to the mailbox server when you're done,
> >and Postfix will deliver it to the mailbox server.
>
> hence why I wanted to duplicate the delivery queue (or whatever queue
> would be involved) and redirect a *copy* into a new queue that holds/defers.
>
> When I am done, I can suspend incoming mail temporarily at the firewall,
> drop the mb server, then reconfigure the queues and deliver.
>
> I would simply defer all weekend as I have done for years, but this time
> around my need came too quick to implement more orthodox methods
> and I need to interact with several recipients mail in the meantime.

If you need to read mail for several mailboxes during the down-time, bcc
a copy of the mail for just those recipients to an alternate location,
which will not be down. All other mail can queue for the usual destination
to be back up.

--
Viktor.

Wietse Venema

unread,
Oct 7, 2010, 5:22:14 PM10/7/10
to
Victor Duchovni:

/etc/postfix/main.cf:
sender_bcc_maps = hash:/etc/postfix/sender_bcc

/etc/postfix/sender_bcc:
y...@some.example.com y...@other.example.com

This will keep your mail flowing to the alternate site even
when the mailbox server is down.

Wietse

Victor Duchovni

unread,
Oct 7, 2010, 5:26:09 PM10/7/10
to
On Thu, Oct 07, 2010 at 05:22:14PM -0400, Wietse Venema wrote:

> > If you need to read mail for several mailboxes during the down-time, bcc
> > a copy of the mail for just those recipients to an alternate location,
> > which will not be down. All other mail can queue for the usual destination
> > to be back up.
>
> /etc/postfix/main.cf:
> sender_bcc_maps = hash:/etc/postfix/sender_bcc
>
> /etc/postfix/sender_bcc:
> y...@some.example.com y...@other.example.com
>
> This will keep your mail flowing to the alternate site even
> when the mailbox server is down.

Perhaps, "recipient_bcc_maps", rather than "sender_bcc_maps", but the
idea is the same.

--
Viktor.

Joseph L. Casale

unread,
Oct 7, 2010, 5:37:26 PM10/7/10
to
>> If you need to read mail for several mailboxes during the down-time, bcc
>> a copy of the mail for just those recipients to an alternate location,
>> which will not be down. All other mail can queue for the usual destination
>> to be back up.
>
>/etc/postfix/main.cf:
> sender_bcc_maps = hash:/etc/postfix/sender_bcc
>
>/etc/postfix/sender_bcc:
> y...@some.example.com y...@other.example.com
>
>This will keep your mail flowing to the alternate site even
>when the mailbox server is down.

I thought of that as I knew the bcc feature existed but thought there may have
also been as easy way to do it with duplicate queues.

I'll use this approach, thanks for everything guys!
jlc

Joseph L. Casale

unread,
Oct 7, 2010, 5:38:30 PM10/7/10
to
>Perhaps, "recipient_bcc_maps", rather than "sender_bcc_maps", but the
>idea is the same.

Yup, I'll just deal with it all in one mb, I am so pressed for time, I don't have
the luxury of creating the maps:)

Thanks a lot guys!
jlc

0 new messages