Le 23/05/2011 04:50, Des Dougan a écrit :
> Thanks, Sahil. What's the best way of doing that?
>
go step by step: add a domain in mysql, add users in mysql, ... then
tell postfix to use these (virtual_mailbox_domains,
virtual_mailbox_maps, ...) then test.
#cat main.cf
...
mysql=proxy:mysql:/etc/postfix/maps/mysql
virtual_mailbox_domains =
${mysql}/virtual_mailbox_domains
virtual_mailbox_maps =
${mysql}/virtual_mailbox
# cat /etc/postfix/maps/mysql/virtual_mailbox_domains
hosts = ...
user = ...
password = ...
dbname = ....
query =
SELECT
name
FROM
Domain
WHERE
name = '%s'
AND
class = 'mailbox'
;
# cat /etc/postfix/maps/mysql/virtual_mailbox
hosts = ...
user = ...
password = ...
dbname = ....
query =
SELECT
CONCAT(User.user, '@', Domain.name), CONCAT('/var/Mail/',
Domain.name, '/', User.user, '/maildir/')
FROM
User, Domain
WHERE
domain_id = Domain.id
AND
class='mailbox'
AND
Domain.name = '%d'
AND
User.user = '%u'
;
above, the Domain table has {id, name, class} fields and User table has
{id, user, domain_id} fields ("user" is the user-part, with no domain.
domain_id is the id of the domain. so one creates the domain ine the
Domain table, then adds users in the User table...).
> Regards,
>
> Des
>
> On May 2011, at 7:42 PM, Sahil Tandon wrote:
>
>> On Sun, 2011-05-22 at 19:33:03 -0700, Des Dougan wrote:
>>
>>> I'm changing an active Postfix server (with a single domain) to be
>>> able to support additional virtual domains (using MySQL). I'm slightly
>>> confused and would appreciate some advice: does the existing active
>>> domain need to be migrated into MySQL, or can it live outside (and
>>> alongside)?
>>
>> Alongside is fine.
>>
>> --
>> Sahil Tandon <[email protected]>
>
> --
>
> Des Dougan
> Principal
> Dougan Consulting Group Inc.
>
> http://www.DouganConsulting.tel <-- Get all my contact information here.
> http://www.DouganConsulting.com
>
> Peace of Mind, One Computer at a Time.
>
> ---
>
> Imagine anyone on the planet being able to find and then contact you with a
> single click. YourName.tel is all you will give anyone ever again. Want in?
>
> http://registertel.tel/
>