OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: MYSQL virtual setup

From: mouss (mlist.onlyfree.fr)
Date: Wed Jan 02 2008 - 14:49:01 CST


Markus Edholm wrote:
> Wietse Venema wrote:
>> Markus Edholm:
>> [ Charset ISO-8859-1 unsupported, converting... ]
>>> Hi List
>>>
>>> I?m feeling quite puzzled
>>>
>>> I have an "ordinary" mailserver that I now extended with an mysql table for
>>> virtual mail forwarding.
>>>
>>> but I dont understand following error from mail.log:
>>>
>>> Jan 1 15:52:23 postfix postfix/trivial-rewrite[22495]: warning: do not list
>>> domain orebro.example.net in BOTH virtual_mailbox_domains and relay_domains
>> ...
>>> relay_domains = example.net
>>> virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
>> What is the output of:
>>
>> $ postmap -q orebro.example.net \
>> mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
>>
>> The output should be: "not found".
>>
>> Wietse
>
> Hi!
>
> No
>
> #!/bin/bash
> postmap -q orebro.example.net mysql:/etc/postfix/mysql_virtual_domains_maps.cf \
> || echo not found
>
> output:
> Örebro lokalavdelning
>

so orebro.example.net is a virtual_mailbox_domains and relay_domains
(the latter is probably because of parent_domain_matches_subdomains).

if this is a virtual mailbox domain, then adjust
parent_domain_matches_subdomains.

> So it replys with description field from mysql

if it replies, then it is a virtual mailbox domain. make sure not any
domain is a virtual mailbox one.

>
> (I take as you wanted me to run it as bash script)
> from prompt I got:
>
> /etc/postfix# $ postmap -q orebro.example.net \
> mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found
> -bash: $: command not found
> not found

remove the '$' and try again (the '$' was meant as the prompt). run the
following command:

postmap -q orebro.example.net \
   mysql:/etc/postfix/mysql_virtual_domains_maps.cf || echo not found

but it's the same as from a shell script.

>
>
> Hmm, My file:
> /etc/postfix# cat mysql_virtual_domains_maps.cf
> user = postfixadmin
> password = xxxxxxx
> hosts = localhost
> dbname = postfix
> query = SELECT description FROM domain WHERE domain='%s' AND active = '1'
>
> I have used several different "howtos" maby I made some misstake and using wrong
> files?
>
> /Markus
>