Contents |
Maildrop is a replacement local mail delivery agent, similar to procmail but with more features. It has support for LDAP lookups, mail filtering, mailbox quota and support for virtual mail acounts making it convenient to use in a black box kind of setup without any real accounts.
The main benefit of using "maildrop" is for the quota feature withut mucking around file system quota. Quotas can be imposed on both the mailbox size and on the number of individual mails.
NOTE: This quota mechanism will only work as long as maildrop (or deliverquota) are the only applications that deliver messages to the maildir, or as long as other applications implement the same quota enforcement mechanism. See maildirquota(7)
This setup described here is for a standard mail server with user home directories and real accounts.
root# portinstall mail/postfix root# portinstall mail/maildrop WITH_MAILDIRQUOTA=yes
While compiling maildrop, make sure that the delivery format is set to "./Maildir". The default is to deliver to /var/mail/$USER. This is not runtime cofigurable and has to be done by adding the following line to maildrop/config.h before the port compile in the port directory.
#define DEFAULT_DEF "./Maildir"
See http://www.flounder.net/~mrsam/maildrop/INSTALL.html for details
# use maildrop as LMTP mailbox_command = /usr/local/bin/maildrop local_destination_concurrency_limit = 1
[godzilla] ~> postconf |grep maildrop mailbox_command = /usr/local/bin/maildrop
root# cd /home/$USER root# maildirmake -q 10000000S,1000C ./Maildir
See maildirmake(1) and maildirquota(7)
root# echo | mail -s "Testing maildrop delivery" $USER
May 21 17:39:40 godzilla postfix/pickup[75916]: 14D05B57E: uid=0 from=<root>
May 21 17:39:40 godzilla postfix/cleanup[75922]: 14D05B57E: message-id=<20030521120940.14D05B57E@godzilla.mydomain.com>
May 21 17:39:40 godzilla postfix/qmgr[75917]: 14D05B57E: from=<root@godzilla.mydomain.com>, size=340, nrcpt=1 (queue active)
May 21 12:09:40 godzilla postfix/smtpd[75925]: connect from localhost.mydomain.com[127.0.0.1]
May 21 12:09:40 godzilla postfix/smtpd[75925]: 39E36B57D: client=localhost.mydomain.com[127.0.0.1]
May 21 17:39:40 godzilla postfix/cleanup[75922]: 39E36B57D: message-id=<20030521120940.14D05B57E@godzilla.mydomain.com>
May 21 17:39:40 godzilla postfix/qmgr[75917]: 39E36B57D: from=<root@godzilla.mydomain.com>, size=820, nrcpt=1 (queue active)
May 21 12:09:40 godzilla postfix/smtpd[75925]: disconnect from localhost.mydomain.com[127.0.0.1]
May 21 12:09:40 godzilla postfix/lmtp[75924]: 14D05B57E: to=<shanu@godzilla.mydomain.com>, orig_to=<shanu>, relay=127.0.0.1[127.0.0.1], delay=0, status=sent (250 2.6.0 Ok, id=41157-03-2, from MTA: 250 Ok: queued as 39E36B57D)
May 21 17:39:40 godzilla postfix/local[75926]: 39E36B57D: to=<shanu@godzilla.mydomain.com>, relay=local, delay=0, status=sent ("|/usr/local/bin/maildrop")
May 21 08:19:35 godzilla postfix/lmtp[41373]: 7981EB578: to=<shanu@godzilla.mydomain.com>, orig_to=<shanu>, relay=127.0.0.1[127.0.0.1], delay=1, status=sent (250 2.6.0 Ok, id=41226-01, from MTA: 250 Ok: queued as 6AB55B577) May 21 13:49:35 godzilla postfix/local[41345]: 6AB55B577: to=<shanu@godzilla.mydomain.com>, relay=local, delay=0, status=bounced (permission denied. Command outp ut: maildrop: maildir over quota. )
mailbox_command = /usr/local/bin/maildrop -w 50
[godzilla] ~# cat /usr/local/etc/quotawarnmsg From: Mail Delivery System <postmaster@godzilla.mydomain.com> Reply-To: postmaster@godzilla.mydomain.com To: Valued Customer:; Subject: Mail quota warning Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Your mailbox on the server is now more than 90% full. So that you can continue to receive mail you need to remove some messages from your mailbox. Not getting any warning messages? Check whether any quota has actually been imposed on the Maildir (~/Maildir/maildirsize) and also check for the presence of ~/Maildir/quotawarn file. Warnings are sent once in 24 hours.
http://www.firstpr.com.au/web-mail/RH71-Postfix-Courier-Maildrop-IMAP/