[prev in list] [next in list] [prev in thread] [next in thread]
List: postfix-users
Subject: Re: What causes: User unknown in virtual mailbox table.
From: Robert Chalmers <racuk12 () icloud ! com>
Date: 2015-04-30 13:17:37
Message-ID: 5C516C0F-4837-4097-9ED7-51F90FC7FC62 () icloud ! com
[Download RAW message or body]
@Nicolás
Fixed. Working. well 99%. The problem was actually stupidly simple. On my part as \
usual.
station.master@quantum-radio SHOULD be station.manager@quantum-radio…. trust me to \
pick the one bad one to test with.
So now the original syntax for the query works.
> > query = SELECT 1 FROM virtual_users WHERE email='%s'
I checked the permissions as you suggested. That's all ok.
It's 99% working now. I had to track down a pam/password problem. I have mixed \
Virtual and Local users on the machine. It appears to be ok.
So now the Virtual mailboxes are collecting mail, and so are the local users.
the mail directory is /var/mail/vhosts
In which are appearing both the local and the virtual mailboxes.
drwxr-xr-x 4 vmail vmail 136 28 Apr 12:29 quantum-radio.net \
<http://quantum-radio.net/> drwx------ 9 vmail vmail 306 30 Apr 13:43 \
station.manager
under quantum-radio.net <http://quantum-radio.net/> is...
/private/var/mail/vhosts/quantum-radio.net
bash-3.2# ls -l
total 0
drwxr-xr-x 10 vmail vmail 340 30 Apr 09:31 robert
drwxr-xr-x 10 vmail vmail 340 30 Apr 13:56 station.manager
So I'm a little confused by all this now, and will take some time out. Mail is \
actually collecting in those mail-dire, but I can't yet find a way to access it yet. \
!!! Neither MailMate, or Apple Mail seem to want to look at it. hmmm. I guess they \
don't know how to find it down in ghosts - but there will be a way.
anyway - thanks for your help and patience. much appreciated.
Robert
mysql> SELECT * FROM mailserver.virtual_users;
+----+-----------+---------------+---------------------------------------+
> id | domain_id | password | email |
+----+-----------+---------------+---------------------------------------+
xxxxxxxx
> 6 | 1 | xxxxxxxxxxxxxx| station.master@quantum-radio.net \
> <mailto:station.master@quantum-radio.net> |
xxxxxxx
+----+-----------+---------------+---------------------------------------+
11 rows in set (0.00 sec)
> On 29 Apr 2015, at 21:08, Nicolás <nicolas@devels.es> wrote:
>
> (resending to list)
>
> El 29/04/15 a las 19:34, Robert Chalmers escribió:
> > Ok, my /etc/postfix/mysql-virtual-mailbox-maps.cf
> >
> > has:
> > user = mailman
> > password = xxxxxxxxxxx
> > hosts = 127.0.0.1
> > dbname = mailserver
> > query = SELECT 1 FROM virtual_users WHERE email='%s'
> >
> > [...]
> >
> > Using your syntax, I'm a little closer
> >
> > postmap -q station.manager@quantum-radio.net \
> > <mailto:station.manager@quantum-radio.net> \
> > mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
> > postmap: warning: mysql query failed: You have an error in your SQL syntax; check \
> > the manual that corresponds to your MySQL server version for the right syntax to \
> > use near ''station.manager@quantum-radio.net \
> > <mailto:station.manager@quantum-radio.net>???' at line 1
> > postmap: fatal: table mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf: query \
> > error: Undefined error: 0
>
> Double check for syntax, quotation marks, ... in the query, it's likely you missed \
> copying the sentence correctly.
> > [...]
> >
> > I did have this
> > virtual_mailbox_base = /var/mail/vhosts
> >
> > [...]
>
> Also check that this directory (and subdirectories) has the right permissions so \
> Postfix and your e-mail server can access them. Otherwise you'll get errors.
> Regards,
>
> Nicolás
>
> >
> >
> >
> > > On 29 Apr 2015, at 16:51, Nicolás <nicolas@devels.es \
> > > <mailto:nicolas@devels.es>> wrote:
> > >
> > > El 29/04/15 a las 16:25, Robert Chalmers escribió:
> > > >
> > > > I have the following error when trying to send mail to a virtual domain on \
> > > > the server.
> > > > I'm afraid I can not find the source of this error.
> > > >
> > > > postfix/smtpd[901]: NOQUEUE: reject: RCPT from mail-yk0-f175.google.com \
> > > > <http://mail-yk0-f175.google.com/>[209.85.160.175]: 550 5.1.1 \
> > > > <station.manager@quantum-radio.net \
> > > > <mailto:station.manager@quantum-radio.net>>: Recipient address rejected: User \
> > > > unknown in virtual mailbox table; from=<racuk12@gmail.com \
> > > > <mailto:racuk12@gmail.com>> to=<station.manager@quantum-radio.net \
> > > > <mailto:station.manager@quantum-radio.net>> proto=ESMTP \
> > > > helo=<mail-yk0-f175.google.com <http://mail-yk0-f175.google.com/>>
> > > > If this is not the appropriate mailing list for this type of question, can \
> > > > someone please point me at a list that is? thanks
> > > > Robert
> > > >
> > > >
> > > > robert$ postconf -n
> > > > [...]
> > > > virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
> > > > [...]
> > >
> > > What's the content of /etc/postfix/mysql-virtual-mailbox-maps.cf? For a given \
> > > e-mail address, it should return the path where the virtual user's inbox is. \
> > > For example:
> > > user = db_username
> > > password = db_password
> > > dbname = db_name
> > > query = SELECT CONCAT(SUBSTRING_INDEX(email, '@', -1), '/', \
> > > SUBSTRING_INDEX(email, '@', 1), '/') FROM users WHERE email = '%s' hosts = \
> > > 127.0.0.1
> > > The query field assumes that an e-mail address like \
> > > station.manager@quantum-radio.net <mailto:station.manager@quantum-radio.net> \
> > > will be passed as %s. In the case above, it's assumed that paths are always \
> > > domain/username/ like, so following the example, \
> > > quantum-radio.net/station.manager/ <http://quantum-radio.net/station.manager/> \
> > > would be returned.
> > > This path is relative to the virtual_mailbox_base parameter, which by the way \
> > > you don't seem to have defined. If your virtual mailboxes are located under \
> > > /home/virtual, set virtual_mailbox_base to this value so the user mailbox's \
> > > path would be returned as /home/virtual/quantum-radio.net/station.manager/ \
> > > <http://quantum-radio.net/station.manager/>.
> > > Regards,
> > >
> > > Nicolás
> >
>
[Attachment #3 (unknown)]
<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class=""><div class=""><br \
class=""></div><div class="">@Nicolás</div><div class=""><br class=""></div><div \
class="">Fixed. Working. well 99%. The problem was actually stupidly simple. On \
my part as usual.</div><div class=""><br class=""></div><div class="">station.<b \
class="">master</b>@quantum-radio SHOULD be station.<b \
class="">manager</b>@quantum-radio…. trust me to pick the one bad one to test \
with.</div><div class=""><br class=""></div><div class="">So now the original syntax \
for the query works.</div><div class=""><blockquote type="cite" class=""><div \
bgcolor="#FFFFFF" text="#000000" class=""><blockquote \
cite="mid:07ACAF52-0EBD-4AF1-BA3B-AE7E26BAC30E@icloud.com" type="cite" class=""><div \
class=""><div class="" style="margin: 0px; font-size: 11px; font-family: \
Menlo;"><font color="#000000" class="">query = SELECT 1 FROM virtual_users WHERE \
email='%s'</font></div></div></blockquote></div></blockquote><br class=""></div><div \
class="">I checked the permissions as you suggested. That's all ok.</div><div \
class=""><br class=""></div><div class="">It's 99% working now. I had to track down a \
pam/password problem. I have mixed Virtual and Local users on the machine.</div><div \
class="">It appears to be ok.</div><div class="">So now the Virtual mailboxes are \
collecting mail, and so are the local users.</div><div class=""><br \
class=""></div><div class="">the mail directory is /var/mail/vhosts </div><div \
class=""><br class=""></div><div class="">In which are appearing both the local and \
the virtual mailboxes.</div><div class=""><br class=""></div><div class=""><div \
style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">drwxr-xr-x 4 \
vmail vmail 136 28 Apr 12:29 <a href="http://quantum-radio.net" \
class="">quantum-radio.net</a></div></div><div style="margin: 0px; font-size: 11px; \
font-family: Menlo;" class=""><div style="margin: 0px;" class="">drwx------ 9 \
vmail vmail 306 30 Apr 13:43 station.manager</div></div><div class=""><br \
class=""></div><div class="">under <a href="http://quantum-radio.net" \
class="">quantum-radio.net</a> is...</div><div class=""><div style="margin: 0px; \
font-size: 11px; font-family: Menlo;" class="">/private/var/mail/vhosts/<a \
href="http://quantum-radio.net" class="">quantum-radio.net</a></div><div \
style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">bash-3.2# ls \
-l</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">total \
0</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">drwxr-xr-x 10 vmail vmail 340 30 Apr 09:31 \
robert</div><div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">drwxr-xr-x 10 vmail vmail 340 30 Apr 13:56 \
station.manager</div></div><div class=""><br class=""></div><div class="">So I'm a \
little confused by all this now, and will take some time out. Mail is actually \
collecting in those mail-dire, but I can't yet find a way to access it yet. !!! \
Neither MailMate, or Apple Mail seem to want to look at it. hmmm. I guess they \
don't know how to find it down in ghosts - but there will be a way.</div><div \
class=""><br class=""></div><div class="">anyway - thanks for your help and patience. \
much appreciated.</div><div class=""><br class=""></div><div \
class="">Robert</div><div class=""><br class=""></div><div class=""><br \
class=""></div><div class=""><br class=""></div><div class="" style="margin: 0px; \
font-size: 11px; font-family: Menlo;">mysql> SELECT * FROM \
mailserver.virtual_users;</div><div class="" style="margin: 0px; font-size: 11px; \
font-family: Menlo;">+----+-----------+---------------+---------------------------------------+</div><div \
class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">| id | domain_id | \
password | email \
|</div><div class="" \
style="margin: 0px; font-size: 11px; font-family: \
Menlo;">+----+-----------+---------------+---------------------------------------+</div><div \
class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">xxxxxxxx</div><div \
class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">| 6 | \
1 | xxxxxxxxxxxxxx| <a \
href="mailto:station.master@quantum-radio.net" \
class="">station.master@quantum-radio.net</a> |</div><div \
class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">xxxxxxx</div><div \
class="" style="margin: 0px; font-size: 11px; font-family: \
Menlo;">+----+-----------+---------------+---------------------------------------+</div><div \
class="" style="margin: 0px; font-size: 11px; font-family: Menlo;">11 rows in set \
(0.00 sec)</div><div><blockquote type="cite" class=""><div class="">On 29 Apr 2015, \
at 21:08, Nicolás <<a href="mailto:nicolas@devels.es" \
class="">nicolas@devels.es</a>> wrote:</div><br \
class="Apple-interchange-newline"><div class="">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
(resending to list)<br class="">
<br class="">
<div class="moz-cite-prefix">El 29/04/15 a las 19:34, Robert
Chalmers escribió:<br class="">
</div>
<blockquote cite="mid:07ACAF52-0EBD-4AF1-BA3B-AE7E26BAC30E@icloud.com" \
type="cite" class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div class="">Ok, my <span style="font-family: Menlo; font-size:
11px;" class="">/etc/postfix/mysql-virtual-mailbox-maps.cf</span></div>
<div class=""><br class="">
</div>
<div class="">has:</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">user \
= mailman</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">password = xxxxxxxxxxx</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">hosts \
= 127.0.0.1</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">dbname = mailserver</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class="">query \
= SELECT 1 FROM virtual_users WHERE email='%s'</div> </div>
<div class=""><br class="">
</div>
[...]<br class="">
<br class="">
<div class="">Using your syntax, I'm a little closer</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">postmap -q <a moz-do-not-send="true" \
href="mailto:station.manager@quantum-radio.net" \
class="">station.manager@quantum-radio.net</a> \
mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">postmap: warning: mysql query failed: You have an error in your SQL syntax; \
check the manual that corresponds to your MySQL server version for the right syntax \
to use near ''<a moz-do-not-send="true" \
href="mailto:station.manager@quantum-radio.net" \
class="">station.manager@quantum-radio.net</a>???' at line 1</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">postmap: fatal: table mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf: \
query error: Undefined error: 0</div>
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br \
class=""> </div>
</blockquote>
<br class="">
Double check for syntax, quotation marks, ... in the query, it's
likely you missed copying the sentence correctly.<br class="">
<br class="">
<blockquote cite="mid:07ACAF52-0EBD-4AF1-BA3B-AE7E26BAC30E@icloud.com" \
type="cite" class="">[...]<br class=""> <br class="">
<div class="">I did have this </div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" \
class="">virtual_mailbox_base = /var/mail/vhosts</div> </div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;" class=""><br \
class=""> </div>
[...]<br class="">
</blockquote>
<br class="">
Also check that this directory (and subdirectories) has the right
permissions so Postfix and your e-mail server can access them.
Otherwise you'll get errors.<br class="">
<br class="">
Regards,<br class="">
<br class="">
Nicolás<br class="">
<br class="">
<blockquote cite="mid:07ACAF52-0EBD-4AF1-BA3B-AE7E26BAC30E@icloud.com" \
type="cite" class="">
<div class=""><span style="background-color: rgb(255, 255, 255);" class=""><br \
class=""> </span></div>
<div class=""><br class="">
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 29 Apr 2015, at 16:51, Nicolás <<a \
moz-do-not-send="true" href="mailto:nicolas@devels.es" \
class="">nicolas@devels.es</a>> wrote:</div> <br \
class="Apple-interchange-newline"> <div class="">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" \
class=""> <div bgcolor="#FFFFFF" text="#000000" class=""> <br class="">
<div class="moz-cite-prefix">El 29/04/15 a las 16:25,
Robert Chalmers escribió:<br class="">
</div>
<blockquote cite="mid:8392B222-D948-4C01-B837-FA0633E5B6D4@icloud.com" \
type="cite" class=""> <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" class="">
<div class=""><br class="">
</div>
<div class="">I have the following error when trying to
send mail to a virtual domain on the server.</div>
<div class=""><br class="">
</div>
<div class="">I'm afraid I can not find the source of
this error.</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class="">postfix/smtpd[901]: NOQUEUE:
reject: RCPT from <a moz-do-not-send="true" \
href="http://mail-yk0-f175.google.com/" \
class="">mail-yk0-f175.google.com</a>[209.85.160.175]:
550 5.1.1 <<a moz-do-not-send="true" \
href="mailto:station.manager@quantum-radio.net" \
class="">station.manager@quantum-radio.net</a>>:
Recipient address rejected: User unknown in virtual
mailbox table; from=<<a moz-do-not-send="true" \
href="mailto:racuk12@gmail.com" class="">racuk12@gmail.com</a>>
to=<<a moz-do-not-send="true" \
href="mailto:station.manager@quantum-radio.net" \
class="">station.manager@quantum-radio.net</a>>
proto=ESMTP helo=<<a moz-do-not-send="true" \
href="http://mail-yk0-f175.google.com/" \
class="">mail-yk0-f175.google.com</a>></div> </div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class=""><br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class="">If this is not the appropriate
mailing list for this type of question, can someone
please point me at a list that is? </div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class="">thanks</div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class="">Robert</div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class=""><br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class=""><br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family:
Menlo;" class="">
<div style="margin: 0px;" class=""><b class="">robert$
postconf -n</b><br class="">
[...]<br class="">
</div>
virtual_mailbox_maps =
mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf<br class="">
[...]<br class="">
</div>
</blockquote>
<br class="">
What's the content of
/etc/postfix/mysql-virtual-mailbox-maps.cf? For a given
e-mail address, it should return the path where the
virtual user's inbox is. For example:<br class="">
<br class="">
user = db_username<br class="">
password = db_password<br class="">
dbname = db_name<br class="">
query = SELECT CONCAT(SUBSTRING_INDEX(email, '@', \
-1), '/', SUBSTRING_INDEX(email, '@', 1), '/') FROM users WHERE
email = '%s'<br class="">
hosts = 127.0.0.1<br class="">
<br class="">
The query field assumes that an e-mail address like <a \
moz-do-not-send="true" class="moz-txt-link-abbreviated" \
href="mailto:station.manager@quantum-radio.net">station.manager@quantum-radio.net</a> \
will be passed as %s. In the case above, it's assumed that paths are always \
domain/username/ like, so following the
example, <a moz-do-not-send="true" \
href="http://quantum-radio.net/station.manager/" \
class="">quantum-radio.net/station.manager/</a> would be returned.<br class="">
<br class="">
This path is relative to the virtual_mailbox_base
parameter, which by the way you don't seem to have
defined. If your virtual mailboxes are located under
/home/virtual, set virtual_mailbox_base to this value so
the user mailbox's path would be returned as
/home/virtual/<a moz-do-not-send="true" \
href="http://quantum-radio.net/station.manager/" \
class="">quantum-radio.net/station.manager/</a>.<br class=""> <br class="">
Regards,<br class="">
<br class="">
Nicolás<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</blockquote>
<br class="">
</div>
</div></blockquote></div><br class=""></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic