Re: [Exim] Exim_MySQL problem

Etusivu
Poista viesti
Vastaa
Lähettäjä: Patrick Boutilier
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [Exim] Exim_MySQL problem
George,

Does the following work from the command line?

mysql mail -u exim -peximpass




George wrote:
> I still have a problem with Exim and MySQL. My config works on other systems
> very well (for example on FreBSD), but on RedHat Linux7.2
> I have a problem when Exim tries to connect to MySQL database. This is my
> config file:
>
> ****************************************************************************
> **************************
> MYSQL_AUTHSERVER=localhost
> MYSQL_AUTHPORT=3306
> MYSQL_AUTHDB=mail
> MYSQL_AUTHTABLE=auth
> MYSQL_AUTHUSER=exim
> MYSQL_AUTHPASSWORD=exim_pass
> MYSQL_USERNAMEFIELD=username
> MYSQL_DOMAINFIELD=domain
> MYSQL_ALIASFIELD=alias
> MYSQL_ISALIASFIELD=is_alias
> RELAY_TIMEOUT=5 MINUTE
> MYSQL_ALIAS = SELECT MYSQL_ALIASFIELD FROM MYSQL_AUTHTABLE WHERE
> MYSQL_DOMAINFIELD LIKE '${quote_mysql:$domain}' AND MYSQL_USERNAMEFIELD LIKE
> '${quote_mysql:$local_part}' AND MYSQL_ISALIASFIELD='yes'
> MYSQL_ALL_ALIAS = SELECT MYSQL_ALIASFIELD FROM MYSQL_AUTHTABLE WHERE
> MYSQL_DOMAINFIELD='${quote_mysql:$domain}' AND MYSQL_USERNAMEFIELD='@' AND
> MYSQL_ISALIASFIELD='yes'
> MYSQL_USER = SELECT DISTINCT MYSQL_DOMAINFIELD FROM MYSQL_AUTHTABLE WHERE
> MYSQL_DOMAINFIELD LIKE '${quote_mysql:$domain}' AND MYSQL_USERNAMEFIELD LIKE
> '${quote_mysql:$local_part}' AND MYSQL_ISALIASFIELD='no'
> MYSQL_DOMAIN = SELECT DISTINCT MYSQL_DOMAINFIELD FROM MYSQL_AUTHTABLE WHERE
> MYSQL_DOMAINFIELD='$key'
> MYSQL_RELAY = SELECT ip FROM relay_ip WHERE ip="${sender_host_address}" AND
> DATE_SUB(NOW(), INTERVAL RELAY_TIMEOUT) < ts
> mysql_servers =
> "MYSQL_AUTHSERVER::MYSQL_AUTHPORT/MYSQL_AUTHDB/MYSQL_AUTHUSER/MYSQL_AUTHPASS
> WORD"
> LOCAL_DOMAINS = localhost
> local_domains = LOCAL_DOMAINS:mysql;MYSQL_DOMAIN
> forbid_domain_literals
> never_users = root
> host_accept_relay = localhost:mysql;MYSQL_RELAY
> host_lookup = 0.0.0.0/0
> receiver_verify
> sender_verify
> timeout_frozen_after = 7d
> remote_smtp:
> driver = smtp
> virtual_delivery:
> driver = appendfile
> file = /usr/local/exim/var/spool/mail/${domain}/${local_part}
> user = exim
> group = mail
> mode = 0660
> virtual_local_user:
> domains = ${lookup mysql {MYSQL_USER}{$value}}
> driver = smartuser
> transport = virtual_delivery
> virtual_aliases:
> driver = aliasfile
> search_type = mysql
> query = MYSQL_ALIAS
> include_domain = true
> virtual_all_alias:
> driver = aliasfile
> search_type = mysql
> query = MYSQL_ALL_ALIAS
> include_domain = true
>
> lookuphost:
> driver = lookuphost
> transport = remote_smtp
>
> * * F,2h,15m; G,16h,1h,1.5; F,4d,8h
> ****************************************************************************
> **************************
>
> When I go to test Exim by telnet I get this error message:
>
> ****************************************************************************
> **************************
>     [george@mixanorganosi george]$ telnet localhost 25
>     Trying 127.0.0.1...
>     Connected to localhost.
>     Escape character is '^]'.
>     220 Welcome to mail server of Mixanorganosi Pellas ! ESMTP Sun, 07 Jul
> 2002 18:09:36 +0300
>     helo a
>     250 mixanorganosi.gr Hello webserver1 [127.0.0.1]
>     mail from: a@???
>     250 <a@???> is syntactically correct
>     rcpt to: dexen@???      (any address)
>     451 temporary local failure; please try later
> ****************************************************************************
> **************************

>
> I have checked the Exim's work in debugging mode and got next:
>
> ****************************************************************************
> **************************
>     [root@mixanorganosi sbin]# /usr/local/exim/bin/exim -bv -d9
>     Exim version 3.36 debug level 9 uid=0 gid=0
>     Berkeley DB: Sleepycat Software: Berkeley DB 3.2.9: (January 24, 2001)
>     Caller is an admin user
>     Caller is a trusted user
>     originator: uid=0 gid=0 login=root name=root
>     sender address = root@???
>     Verifying: uid=0 gid=0 euid=111 egid=12
>     > george@???
>     >>>>>>>>>>>>>>>>>>>>>>>>
>     Verifying george@???
>     search_open: mysql "NULL"
>     search_find: file="NULL"
>     key="SELECT DISTINCT domain FROM auth WHERE domain='mixanorganosi.gr'"
> partial=-1
>     LRU list:
>     internal_search_find: file="NULL"
>     type=mysql key="SELECT DISTINCT domain FROM auth WHERE
> domain='mixanorganosi.gr'"
>     database lookup required for SELECT DISTINCT domain FROM auth WHERE
> domain='mixanorganosi.gr'
>     MYSQL query: SELECT DISTINCT domain FROM auth WHERE
> domain='mixanorganosi.gr'
>     MYSQL new connection: host=localhost port=3306 database=mail user=exim
> password=<exim_password>
>     MYSQL connection failed: Can't connect to local MySQL server through
> socket '/var/lib/mysql/mysql.sock' (13)
>     lookup deferred
>     mixanorganosi.gr in local_domains? lookup deferred
>     george@??? cannot be resolved at this time:
>     local_domains lookup deferred
> ****************************************************************************
> **************************

>
> ....but when I connect to MySQL "manually":
>
>                 > mysql -u exim -peximpass

>
> ...I have no problem !!!! The connection is passed !!!
> Where is a problem ? What can I do to fix it ? By the way, without MySQL
> "part" in configuration file, Exim works well !!!
>
>
>
>
> --
>
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>