From: Makara on
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=<
makara(a)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

[root(a)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

[root(a)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.
From: mouss on
Makara a �crit :
> 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=<makara(a)khmerict.com <mailto:makara(a)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
> <http://khmerict.com/makara>: unable to create lock file
> /home/vmail//home/vmail/khmerict.com/makara.lock
> <http://khmerict.com/makara.lock>: No such file or directory)
>

oh please, with gmail, click on the "text" button" (while I only see
your <http...> silly things, some readers here will only see that. which
makes your message unreadable for these guys).

does /home/vmail/home/vmail/khmerict.com/ exist as a directory? the fact
that "/home/vmail" is repeated indicated an issue. make sure your maps
return a relative directory or set
virtual_mailbox_base = /


> I found that the problem is because of the file
>
> [snip]
> 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.

If you think they return the same result, yet you think one works and
the other does not, then you need some tea.

please copy-paste the results of each query here. note that a slash
('/') changes a lot of things.

> [snip]

From: Makara on
Hi All,

Thank for your reply, I have fixed the path problem but I still have the
problem something like the log

I use query 2

log file:

Jun 30 08:48:32 centos-vm postfix/virtual[16725]: E66D137ACE: to=<
makara(a)khmerict.com>, relay=virtual, delay=0.08, delays=0.06/0.01/0/0.01,
dsn=4.2.0, status=deferred (delivery failed to mailbox /home/vmail/
khmerict.com/makara: unable to create lock file /home/vmail/
khmerict.com/makara.lock: No such file or directory)


I read the instruction as advise
http://www.pubbs.net/200909/postfix/114776-postfixvirtual-still-not-working.html
so I create khmerict.com folder in /home/vmail/khmerict.com/.


-----------It work fine--------------------


but I still wonder with the queries:

[root(a)centos-vm vmail]# cat /etc/postfix/mysql-virtual-mailbox-maps.cf
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.

If I use query 1 I don't need to create domain folder in
/home/vmail/<domain> but with query 2 I have to create /home/vmail/<domain>

Even I can fix the problem but I still hope someone will explain me about
this case

--
The person who loves others will also be loved.
From: Makara on
Hi all,

Thank you for your useful advises. I found the problem is mailbox and
maildir ( just / in maildir database record).

Thank again for your help.

On Wed, Jun 30, 2010 at 8:50 AM, Makara <chanmakara(a)gmail.com> wrote:

> Hi All,
>
> Thank for your reply, I have fixed the path problem but I still have the
> problem something like the log
>
> I use query 2
>
> log file:
>
> Jun 30 08:48:32 centos-vm postfix/virtual[16725]: E66D137ACE: to=<
> makara(a)khmerict.com>, relay=virtual, delay=0.08, delays=0.06/0.01/0/0.01,
> dsn=4.2.0, status=deferred (delivery failed to mailbox /home/vmail/
> khmerict.com/makara: unable to create lock file /home/vmail/
> khmerict.com/makara.lock: No such file or directory)
>
>
> I read the instruction as advise
> http://www.pubbs.net/200909/postfix/114776-postfixvirtual-still-not-working.html
> so I create khmerict.com folder in /home/vmail/khmerict.com/.
>
>
> -----------It work fine--------------------
>
>
> but I still wonder with the queries:
>
> [root(a)centos-vm vmail]# cat /etc/postfix/mysql-virtual-mailbox-maps.cf
> 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.
>
> If I use query 1 I don't need to create domain folder in
> /home/vmail/<domain> but with query 2 I have to create /home/vmail/<domain>
>
> Even I can fix the problem but I still hope someone will explain me about
> this case
>
>
> --
> The person who loves others will also be loved.
>



--
The person who loves others will also be loved.
From: mouss on
Makara a �crit :
> Hi all,
>
> Thank you for your useful advises. I found the problem is mailbox and
> maildir ( just / in maildir database record).
>

If I understand it, it was a lackig slash, right?
(I personally don't like the slash convention. I would prefer a
type:path syntax. I mean maildir:/foo/bar and mailbox:/foo/bar...).

> Thank again for your help.

you're welcome. if you find it nice to see people help you, I find it
great to see nice people we can help (and who actually help "indirectly").