=================================== Email Forwards in MySQL forwarding router - which even supports multiple addresses (so an addy can forward out to more than one final recipient): virtual_user_fwd: driver = redirect verify = no check_ancestor = yes hide_child_in_errmsg = yes domains = +domain_virtual data = ${lookup mysql{SELECT fwd FROM userforward WHERE host = '${quote_mysql:$domain}' AND user = '${quote_mysql:$local_part}' AND fwd IS NOT NULL} {${sg{$value}{\\n}{, }}}} Not sure if you want hide_child_in_errmsg - I was just testing that out... It hides the final recipients if a bounceback is generated (try with it on/off to see the difference). =================================== SMTP auth, MySQL & passwords MYSQL_AUTH_CRAM = SELECT MYSQL_SMTPAUTH_PASS_FIELD from MYSQL_SMTPAUTH_TABLE where MYSQL_SMTPAUTH_USER_FIELD = '${quote _mysql:$1}' AND MYSQL_SMTPAUTH_PASS_FIELD != '' cram: driver = cram_md5 public_name = CRAM-MD5 server_secret = ${lookup mysql {MYSQL_AUTH_CRAM}} server_set_id = $1 -------------------------- mysql_cram: driver = cram_md5 public_name = CRAM-MD5 server_secret = ${lookup mysql{SELECT password FROM users \ WHERE user = '${quote_mysql:$1}'} {$value} fail} server_set_id=$1 -------------------------- domainlist local_domains = \ ${lookup mysql {SELECT domain FROM domains \ WHERE type="local" and domain="${domain}" }} # Never do _local_ delivery to these users. never_users = root # Name lookups host_lookup = * rfc1413_hosts = * rfc1413_query_timeout = 30s mysql> select * from domains ; domain type +-------------------+--------+ |mydomain.com | local | +-------------------+--------+ =================================== >Is it possible to make just a query and then instruct exim to get the >data from the yielded row ? for ACLs you could do: set acl_m0 = ${lookup mysql {select f1,f2,f3 from table where f4='x'}} and ${extract {f1}{$acl_m0}} will return the data of the first field. In routers you can use address_data to do the same thing. Check: http://www.exim.org/exim-html-4.30/doc/html/spec_11.html#IX784 and http://www.exim.org/exim-html-4.30/doc/html/spec_9.html#SECT9.17 =================================== domainlist blocked_domains = mysql;select 1 from blockeddomains where \ domain = '${quote_mysql:$sender_domain}' =================================== block by IP block list in a MySQL database. We reject at RCPT time, with a message which is mostly a URL to a web page which gives the other end a chance to request exemption (which of course some annoying mail programs will refuse to show the sender). The database has a column for "network" (meaning /24) and for host...if host is NULL the whole subnet is blocked, else just the specified IP. This rule is in the SMTP time ACL (ie, once per connection): warn hosts = +rbl_hosts : !127.0.0.0/8 : !+local_networks : !+relay_from_hosts condition = ${if ! match {$sender_host_name}{\Nmx\.aol\.com$\N}{yes}{no}} condition = ${lookup mysql{select id \ from blocklist \ where network=SUBSTRING_INDEX('$sender_host_address', '.', 3) \ and (host=SUBSTRING_INDEX('$sender_host_address', '.', -1) or \ host is NULL) \ limit 1 \ }{yes}{no}} set acl_c1 = blocklist Later at RCPT time, if an exemption mechanism hasn't changed acl_c1, we find deny condition = ${if eq {$acl_c1}{blocklist}{yes}{no}} message = rejected see http://www.olympus.net/local/$sender_host_address