Place inbound mail in hold queue

Questions and answers about how to do stuff
Post Reply
jahanjoon
Posts: 11
Joined: 21 Sep 2015 14:31

Place inbound mail in hold queue

Post by jahanjoon »

Hello folks,

Could anyone give me a pointer as to what needs to be done to so I can continue receive all inbound mail coming into EFA but hold them in EFA queues for a period of time (manually controlled if possible) and then release them when needed?

Many thanks.
Using EFA with Exchange 2013
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Place inbound mail in hold queue

Post by pdwalker »

Just out of curiousity, why?

(Off the top of my head, I don't know; I guess it would involve playing tricks with postfix)
zohman
Posts: 42
Joined: 12 Sep 2015 07:36

Re: Place inbound mail in hold queue

Post by zohman »

jahanjoon wrote:Hello folks,

Could anyone give me a pointer as to what needs to be done to so I can continue receive all inbound mail coming into EFA but hold them in EFA queues for a period of time (manually controlled if possible) and then release them when needed?

Many thanks.
i think i know what he wants.. ;)
you making maintenance or something on the final mail server and you want EFA to hold the emails until
mail server ready to collect them from EFA backup?

if this is the scenario, the easy way to do it is to close port 25 (or the port you using for SMTP) on the mail server
segment network so the EFA can't reach him,
this way EFA will hold all the emails until the final destination be reachable again,
after you done all things open port 25 and EFA after a little time will start to deliver all the emails in the queue.

you can also edit the /etc/postfix/transport to route your domain nowhere like:

###### START E.F.A ADDED DOMAINS ######
yourdomain.com smtp:[mail.yourdomain.com]

change to:
yourdomain.com smtp:[1.1.1.1]

run:
postmap /etc/postfix/transport
postfix reload

and after you ready.. revert the changes,
anyway, i don't recommend this.. the first step blocking port 25 much more simple and trusted..
but if you don't have access to the router.. well... it may do it, or maybe there is other simple ways..

Regards,
Zohman.
jahanjoon
Posts: 11
Joined: 21 Sep 2015 14:31

Re: Place inbound mail in hold queue

Post by jahanjoon »

Zohman, you are absolutely correct, I need to do this for moving an Exchange environment to a new datacenter.

I thought there may be a simple command that can be run to hold the mail and then once all is done, issue the release command and hey presto...

The port 25 route is also good, did this as a dry run yesterday and it worked fine, so will do this for the real move.

My follow-up question is how long will EFA keep the queued mail before non-delivery? I recall seeing somewhere the default is 5 days.

Many thanks,

jj
Using EFA with Exchange 2013
zohman
Posts: 42
Joined: 12 Sep 2015 07:36

Re: Place inbound mail in hold queue

Post by zohman »

Yes, the default maximal_queue_lifetime is 5 days.
if you want to increase add to main.cf :
maximal_queue_lifetime = 10d
and it will overwrite the 5d defaults..
you can aslo use the postconf -e command,
and It will write the settings to /etc/postfix/main.cf:
postconf -e 'maximal_queue_lifetime = 10d'

no metter what... mails wont get lost since MailScanner keep them for backup.
(if 'store' is presented in mailscanner.conf on Spam/non-Spam Actions)
but u will lose the auto-delivery.. what mean that you have to release them 1 by 1.

Goodluck.
User avatar
darky83
Site Admin
Posts: 540
Joined: 30 Sep 2012 11:03
Location: eFa
Contact:

Re: Place inbound mail in hold queue

Post by darky83 »

There is no real hold item, as long as the system can reach your mailserver it will try to deliver the mail.

So easy work around that I use sometimes when I do maintenance on the mailserver is blocking the access to the mailserver, this way EFA stores the mail and will try to deliver when you allow it again (max 5 days as zohman mentioned).

From the EFA box this can be done using iptables:

To block all outgoing SMTP sessions:

Code: Select all

iptables -A OUTPUT -p tcp -m state --state NEW -m tcp --dport 25 -j DROP
to allow it again:

Code: Select all

iptables --flush OUTPUT
Version eFa 4.x now available!
jahanjoon
Posts: 11
Joined: 21 Sep 2015 14:31

Re: Place inbound mail in hold queue

Post by jahanjoon »

Thank you both for your reply and guidance.

Will report back on the outcome of the migration.
Using EFA with Exchange 2013
Post Reply