[Exim] mysql selective relay

Top Page
Delete this message
Reply to this message
Author: Erik Jacobs
Date:  
To: exim-users
Subject: [Exim] mysql selective relay
OK... here I am again... woo!

More questions --
I'm looking at the syntax for the lookup command... trying to figure some
things out.
Now, based on the fact that I want to check against the database to see if a
certain sender/recipient pair exists and, if not, route the mail to a
blackhole:

SQL_lookup:
router = redirect
data = ${lookup mysql{MYSQL_GRABMAIL}{$value}:blackhole:}

Will this assign the data to :blackhole: if there is no result for the MySQL
query?

Also, is it possible I'm just running in circles here? There is a transport
method called "autoreply". You can use SQL lookups in setting of the
different headers (to, from, text, etc).

So couldn't I, in theory, send every single message that comes into Exim to
an autoreply transport that looks like:

Process_Everything:
driver = autoreply
to = *some kind of SQL lookup that returns either the acceptible new to
address or /dev/null?*
reply_to = some other SQL lookup
subject = is there an expansion variable with the subject?
text = $message_body

This way, the to address is going to be null in the case where the lookup
returns nothing, or the proper forwarding address if the lookup is
successful. The reply_to can be determined from another lookup, text is
just the existing message body, and the subject (hopefully) can also be
pulled from the incoming message. If the to address becomes null, it
doesn't matter what the other fields are, the message is just dying anyway.

Thanks,
Erik