This article applies to:
- Trustwave MailMarshal (SEG)
Question:
If the MailMarshal server is rebooted, what happens to email in mid-process?
Procedure:
SMTP is designed to handle dropped connections, server reboots, and partially sent messages. MailMarshal is an SMTP server and handles these events in same manner.
MailMarshal Sender - Mail being sent
If messages are partially sent when the server or service shuts down, they will be resent again upon restart. If a message is being sent to a distribution list then that message will have been split at the gateway for each domain. So each split which is partially sent will be resent. That is standard practice. The recipient server will see that the SMTP handshaking did not complete and the message was not fully delivered - therefore the recipient server will not pass the message on to the recipient.
There is an theoretical exception, and it would be unusual to encounter it. At the end of the SMTP handshaking, we have a conversation like this:
MailMarshal says, End of message.
Recipient server says, 250 OK.
This signifies that the message was sent correctly by MailMarshal.
If MailMarshal sends End of message
it does not regard the message as successfully delivered until it receives the 250 OK.
What could happen in theory is that the Sender service shuts down after MailMarshal sends the End of Message
but before the 250 OK
is received, so the message is regarded by MailMarshal as undelivered, but the receiving server has received its End of Message
and is finished and passes the message to the recipient.
- This is a way you could get duplicates on a server reboot, but there is no way to avoid it.
MailMarshal Engine - Mail being scanned
Messages being scanned are retained in the Incoming queue until scanning is complete and the file has been quarantined or passed to the ProcessedOK folder for pickup by the Sender. In a normal service shutdown the Engine waits for all scanning threads to complete. In case of a power failure or hard cycle, any incomplete messages remain in the Incoming queue and will be scanned when the engine starts.
MailMarshal Receiver - Mail being received
If messages are partially received when the server or services shuts down, then the server sending to MailMarshal will see the dropped SMTP connection and it will try to resend the message to MailMarshal after a preset wait interval. Typically, the wait interval (or backoff time) is 5 - 15 minutes for the first failure, increasing to 1 - 2 hours on subsequent failures. This may vary significantly, depending on the way the remote servers are configured.
Until MailMarshal issues a 250 OK
to indicate that the message was received correctly, any failure on that thread will require the message to be resent. Once MailMarshal issues the 250 OK
, MailMarshal already has a copy of the message stored on disk. Even if a MailMarshal server stoppage occurs, the message is still regarded as correctly received by both SMTP servers, and MailMarshal will use the copy stored on disk upon restart - the message will continue processing as normal without need for a resend from the source server.
- This article was previously published as:
- NETIQKB45727