Hi All,

I try to configure postfix virtual user with mysql. I got the problem log
below

Jun 29 14:47:48 centos-vm postfix/virtual[4714]: A043137ACA: to=<
mak...@khmerict.com>, relay=virtual, delay=305, delays=304/1/0/0.02,
dsn=4.2.0, status=deferred (delivery failed to mailbox
/home/vmail//home/vmail/khmerict.com/makara: unable to create lock file
/home/vmail//home/vmail/khmerict.com/makara.lock: No such file or directory)

I found that the problem is because of the file

[r...@centos-vm vmail]# cat /etc/postfix/mysql-virtual-mailbox-maps.cf
hosts    = localhost
dbname   = postfix
user     = postfixuser
password = xxxxxx

1/ query   = SELECT
CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
 FROM mailbox WHERE email='%s' AND active=1

2/ #query  = SELECT maildir FROM mailbox WHERE email='%s' AND active=1


but I still understand what is the different the query 1 and query 2 return
the same result.

Why query 2 doesn't work, could anyone kindly explain me why?


The main.cf file

[r...@centos-vm vmail]# cat /etc/postfix/main.cf

myhostname      = mail.khmerict.com
mydomain        = khmerict.com
mynetworks      = 192.168.0.0/24, 10.10.10.0/24
mydestination   = $myhostname, localhost.$mydomain, localhost

home_mailbox    = Maildir/


### Virtual mailbox config

virtual_mailbox_domains = proxy:mysql:/etc/postfix/
mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps    = proxy:mysql:/etc/postfix/
mysql-virtual-mailbox-maps.cf
virtual_mailbox_base   = /home/vmail
virtual_mailbox_limit   = 20480000
virtual_uid_maps = static:101
virtual_gid_maps = static:102
virtual_transport = virtual

-- 
The person who loves others will also be loved.

Reply via email to