mailbox storage tuning

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

mailbox storage tuning

Андрей-21
I have this in my main.cf file:
        <...>
        virtual_mailbox_maps = pgsql:/etc/postfix/vpcit.ru_mailboxes
        virtual_mailbox_base = /var/mail/vpcit.ru/
        <...>

In file vpcit.ru_mailboxes this:
        hosts = ...
        user = ...
        password = ...
        dbname = ...
        table = ...
        select_field = pw_name
        where_field = email

pw_name field contains username without "@domain...". So when i send mail to
virtual hosted user, it appears in /var/mail/vpcit.ru/ , but directory for
virtual mailbox is not created. And it is understood, because in pw_name
filed only username, not the full path to mailbox.
The question is: how to configure postfix to create directory for a mailbox in
this situation or i should change my database?

Yours faithfully,
Andrey.
Reply | Threaded
Open this post in threaded view
|

Re: mailbox storage tuning [self-solved]

Андрей-21
On Monday 07 July 2008 10:29:52 Андрей wrote:

> I have this in my main.cf file:
> <...>
> virtual_mailbox_maps = pgsql:/etc/postfix/vpcit.ru_mailboxes
> virtual_mailbox_base = /var/mail/vpcit.ru/
> <...>
>
> In file vpcit.ru_mailboxes this:
> hosts = ...
> user = ...
> password = ...
> dbname = ...
> table = ...
> select_field = pw_name
> where_field = email
>
> pw_name field contains username without "@domain...". So when i send mail
> to virtual hosted user, it appears in /var/mail/vpcit.ru/ , but directory
> for virtual mailbox is not created. And it is understood, because in
> pw_name filed only username, not the full path to mailbox.
> The question is: how to configure postfix to create directory for a mailbox
> in this situation or i should change my database?
>
> Yours faithfully,
> Andrey.

A couple of man pages resulted this vpcit.ru_mailboxes:
        hosts = ...
        user = ...
        password = ...
        dbname = ...
        #table = ...
        #select_field = pw_name
        #where_field = email
        query = SELECT 'vpcit.ru/' || pw_name || '/' FROM ... WHERE email = '%s'

I think it'll be usefull for somebody.