in reply to Dealing with returned mail

Different mail servers may treat bounces different. Some reply to the From: header, others to a "Bounces-to:" header. Heck, there might even be other possibilities that I'm not thinking of.

You are just scratching the surface though of potential problems.

The mailbox could be temporarily over its limit, which is why it is bouncing. The server could be telling you it is unavailable and to try again later.

Not only that but the format of the bounce messages may be different. Some mail servers will tell you immediately that the mailbox is unavailable and it won't deliver, others will accept the message and may bounce it back to you even a week later with some cryptic message as to why it was not able to be delivered. I don't know of any easy ways to deal with these except that when you see something which is clearly a bounced message, write some code to automate dealing with it. This would involve having your script checking whichever mailbox is holding the message and acting appropriately, or to be setup in some way so each message which is delivered to that mailbox is instead processed by your script which checks to see if it is a bounce. If it is a temporary bounce (mailbox full, etc) how long do you want it to allow it to keep bouncing before it is removed?

I can't really give you any specific advice, because I don't know your system, how it is configured, or what your goals are, but I hope this helps gets you thinking about the challenge you have decided to undertake.

- dEvNuL