@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.mas...@quantum-radio.net <mailto:station.mas...@quantum-radio.net> | xxxxxxx +----+-----------+---------------+---------------------------------------+ 11 rows in set (0.00 sec) > On 29 Apr 2015, at 21:08, Nicolás <nico...@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.mana...@quantum-radio.net >> <mailto:station.mana...@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.mana...@quantum-radio.net >> <mailto:station.mana...@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 <nico...@devels.es >>> <mailto:nico...@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.mana...@quantum-radio.net >>>> <mailto:station.mana...@quantum-radio.net>>: Recipient address rejected: >>>> User unknown in virtual mailbox table; from=<racu...@gmail.com >>>> <mailto:racu...@gmail.com>> to=<station.mana...@quantum-radio.net >>>> <mailto:station.mana...@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.mana...@quantum-radio.net >>> <mailto:station.mana...@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 >> >