[Exim] Exim, MySQL and virtual domains

Pàgina inicial
Delete this message
Reply to this message
Autor: Andre Docena Correa
Data:  
A: exim-users
Assumpte: [Exim] Exim, MySQL and virtual domains
Hi Exim users, I am trying to setup Exim as my SMTP for virtual
domains, but I have a few doubts and maybe somebody can help me... I
am using exim-4.10...

I am using a MySQL database for user verification and domain
validation. My exim.conf is like this:

domainlist  local_domains = localhost:mysql;SELECT domain FROM domains
            where type = 'local'
domainlist relay_to_domains = mysql;SELECT domain from domains
hostlist relay_from_hosts = 127.0.0.1


My goal is to allow relay from any host, but just to e-mails that have
"to" or "from" listed in domains list...

then I have this router:

# MySQL Users Router
mysql_users:
        driver = accept
        condition = \
                ${if eq {} \
                {${lookup mysql {select maildir from users \
                where username = '${local_part}@${domain}' \
                and block = '0'}}} \
                {no}{yes}}
        retry_use_local_part
        transport = mysql_delivery


and this transport:

# Transport for MySQL
mysql_delivery:
        driver = appendfile
        maildir_format
        directory = \
                ${lookup mysql{select maildir from users \
                where username = '${local_part}@${domain}'}}
        user = xxx
        group = yyy


I keep getting:

rejected RCPT teste@???: Sender verify failed

in my logs. My Router and Transport looks good, and I already used
then in other scenarios.

Looking the web and list archives, I've found some people doing it
different ways. But couldn't make it work the way I need.

Can I make Exim allow e-mail from anywhere, checking if "to" or
"from" domains are listed in a MySQL table? I don't want to restrict
relays to relay_from_hosts.

Is there anybody who can help me with this? Are there any examples?

tks for your attention and time...

Andre Docena Correa
andre.correa@???