Toby Batch wrote:
I'm following the virtual mail set guide on the gentoo site and all appears to be going ok. i'm just having a few problem figuring out what should go in each of the mysql tables?

I have 5 tables:
 alias
 relocated
 transport
 users
 virtual

If I have a server called realserver.com with the users john & paul, and two virtual servers, virt1.com with user george and virt2.com with user ringo, then what goes in each table?

Assume each user has a unix log on with a home directory in /home and a maildir of $HOME/.maildir

I'll assume it's the Postfix how-to.

mysql -u root -p        # or whatever mysql account has rights
use mailsql             # or whatever you named it

# I'm also going to assume that you used the generic.sql or whatever thing to generate the database.

insert into transport (id, domain, destination) values (NULL,'realserver.com','local:');
insert into transport (id, domain, destination) values (NULL,'virt1.com','virtual:');
insert into transport (id, domain, destination) values (NULL,'virt2.com','virtual:');


What we've done so far is said that realserver is local and the other two domains are virtual. Anything designated as local: is going to use system accounts while virtual: needs to do a mysql lookup. BTW the NULL at the beginning is telling mysql to auto-increment the ID field.

INSERT INTO users (id, email, clear, name, uid, gid, homedir, maildir, quota, postfix) values (NULL,'[EMAIL PROTECTED]','changeme','George Harrison','1200','1200','/home/vmail','/home/vmail/virt1.com/george/.maildir','y','');
INSERT INTO users (id, email, clear, name, uid, gid, homedir, maildir, quota, postfix) values (NULL,'[EMAIL PROTECTED]','changeme','Ringo Starr','1200','1200','/home/vmail','/home/vmail/virt2.com/ringo/.maildir','y','');


What we have done above is specified our users. Your path, uid, gid, etc might be different. Passwords are going to be clear text unless you've changed the how-to significantly.

mkdir -p /home/vmail/virt1.com/george/
mkdir -p /home/vmail/virt2.com/ringo/
chown -R vmail: /home/vmail/

That created dirs and fixed permissions. Postfix will create the .maildir/ when the first mail is received as long as the userdir is there.

insert into virtual (id, email, destination) values (NULL,'[EMAIL PROTECTED]','[EMAIL PROTECTED]');
insert into virtual (id, email, destination) values (NULL,'[EMAIL PROTECTED]','[EMAIL PROTECTED],[EMAIL PROTECTED]');
insert into virtual (id, email, destination) values (NULL,'[EMAIL PROTECTED]','[EMAIL PROTECTED]');


The above is how to add some simple aliases. If you decide to add any wild card aliases you must create virtual aliases for real accounts as well. This is because the virtual table gets matched before the users table.

And the virtual how-to assumes you'll be using mailman. If you aren't then you can add $transport_maps to $mydestination which will keep you from having to manually add new domains to Postfix

One last note, if you want to allow users to manage their own domains once you set them up, check out postfixadmin. It's basically the virtual how-to but with a ton more functionality for managing the system. I'd look into now as the mysql layout is different and trying to cutover later will suck.

kashani

--
[email protected] mailing list



Reply via email to