I changed the line hosts = server-1.example.com to use an IP address
instead hosts = 192.168.1.200 and everything started working. Does
anyone know what I am missing in that it seems postfix did resolve the
IP address when communicating with the mysql database?
On 06/13/2016 07:52 PM, Paul R. Ganci wrote:
I have setup a mysql data baseto provide a list of of local email
recipients for a gateway email server. The configuration file looks
like this:
> cat /etc/postfix/local_recipient_map.cf
user = postfix
password = Secret
hosts = server-1.example.com
dbname = postfix
query = SELECT destination FROM postfix_virtual WHERE email = '%s'
If I do a test query ala:
> postmap -q sa...@example.com mysql:/etc/postfix/local_recipient_map.cf
sallysemail
This last command seems to indicate that the query completes
successfully. So I then configured the main.cf per this extracted stanza:
# REJECTING MAIL FOR UNKNOWN LOCAL USERS
#
# The local_recipient_maps parameter specifies optional lookup tables
# with all names or addresses of users that are local with respect
# to $mydestination, $inet_interfaces or $proxy_interfaces.
#
# If this parameter is defined, then the SMTP server will reject
# mail for unknown local users. This parameter is defined by default.
#
# To turn off local recipient checking in the SMTP server, specify
# local_recipient_maps = (i.e. empty).
#
# The default setting assumes that you use the default Postfix local
# delivery agent for local delivery. You need to update the
# local_recipient_maps setting if:
#
# - You define $mydestination domain recipients in files other than
# /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
# For example, you define $mydestination domain recipients in
# the $virtual_mailbox_maps files.
#
# - You redefine the local delivery agent in master.cf.
#
# - You redefine the "local_transport" setting in main.cf.
#
# - You use the "luser_relay", "mailbox_transport", or
"fallback_transport"
# feature of the Postfix local delivery agent (see local(8)).
#
# Details are described in the LOCAL_RECIPIENT_README file.
#
# Beware: if the Postfix SMTP server runs chrooted, you probably have
# to access the passwd file via the proxymap service, in order to
# overcome chroot restrictions. The alternative, having a copy of
# the system passwd file in the chroot jail is just not practical.
#
# The right-hand side of the lookup tables is conveniently ignored.
# In the left-hand side, specify a bare username, an @domain.tld
# wild-card, or specify a u...@domain.tld address.
#
#local_recipient_maps = unix:passwd.byname $alias_maps
#local_recipient_maps = proxy:unix:passwd.byname $alias_maps
#local_recipient_maps =
#local_recipient_maps =
local_recipient_maps = mysql:/etc/postfix/local_recipient_map.cf
However after I issue
>postfix reload
I get the following warning in the /var/log/maillog file:
Jun 13 17:02:33 mx02 postfix/smtpd[24400]: warning:
mysql:/etc/postfix/local_recipient_map.cf lookup error for
"sa...@example.com"
Jun 13 17:02:33 mx02 postfix/smtpd[24400]: NOQUEUE: reject: RCPT from
unknown[50.31.61.193]: 451 4.3.0 <sa...@example.com>: Temporary lookup
failure;
from=<bounces+1955696-a7dd-sally=examples....@em2.imodules.com>
to=<sa...@example.com> proto=ESMTP helo=<o10.em.imodules.com>
Can somebody tell me what I am doing wrong? Why does the postmap -q
command line query successfully return a result but fail from postfix?
Thank you for your help.
--
Paul (ga...@nurdog.com)
Cell: (303)257-5208