LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Define disk quota on simple Postfix + Dovecot mail server (https://www.linuxquestions.org/questions/slackware-14/define-disk-quota-on-simple-postfix-dovecot-mail-server-4175468977/)

kikinovak 07-09-2013 05:08 AM

Define disk quota on simple Postfix + Dovecot mail server
 
Hi,

I just setup my new mail server on Slackware64 14.0, using Postfix and Dovecot. It's running fine, with a handful of domains and a few handfuls of users. Configuration is "Keep It Simple Stupid", so no virtual users, no MySQL, just a bunch of addresses mapped to local users (who can't login directly to the machine).

Here's my own HOWTO (in French, but the configuration listings are universal):

http://www.microlinux.fr/slackware/L...Mail-HOWTO.txt

Right now I'm wondering how I could define some quotas on a per-user basis. I don't like the idea of unlimited mail storage. My first question is: should I use Postfix quota mechanisms, or rather plain disk quota? I already know the latter, which I do use on networks with central authentication (with edquota and repquota).

Any suggestions?

Gerard Lally 07-09-2013 08:07 AM

Use Dovecot to implement quotas:

http://wiki2.dovecot.org/Quota/Configuration

kikinovak 07-09-2013 09:39 AM

Quote:

Originally Posted by gezley (Post 4986929)
Use Dovecot to implement quotas:

http://wiki2.dovecot.org/Quota/Configuration

I already read this page, but it's unfortunately not very well explained, e. g. I still don't know which option goes where. Here's my actual (working) /etc/dovecot/dovecot.conf file:

Code:

# /etc/dovecot/dovecot.conf
protocols = imap
listen = *
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
mail_location = maildir:~/Maildir
auth_mechanisms = plain login
passdb {
  driver = shadow
  args  =
}
passdb {
  driver = passwd
  args  =
}
userdb {
  driver = passwd
  args  =
}
service auth {
  unix_listener auth-userdb {
    mode = 0600
    user = postfix
    group = postfix
  }
  unix_listener /var/spool/postfix/private/auth {
    mode = 0666
  }
  user = $default_internal_user
}

Let's say - for example's sake - I want a default of 100 MB mail storage per user, except users mworms and jpvergniol, who should get each one 500 MB mail storage.

How do I configure the default behaviour (100 MB quota) in dovecot.conf?

As for the quota overrides, here's the page that explains (more or less) how to do that:

http://wiki2.dovecot.org/UserDatabase/ExtraFields

I think I'm concerned by the last section (passwd-file), but what do I have to do here? Edit my /etc/passwd file and add fields like userdb_quota_rule=*:storage=500M for overrides?

I'm puzzled.

kikinovak 07-09-2013 10:36 AM

OK, I experimented some more, and implementing "classical" Linux disk quotas works very nice.

I defined some very restrictive quotas for a few users, and once their disk is full, the sender of a mail gets a "Disk quota exceeded" mail in return.

Which is all I wanted, so I'll mark this thread as SOLVED.

Thanks !


All times are GMT -5. The time now is 01:25 PM.