On 01/15/2015 12:43 PM, Mullis, Josh (CCI-Atlanta) wrote:
> Thanks for the fast reply Wietse... If we switch to maildir mode,
> there is still no option to have postfix cleanup old messages,
> correct?
As Wietse currectly points out, the mail exchanger is not the place
where mail needs to be managed. You need to write your own daemon,
probably cron-driven, to do any clean-up exercises you want to
implement. Using Maildir allows you to do this process independent on
the method used by your users to pick up mail: POP3 or IMAP.
How would such a daemon work? First, you have to decide how you are
going to handle quota. Is it by size, or is it by message count? The
former is much easier, because checking the size of the mail directory
is much easier than counting "From " lines.
So your daemon would examine all the mail files. When it finds one over
quota, it can then remove the oldest message(s) so that the mail queue
is within the size guidelines. Removing mail from the beginning of a
file means rewriting the file, which is a fairly simple but tedious task.
What would be nice is your daemon sending a warning that their mail file
is getting too large, and that when it hits the limit you will start
removing mail. Consider sending the message at 80 percent quota, and
also keep a tag so that you send the message in limited number.
The user can respond by:
1. collecting all the mail (POP3)
2. using local-computer storage (IMAP)
Consider non-mail-based reminders, so that the reminder messages don't
cause a vicious cycle.
With disk storage being so cheap, another alternative is to use larger
disk drives so that you don't have to remove mail at all. Indeed,
consider if you do remove mail that you have an archive on such a larger
drive, accessible to the user, so that old mail gets "spooled off" into
it. That prevents mail loss.