chantal | 14 May 15:28

Re: relay_recipient_maps doens't work


Quoting mouss <mouss <at> netoyen.net>:

> chantal <at> antenna.nl wrote:
>> Hi list,
>>
>> I want to use relay_recipient_maps on a postfix 2.5.1 relay server   
>>  but it doens't appear to be doing anything. I want to accept mail   
>>  for existing users only but it accepts mail for all users.
>>
>> this is postconf -n
>>
>> append_at_myorigin = no
>> append_dot_mydomain = no
>> biff = no
>> config_directory = /etc/postfix
>> content_filter = smtp-amavis:[127.0.0.1]:10024
>> inet_interfaces = all
>> local_recipient_maps =
>> mailbox_size_limit = 0
>> message_size_limit = 25000000
>> mydestination =
>> myhostname = server.domain.com
>> mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
>> myorigin = domain.com
>> readme_directory = no
>> recipient_delimiter = +
>> relay_domains = mysql:$config_directory/mysql_relay_domains_maps.cf
>> relay_recipient_maps = mysql:$config_directory/mysql_relay_maps.cf
>> smtp_host_lookup = native,dns
>> smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
>> transport_maps = mysql:$config_directory/mysql_transport_maps.cf
>> unknown_address_reject_code = 450
>> unknown_local_recipient_reject_code = 450
>> virtual_alias_maps = mysql:$config_directory/mysql_virtual_alias_maps.cf
>>
>> this is mysql_relay_maps.cf
>>
>> user = username
>> password = secret
>> dbname = database
>> hosts = maildb
>> query = SELECT user_name FROM database WHERE user_name='%s'
>>
>>
>> the mysql connection works (or else mail would not be delivered at all)
>>
>>
>>
>>
>
> chose an address that does not exist in your relay recipient maps,
> let's say foo <at> example.com (of course, example.com must be a relay
> domain) and post the results of the following three commands.
>
> # postmap -q example.com mysql:mysql_relay_domains_maps.cf
> # postmap -q foo <at> example.com mysql:mysql_relay_maps.cf
> # postmap -q foo <at> example.com mysql_virtual_alias_maps.cf
>
> Also show transaction logs.

Hi, I get the following result

root <at> servername:/etc/postfix# postmap -q example.com
mysql:mysql_relay_domains_maps.cf
postmap: fatal: bad string length 0 < 1: mysql_relay_domains_maps.cf_dbname =

root <at> servername:/etc/postfix# postmap -q foo <at> example.com
mysql:mysql_relay_maps.cf
postmap: fatal: bad string length 0 < 1: mysql_relay_maps.cf_dbname =

root <at> servername:/etc/postfix# postmap -q foo <at> example.com
mysql_virtual_alias_maps.cf

logfiles:

May 14 15:34:48 servername postfix/postmap[487]: fatal: bad string
length 0 < 1: mysql_relay_domains_maps.cf_dbname =
May 14 15:35:20 servername postfix/postmap[488]: fatal: bad string
length 0 < 1: mysql_relay_maps.cf_dbname =
May 14 15:37:52 servername postfix/postmap[490]: fatal: bad string
length 0 < 1: mysql_relay_domains_maps.cf_dbname =
May 14 15:37:53 servername postfix/postmap[491]: fatal: bad string
length 0 < 1: mysql_relay_maps.cf_dbname =

----- End forwarded message -----


Gmane