Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Postfix and Postfix Admin's MySQL databases to work together 1

Status
Not open for further replies.

redhat19

IS-IT--Management
May 15, 2012
3
Hi all,

I followed the instructions here:
to configure Postfix to work with MySQL and Dovecot before discovering PostfixAdmin.

Since I had created MySQL database already..
Question #1: is there anyway to make all these work with Postfix admin/Postfix Admin's database for the creationg and use of virtual users/mailboxes?

I had also installed Roundcube following the instructions on Roundcube's page:
The questions now is:
.
#2. Roundcube came with its own database, which also stores user information.
Is there a way to ensure that the user information is picked from the database created to work with Postfix (and not Roundcube's)?

Thanks.
 
For question 1, see my answer to your post here:
For question 2, each of these applications has a schema associated with the database. You need to use one database for your mail system. The database is governed by the configuration files in both Postfix and Dovecot. If you import the schema from Postfixadmin, it will work. I have already pointed you to a working Dovecot configuration file that will meet your objectives. If you need the SQL configuration files, e.g. transport-maps, alias-maps, etc, I would be happy to oblige you there too. Once you have your virtual database configured properly, you should have little to no problem using Roundcube, Squirrelmail, or any other POP/IMAP web interface on top of the system.
 
Hi Noway2

Thanks for your help.

I have looked at your dovecot.conf file and can't seem to identify the sections that allow you use PostfixAdmin's database for the management and use of virtual users/mailboxes.

If I could identify these sections, I would prefer to add it to mine, as I went through so much pain to get my dovecot.conf file working.

Please find my dovecot.conf file here:

Your/Noway2's dovecot.conf file:

(keep in mind/view that I have already created the database to do this following the instructions here: .Now, I guess I'll have to somehow transfer this scheme to the postfixadmin's db, right?)


..and Yes, I would need the SQL configuration files, e.g. transport-maps, alias-maps, etc

Thanks for all the help.
 
Looking at the files, I think we need to go back to the userdb and passdb sections, which both reference the dovecot-sql.

I appologize for the delay in getting back to you. I will look up these files and shoot them off to you. One other thing I noticed is the difference in userdb args, where you have args = uid=5000 gid=5000 home=/home/vmail/%d/%n allow_all_users=yes, whereas I have something like this in my Postfix master.cf file. I will also look in the Postfix admin, as there were some configuration parameters there.

What I would recommend you do, is be sure to copy your working files - every file you change or even the entire directories. That way you can experiment and if it doesn't work, go back without losing what you have so far.

 
Hi Noway2

Thanks a million.
I might have somehow managed to get things to work by following the instructions of @defry in this forum chain of discussion:
There were a few things I had to do which I really don't know why I did...
especially changing postfix's UID to 640 and chown of some files to make postfix own them i.e
chown -R postfix /var/lib/postfix

I have pasted all my Postfix and Dovecot configuration files here:
and the server logs from var/logs/maillog in the earlier forum discussion I pointed to:
if you would be kind enough to take a look.. just to make sure things are working correctly and I wouldn't get into trouble down the line somewhere.

Thanks a whole lot.
 
I am glad that you got it working. In case you are still interested, I have pasted a copy of my configuration files here:
There are a couple of important points to note:
1 - I use Dovecot as my delivery agent, which is governed by the Dovecot line in master.cf
2 - The critical dovecot file is dovecot-sql.conf. There are two lines in there that are used to associate with the correct schema, as well as the maildir structure. These are user_query and password_query. Notice how they use a lot of statmentes containing "as", such as "as mail". For example, 'maildir:/var/mail/%d/%n' as mail, so that /var/mail/<virtual_domain>/<virtual_uid>/ becomes the field that goes in the mail column in the query.
3 - The other .cf files are simple postfix mappings, just using the database instead of hash tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top