Fri, 05 Apr 2013 08:49:39 -0400 skrev Brian Evans
<grkni...@scent-team.com>:

> > Thank you for the link, it was very informative, but didn't solve
> > the problem. I also tried making a virtual_mailbox_maps MySQL query
> > that always returned false, but Postfix still accepted all mail,
> > and then bounced it after Dovecot rejected it.
> 
> You say you return "false"?
> Postfix expects to receive no results (a.k.a. 0 rows) if a 
> virtual_mailbox_maps address in mysql does not exist.
> Do not return "false", empty string, null, or any other value if it
> does not exist.

False may be the wrong word, and I'm sorry if it is. What I mean is,
virtual_mailbox_maps always returns nothing from MySQL, like so:

titanus@ntdata:/etc/postfix$ sudo postmap -q t...@nt-backup.dk
mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
titanus@ntdata:/etc/postfix$ echo $?
1
   (this user exists)

titanus@ntdata:/etc/postfix$ sudo postmap -q non_exist...@nt-backup.dk
mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
titanus@ntdata:/etc/postfix$ echo $?
1
   (this user does not)

I did this because I had some trouble constructing the query-string
Wietse recommended, and thought this would be a simple and easy way to
test if virtual_mailbox_maps was the problem.

When trying the syntax within the MySQL CLI, a "Empty set" is returned
when querying for a non-existent user

mysql> SELECT username FROM mailbox
    -> WHERE username = 'non_exist...@nt-backup.dk';
Empty set (0.00 sec)


I hope this better explains what I meant
Cheers

Reply via email to