[Dovecot] Sendmail, procmail, dovecot and quota
I have Fedora 7 from a standard installation running sendmail, procmail and dovecot 1.0 installed on a single partition. I now need to set up mail quotas for most of the users but not all. Just protecting /var/spool/mail/$LOGNAME is probably good enough for me. Since I just want mail quotas and the installation is on just 1 partition I don't have an easy way to use file system quotas. By reading through the dovecot documentation and list archives I have the feeling that this is possible with the versions and setup I have. I would probably need a main line like this (apart from other lines) per user mailbox that needs to be managed:
dirsize:/var/spool/mail/joe-user:storage 10240
to give joe-user a 10 mb limit.
Since this server is in production I don't have the luxury of experimenting (extensively) on it.
I have a question though that I have not been able to answer yet. If the flow of mail goes from sendmail to procmail to the mailbox, how is it possible for dovecot to implement quotas on the inbox? Or would dovecot write something there that procmail has to honor?
Is dovecot the way to do this? Am I misunderstanding what "quotas" mean in dovecot?
Thanks for any clues.
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
On Tue, 8 Jan 2008, papi mac wrote:
I have Fedora 7 from a standard installation running sendmail, procmail and dovecot 1.0 installed on a single partition. I now need to set up mail quotas for most of the users but not all. Just protecting /var/spool/mail/$LOGNAME is probably good enough for me. Since I just want mail quotas and the installation is on just 1 partition I don't have an easy way to use file system quotas. By reading through the dovecot documentation and list archives I have the feeling that this is possible with the versions and setup I have. I would probably need a main line like this (apart from other lines) per user mailbox that needs to be managed:
dirsize:/var/spool/mail/joe-user:storage 10240
to give joe-user a 10 mb limit.
Full dislosure: I haven't actually used Dovecot's quotas. (-:
Since this server is in production I don't have the luxury of experimenting (extensively) on it.
I have a question though that I have not been able to answer yet. If the flow of mail goes from sendmail to procmail to the mailbox, how is it possible for dovecot to implement quotas on the inbox? Or would dovecot write something there that procmail has to honor?
If you use the Dovecot delivery agent called "deliver" as the last chain, it will bounce the mail or not depending on of the user is above quota.
-- Asheesh.
-- When the wind is great, bow before it; when the wind is heavy, yield to it.
You mean by having a procmail rule to send the mail on to dovecot for delivery? If so, what would the line in the procmail rule look like?
Thanks.
Asheesh Laroia <asheesh@asheesh.org> wrote: On Tue, 8 Jan 2008, papi mac wrote:
I have Fedora 7 from a standard installation running sendmail, procmail and dovecot 1.0 installed on a single partition. I now need to set up mail quotas for most of the users but not all. Just protecting /var/spool/mail/$LOGNAME is probably good enough for me. Since I just want mail quotas and the installation is on just 1 partition I don't have an easy way to use file system quotas. By reading through the dovecot documentation and list archives I have the feeling that this is possible with the versions and setup I have. I would probably need a main line like this (apart from other lines) per user mailbox that needs to be managed:
dirsize:/var/spool/mail/joe-user:storage 10240
to give joe-user a 10 mb limit.
Full dislosure: I haven't actually used Dovecot's quotas. (-:
Since this server is in production I don't have the luxury of experimenting (extensively) on it.
I have a question though that I have not been able to answer yet. If the flow of mail goes from sendmail to procmail to the mailbox, how is it possible for dovecot to implement quotas on the inbox? Or would dovecot write something there that procmail has to honor?
If you use the Dovecot delivery agent called "deliver" as the last chain, it will bounce the mail or not depending on of the user is above quota.
-- Asheesh.
-- When the wind is great, bow before it; when the wind is heavy, yield to it.
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
On Tue, 8 Jan 2008, papi mac wrote:
You mean by having a procmail rule to send the mail on to dovecot for delivery? If so, what would the line in the procmail rule look like?
Right, that's what I mean -
at the end of the default procmail rules (like in /etc/procmailrc), pipe the message to deliver with the right arguments.
I don't actually use deliver, either, but maybe others can say more, or maybe you can figure it out from here.
-- Asheesh.
-- Time washes clean Love's wounds unseen. That's what someone told me; But I don't know what it means. -- Linda Ronstadt, "Long Long Time"
Asheesh Laroia wrote:
On Tue, 8 Jan 2008, papi mac wrote:
You mean by having a procmail rule to send the mail on to dovecot for delivery? If so, what would the line in the procmail rule look like?
Right, that's what I mean -
at the end of the default procmail rules (like in /etc/procmailrc), pipe the message to deliver with the right arguments.
I don't actually use deliver, either, but maybe others can say more, or maybe you can figure it out from here.
I'd be interested in using procmail between postfix and dovecot, but can't seem to figure out the command line args to allow me to use deliver. Anyone care to put me out of my misery? :-)
Thanks.
david
-- Asheesh.
I already have a procmail rule in each user's directory that delivers "X-Spam-Status: Yes" email to a "spam-mail" folder. and the others to the inbox (specified in $DEFAULT) Assuming I did not want spam-mail under quota control I suppose I would have to add a line at the end something like this only for those users that have quotas:
| "/usr/libexec/dovecot/deliver -m $DEFAULT -e"
Would this mean that "deliver" will look at the size of the $DEFAULT file (using a dirsize directive in dovecot.conf) and sned an error message back if it is over quota?
Asheesh Laroia <asheesh@asheesh.org> wrote: On Tue, 8 Jan 2008, papi mac wrote:
You mean by having a procmail rule to send the mail on to dovecot for delivery? If so, what would the line in the procmail rule look like?
Right, that's what I mean -
at the end of the default procmail rules (like in /etc/procmailrc), pipe the message to deliver with the right arguments.
I don't actually use deliver, either, but maybe others can say more, or maybe you can figure it out from here.
-- Asheesh.
-- Time washes clean Love's wounds unseen. That's what someone told me; But I don't know what it means. -- Linda Ronstadt, "Long Long Time"
Never miss a thing. Make Yahoo your homepage.
I tried this idea and it seems to work well. I ran into a problem that is probably Fedora related. The delivery failed because of a permission problem in /var/spool/mail. The users are not able to create the dotlock files there and so the error message is:
deliver(admin): open(/var/mail/.temp.mail.tecno.com.br.18793.f9456dce0b91597f) failed: Permission denied deliver(admin): file_lock_dotlock() failed with mbox file /var/mail/admin: Permission denied
I would like to avoid messing with the users and permissions to this directory, so I thought it would be good to have "deliver" create the dotlock files in another place. Is this possible and how is it configured?
Thanks.
papi mac <papi_m_a_c@yahoo.com> wrote: I already have a procmail rule in each user's directory that delivers "X-Spam-Status: Yes" email to a "spam-mail" folder. and the others to the inbox (specified in $DEFAULT) Assuming I did not want spam-mail under quota control I suppose I would have to add a line at the end something like this only for those users that have quotas:
| "/usr/libexec/dovecot/deliver -m $DEFAULT -e"
Would this mean that "deliver" will look at the size of the $DEFAULT file (using a dirsize directive in dovecot.conf) and sned an error message back if it is over quota?
Asheesh Laroia wrote: On Tue, 8 Jan 2008, papi mac wrote:
You mean by having a procmail rule to send the mail on to dovecot for delivery? If so, what would the line in the procmail rule look like?
Right, that's what I mean -
at the end of the default procmail rules (like in /etc/procmailrc), pipe the message to deliver with the right arguments.
I don't actually use deliver, either, but maybe others can say more, or maybe you can figure it out from here.
-- Asheesh.
-- Time washes clean Love's wounds unseen. That's what someone told me; But I don't know what it means. -- Linda Ronstadt, "Long Long Time"
Never miss a thing. Make Yahoo your homepage.
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
On Wed, 2008-01-09 at 13:07 -0800, papi mac wrote:
I tried this idea and it seems to work well. I ran into a problem that is probably Fedora related. The delivery failed because of a permission problem in /var/spool/mail. The users are not able to create the dotlock files there and so the error message is:
deliver(admin): open(/var/mail/.temp.mail.tecno.com.br.18793.f9456dce0b91597f) failed: Permission denied deliver(admin): file_lock_dotlock() failed with mbox file /var/mail/admin: Permission denied
I would like to avoid messing with the users and permissions to this directory, so I thought it would be good to have "deliver" create the dotlock files in another place. Is this possible and how is it configured?
You might as well then just disable dotlocks and just use fcntl locks. dotlocks are only necessary if you use other software than Dovecot to modify the mailboxes and it doesn't use fcntl locks.
See http://wiki.dovecot.org/MailboxFormat/mbox and http://wiki.dovecot.org/MboxLocking
participants (4)
-
Asheesh Laroia
-
David Reid
-
papi mac
-
Timo Sirainen