Sample code snippet

Discussion for developers using MailEnable.
Post Reply
Posts: 11
Joined: Sun Jun 12, 2005 11:06 pm
Location: West Palm Beach, Florida

Sample code snippet

Post by swmotif » Mon Feb 26, 2007 7:45 pm


I've not coded for MailEnable and don't need to except for a minor feature and could do it in whatever language best suited. Here is what I'd like to do:

I would like to suspend outbound SMTP mail during overnight hours so that is is held in a queue, say for outbound e-mail from 11PM to 7AM. Our software developers like to answer tech support e-mail during the night but I think it looks bad for customers to be receiving mail at odd hours of the morning, and would prefer overnight replies to be delivered at 7AM.

I would still like to receive inbound SMTP mail 24 hours per day.

Is this possible to do preferably for a single mailbox or alternatively for an entire postoffice or mailserver? A 3rd party add-on to accomplish this would be fine as another option. Thank you!

Posts: 169
Joined: Fri Mar 04, 2005 4:56 pm

Post by Brad » Tue Mar 27, 2007 12:07 am

Interesting Idea.
I'm not sure how you would do this without using a Smart Host or something between ME and the Internet.

It would also give your emails a better chance of not getting caught as spam, since many email servers use a much stricter Spam policy durning the middle of the night.

Post back if you find a solution.


Posts: 24
Joined: Tue Feb 07, 2006 2:28 am
Location: Georgia, USA

Post by ccgeek » Tue Apr 03, 2007 10:03 am

Sounds easy enough. You could write a pickup event for the MTA that would scan a file of known email addresses or postoffices. If it finds something coming in, it would move the file to an out of bounds queue.

At 7, setup another script to do a "move" of all files in this out of bounds queue back into the MTA. At this point, the pickup event script will not run the "move" and let the messages pass back through the system.

Post Reply