![]() |
Problems with the Virtual Users And Domains With Postfix, Courier And MySQL tutorial
Hello
I've followed the instructions posted at http://www.howtoforge.com/virtual_po..._quota_courier as best I could, but have run into a couple snags. It's worth mentioning that I'm a not a newbie at this stuff, although most of my experience with MTAs in the past have been with Sendmail and Qmail. My host OS is Ubuntu 6.06, and the first snag I ran into was trying to figure out where the amavisd.conf file should go. Apt-get installs v. 2.3.3-3 of amavisd-new, and this version no longer uses a monolithic amavisd.conf file, but rather a collection of files in /etc/amavisd/conf.d. I wound up sticking the contents of the article's suggested amavisd.conf into the 50-user file, and while it seems to be working, I'm wondering what the potential downfalls of this approach are, or how I would evaluate which directives are being employed or ignored. My second problem is that mail is getting delivered to /var/spool/mail/user, and not /home/vmail/domain/user, and how I might correct that. The .cf files in /etc/postfix are exactly as described in the how-to, and I can login to the POP server using courier-authdaemon/authmysql, but I can't get mail delivered to the /home/vmail directory. Any suggestions on these matters would be most welcome, including pointers to previous discussions I might have missed in my searching. |
Couple more details about my setup
Here's a few more details about my setup (I've substiuted domain.com for my own domain):
main.cf: Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete versionCode:
user = mail_adminCode:
+-------------------------+Code:
+---------------------------------+---------------+----------+Code:
% telnet localhost 25Code:
Jul 20 15:23:58 twinkie postfix/smtpd[4354]: connect from localhost[127.0.0.1]Code:
060720 15:23:57 73 Query SELECT "Y" as local FROM domains WHERE CONCAT("@",domain) IN ('user@virtual.test','@virtual.test','@.virtual.test','@.test','@.')Code:
SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='virtual.test'Code:
SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='user@virtual.test' |
If you use Ubuntu, then you have Postfix 2.2 or newer. The tutorial was written for previous Postfix versions. In Postfix 2.2, the format of the .cf files changed. Have a look here: http://www.howtoforge.com/forums/sho...6&postcount=37 it should give you the idea.
|
OK, I took a look at this post, and from there, looked at the Postfix mysql table man page at http://www.postfix.org/mysql_table.5.html.
After reading about the differences in how these .cf files are formed, I made the following changes to the .cf tables. mysql-virtual_domains.cf: Code:
user = mail_adminCode:
user = mail_adminCode:
user = mail_adminCode:
user = mail_adminCode:
user=mail_adminCode:
user = mail_admin/var/log/mysql/mysql.log: Code:
060721 13:13:21 122 Connect mail_admin@localhost on mailCode:
Jul 21 13:13:21 twinkie postfix/cleanup[6757]: 133CA3BB466F: message-id=<20060721191239.133CA3BB466F@twinkie.domain.com> |
FWIW, I've also tried substituting '%s' with '%u@%d' and '%1@%2.%3', but when I put this in instead of '%s', it suppresses the query altogether and does not run it, which is very frustrating.
|
Can you try
Code:
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'instead of Code:
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email = '%s'Do the same for the other queries and restart Postfix. |
OK, done, but it didn't make a difference. Same results.
Code:
mysql-virtual_domains.cf:query = SELECT virtual FROM domains WHERE domain='%s' |
Hm, then I have no idea what's wrong...
|
After deploying the mysql table structure outlined here: http://postfixwiki.org/index.php?tit...IMAP_and_MySQL
It started working. I have no idea what the big difference is, though. Very strange. thanks for your help anyway w |
hello,
I have a problem with my mail server. I don't know if it is important to mention but I installed the virtual postfix mail server into a openvz vps. First all works fine, spam filter, anti virus, everything works fine when I send a spam test or eicar mail. After few test mails things start to go wrong. syslog: ------------------------ Aug 13 19:07:01 mail amavis[16283]: (16283-02) lookup_sql: 2006, MySQL server has gone away Aug 13 19:07:01 mail amavis[16283]: (16283-02) NOTICE: Disconnected from SQL server Aug 13 19:07:01 mail amavis[16283]: (16283-02) TROUBLE in check_mail: creating_partsdir FAILED: DBD::mysql::st execute failed: MySQL server has gone away at (eval 38) line 238, <GEN17> line 240. Aug 13 19:07:01 mail amavis[16283]: (16283-02) PRESERVING EVIDENCE in /var/lib/amavis/amavis-20060813T051002-16283 ------------------------- Amavis doesn't see the mysql server anymore wich is also running in a seperate openvz vps. Wen i check the mysql server it is online and working. I use ip numbers instead of host names so it can't be a dns problem. Mysql and dns servers are running oke. Amavis can't reach mysql anyway. After I restart the mail vps everything works fine again. when i send few test mails the server fails again. I searched google and the forum messages couldn't find a posting with a solution to this problem. Anybody? |
| All times are GMT +2. The time now is 02:37. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.