Postfix virtual users - maildir format and mail quota

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Postfix virtual users - maildir format and mail quota

Claudio Prono
Hi to all,

Reading the recents posts on the list i have a question.

Actually i use postfix with the VDA patch and a mysql backend with
postfix admin for the administration. The only problem is postfix on
OpenSuse don't have the VDA patch included, so i have to recompile and
repack the postfix to include the VDA patch every time. Now, my question is:

How i can do to have postfix with virtual users, mysql backend and
mailbox quota with postfixadmin without the VDA patch? There is any
metod ? I need also to have the maildirsize file or something similar.
Any clue?

Thank u,

Claudio Prono.

--
------------
Claudio Prono
Systems Development @ Atpss.net Srl, Divisione Implementazione Sistemi
Via San Bernardino, 17 - 10137 Torino (TO) - IT
Tel +39-011.32.72.100  Fax +39-011.32.46.497
PGP Fingerprint: 75C2 4049 E23D 2FBF A65F  40DB EA5C 11AC C2B0 3647
Disclaimer: http://atpss.net/disclaimer
------------

Reply | Threaded
Open this post in threaded view
|

Re: Postfix virtual users - maildir format and mail quota

Brian Evans - Postfix List
Claudio Prono wrote:

> Hi to all,
>
> Reading the recents posts on the list i have a question.
>
> Actually i use postfix with the VDA patch and a mysql backend with
> postfix admin for the administration. The only problem is postfix on
> OpenSuse don't have the VDA patch included, so i have to recompile and
> repack the postfix to include the VDA patch every time. Now, my
> question is:
>
> How i can do to have postfix with virtual users, mysql backend and
> mailbox quota with postfixadmin without the VDA patch? There is any
> metod ? I need also to have the maildirsize file or something similar.
> Any clue?

Simply use another LDA, such as Dovecot, instead of the basic virtual
agent bundled with Postfix.
See pages like http://wiki.dovecot.org/LDA for more info and very
detailed examples.

Brian

Reply | Threaded
Open this post in threaded view
|

Re: Postfix virtual users - maildir format and mail quota

Claudio Prono
Ok, thank u. I have take a fast look to the page, seems very
interesting. I have also seen it have also an autoreply plugin for
dovecot,  very interesting. Someone use the autoreply plugin? I have a
big problem with the others autoresponders:  i don't want them to reply
to the mails of spam detected from DSPAM. Anyone knows if that
autoresponder can be configured to avoid that problem?

Thank u to all,

Claudio Prono.


Brian Evans ha scritto:

> Claudio Prono wrote:
>> Hi to all,
>>
>> Reading the recents posts on the list i have a question.
>>
>> Actually i use postfix with the VDA patch and a mysql backend with
>> postfix admin for the administration. The only problem is postfix on
>> OpenSuse don't have the VDA patch included, so i have to recompile
>> and repack the postfix to include the VDA patch every time. Now, my
>> question is:
>>
>> How i can do to have postfix with virtual users, mysql backend and
>> mailbox quota with postfixadmin without the VDA patch? There is any
>> metod ? I need also to have the maildirsize file or something
>> similar. Any clue?
>
> Simply use another LDA, such as Dovecot, instead of the basic virtual
> agent bundled with Postfix.
> See pages like http://wiki.dovecot.org/LDA for more info and very
> detailed examples.
>
> Brian
>
>
>
>

--
------------
Claudio Prono
Systems Development @ Atpss.net Srl, Divisione Implementazione Sistemi
Via San Bernardino, 17 - 10137 Torino (TO) - IT
Tel +39-011.32.72.100  Fax +39-011.32.46.497
PGP Fingerprint: 75C2 4049 E23D 2FBF A65F  40DB EA5C 11AC C2B0 3647
Disclaimer: http://atpss.net/disclaimer
------------

Reply | Threaded
Open this post in threaded view
|

Re: Postfix virtual users - maildir format and mail quota

Santiago Romero-2
In reply to this post by Claudio Prono
Claudio Prono wrote:

>
> Actually i use postfix with the VDA patch and a mysql backend with
> postfix admin for the administration. The only problem is postfix on
> OpenSuse don't have the VDA patch included, so i have to recompile and
> repack the postfix to include the VDA patch every time. Now, my
> question is:
>
> How i can do to have postfix with virtual users, mysql backend and
> mailbox quota with postfixadmin without the VDA patch? There is any
> metod ? I need also to have the maildirsize file or something similar.
> Any clue?

 I'm currently working on that, because I don't want to use the VDA
patch to avoid patching and recompile each time (I prefer precompiled
security supported Debian packages).

 Now the "possible" answer (please, if someone sees something wrong,
feel free to correct me).

 The idea is using dovecot as LDA (application which saves the email
finally in the maildir) instead of postfix's virtual process.

 Quick conf:

- Install dovecot-common

- Define a "dovecot" service by adding this to your master.cf:

dovecot   unix   -    n  n  -   -    pipe
  flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}

- Change from virtual to dovecot in main.cf:

virtual_transport = dovecot

- Now edit /etc/dovecot/dovecot.conf and config it to do delivery and
use quotas. I'm going to paste all the lines I've changed in the default
config (maybe you should adjust for your conf but you'll take the idea):

disable_plaintext_auth = no
mail_location = maildir:/home/vmail/vhosts/%d/%n

protocol lda {
  postmaster_address = [hidden email]
  auth_socket_path = /var/run/dovecot/auth-master
  mail_plugins = cmusieve quota
}

auth default {

  mechanisms = plain login

  userdb sql {
    args = /etc/dovecot/dovecot-mysql.conf
  }

 socket listen {
    master {
      path = /var/run/dovecot/auth-master
      mode = 0600
      user = vmail
      group = vmail
    }
    client {
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix
    }
  }
}

plugin {
  # quota = maildir:storage=10240:messages=1000
  # quota = maildir:storage=10240:ignore=Trash
  quota = maildir:storage=10240
  }


- Create files and so for dovecot (see dovecot install):

# mkdir /var/spool/postfix/var/run/dovecot
# chgrp vmail /etc/dovecot/dovecot.conf
# chmod g+r /etc/dovecot/dovecot.conf
# blah

- Create the mysql CF file for dovecot to know how to fetch data from mysql:

# cat /etc/dovecot/dovecot-mysql.conf

driver = mysql
default_pass_scheme = CRYPT
connect = host=127.0.0.1 dbname=postfix user=postfix password=password

# single line query, split for visual reasons ;)
password_query = SELECT password FROM mailbox
                 WHERE username = '%u' AND active = '1'

user_query = SELECT maildir, 5000 AS uid, 5000 AS gid,
             concat('maildir:storage=', floor(quota/1024))
             AS quota FROM mailbox WHERE username = '%u'
             AND active = '1'


- Restart dovecot and postfix. Now dovecot knows how to fetch (from
mysql) quotas, and will generate a maildirsize file into the Maildir/ in
each delivery, checking for quota.

 Maybe you should first focus on:

- Do the delivery with dovecot (easy).

 and then:

- Modify dovecot's conf to read and use quotas.

 Bye!

--
Santiago Romero