[exim] closed list router

Pàgina inicial
Delete this message
Reply to this message
Autor: Jim Pazarena
Data:  
A: exim-users
Assumpte: [exim] closed list router
I would like to create a router, which for a given email address
accesses a mysql database to see if the "sender" is permitted
to send to it. The exim 4 book on page 78 hints towards how to do
this.

I could put the recipients (only 2 at this time) in a flat ascii file.
and "if" the router determine the recipient is one of them, it could
look at the mysql table to validate the sender.

It would be easy for me to place all the acceptable senders into
a mysql table which has the title of the recipient. Unfortunately
I'm unsure how to code a router for mysql access.

I will have a flat ascii file called: closed_list.txt
     with the contents:   name1@domain1
                          name2@domain2
a mysql database titled closed_list
and a mysql table of name1@domain1
         with a list of acceptable poster's email addresses
and a second mysql table of name2@domain2
         with a list of acceptable poster's email addresses


I know about giving a man a fish compared to teaching a man to fish,
but I haven't a clue how to code this, and rather than spend hours
researching it, I was hoping someone could throw an example my way.

I am kinda guessing:

closed_list:
    condition = 
${lookup{$local_part@$domain}lsearch{ETCDIR/closed_list.txt}{yes}{no}}
    senders = ${lookup mysql { select
                       ... I'm lost here as to mysql syntax ...
    verification at this point needs to let the email pass on to the
    actual router which will deliver the email. (it expands).


  closed_reject:
    condition = 
${lookup{$local_part@$domain}lsearch{ETCDIR/closed_list.txt}{yes}{no}}
    allow_fail
    data = :fail: $local_part@$domain is a closed mailing list




any help would be greatly appreciated!

TIA
Jim