Mailbox folders immutable?

software development


As part of a mailing list application written in PHP, I want to retrieve bounced messages and remove the bad address from my MySQL database.

I can set up a user such that bounces are sent to that user’s mailbox, and I notice that new mail is kept in the directory “/home/username/Maildir/new”. It is a simple matter to read the files in that directory and parse them for the offending address.

Here’s the question: Is the path to the new-mail directory immutable? Or, is it a configuration of PostFix that may change over time?

–David B.


Well change is always possible, but it’s unlikely that this will change any time - as long as we’re using Maildir format, mail will be delivered to ~/Maildir/. It’s conceivable that we’d move to a system where the spool files would be located somewhere else (possibly somewhere not accessible to the user), but we’d definitely announce such a change well in advance.

I’d suggest having a quick read of the Maildir spec, especially if you’re planning on manipulating the Maildir files directly.

Also, I certainly hope you don’t plan on having many bounced messages (ie your mailing list’s recipients should already be confirmed, and thus there should be very few bounces).


Yes, absolutely the list will be totally opt-in, voluntary, confirmed-in-advance, and non-spam-in-any-way!

And I will check the Maildir docs, too. Thanks!

–David B.