[Exim] I can't get MYSQL to work with Exim 4.05

Etusivu
Poista viesti
Vastaa
Lähettäjä: Flemming Christensen
Päiväys:  
Vastaanottaja: Exim-Users (E-mail)
Aihe: [Exim] I can't get MYSQL to work with Exim 4.05
This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I have searched google .. read the FAQ's and the archives and I still can't figure out how to use mysql with exim.



This is what I have done:



Compiled exim with mysql support



Created a mysql database:

Mysql database:exim

Mysql table: user (fields: userid, user, mailaddress, mailboxpath, homedir, domain, localonly) mailaddress = user@domain

                     domain (field: domain)




userid is the localuser account

user is the users initials



This is what I need to do:



1. If a localonly user from a virtual domain tries to send to nonlocal users the mail should bounce other users should be able to send to nonlocal users

2. mail to nonexisient users should bounce

3. mail to virtual users should be delivered to mailboxpath



This is what I have tried:



configure script:



... snip



mysql_servers = localhost/exim/user/root/password



mysql_domain = select domain from user where mailaddress='${quote_mysql:$local_part@$domain}'

mysql_mailbox = select domain from user where mailaddress='${quote_mysql:$local_part@$domain}'

mysql_user = select userid from user where mailaddress='${quote_mysql:$local_part@$domain}'



.. snip



begin routers



.. snip



virtual_local_user:

driver = accept

domains = ${lookup mysql {mysql_domain}{$vaule}}

condition = ${lookup mysql {mysql_user}{$vaule}}

transport = virtual_delivery



localuser:

driver = accept

check_local_user

transport = local_delivery



begin transports



.. snip



virtual_delivery:

driver = appendfile

file = ${lookup mysql {mysql_mailbox}{$value}}

delivery_date_add

envelope_add

return_path_add

user = mail

group = mail

create_directory



.. snip



-- EOF



When I try to test the setup with



---

>exim -v postmaster@??? -d 2> debug.log


From: postmaster@???

To: post@???

Subject: test



test

^D



------



I get this in the debug.log file:



LOG: MAIN

<= root @local.domain <mailto:root@local.domain> U=root P=local S=280

LOG: MAIN PANIC

failed to expand "${lookup mysql {select domain from user where mailaddress='${quote_mysql:$local_part@$domain}'}{$vaule}}" while checking a list: lookup of "select domain from user where mailadress = '-d@???'" gave DEFER: unexpected slash in MySQL server hostname: localhost/exim



.. snip



Well .. I'm starting to PANIC as well ;-)



I would be nice if someone could write a tutorial for us newbies on how to make MySQL work with exim.



Cheers,



Flemming



--