AW: [Exim] Mysql and Cyrus integration

Pàgina inicial
Delete this message
Reply to this message
Autor: Sebastian Lemke
Data:  
A: 'Odhiambo Washington'
CC: exim-users
Assumpte: AW: [Exim] Mysql and Cyrus integration
Hi again :-)

>> Now I have installed EXIM and it delivers the mail correctly into the


>> Cyrus Mailboxes - but I do not know, if the solution I choose the

best
>> way to do it.
>>
>> At first I have done the routing:
>>
>> virtual_mysql:
>>     driver = redirect
>>     allow_fail
>>     allow_defer
>>     data = ${lookup mysql{ SELECT cyrmbox FROM emails \
>>         WHERE email='${local_part}@${domain}' }}
>>     file_transport = address_file
>>     pipe_transport = address_pipe
>>     reply_transport = address_reply

>>
>> The result of the query is the mailbox-name of cyrus for this user.
>>
>> Then I have done the following:
>>
>> virtual_mysql_accept:
>>     driver = accept
>>     condition = ${lookup mysql{ SELECT cyrmbox FROM emails \
>>         WHERE cyrmbox='${local_part}' }}
>>     transport = local_delivery_cyrus

>
>You have not shown us this transport called local_delivery_cyrus. It

does Maildir delivery, yes?

Sorry - I forgot it.
It does pipe-d delivery:

local_delivery_cyrus:
    driver = pipe
    command = /usr/cyrus/bin/deliver \
              -m ${substr_1:$local_part_suffix} -- $local_part
    user = cyrus
    group = mail
    return_output
    log_output
    message_prefix =
    message_suffix =


>> Is it the correct way to handle this ? First a "redirect" to the
>> cyrus-mailboxname then an accept if the mailbox exists ?


>I personally don't understand your situation. If the first router uses

some aliasing, then I believe yes, because you process aliases before
local mailboxes.

Cyrus needs not the emailadress like
user@???
It needs the mailboxname of the user - in my case it would be
u0034
for example.

>> Between them I have this for handling unknown users:
>> # for handling 'unknown-user@???'
>> virtual_mysql2:
>>     driver = redirect
>>     allow_fail
>>     allow_defer
>>     data = ${lookup mysql{ SELECT cyrmbox FROM emails \
>>         WHERE email='*@${domain}' }}
>>     file_transport = address_file
>>     pipe_transport = address_pipe
>>     reply_transport = address_reply

>>
>> In the Database is an entry with
>> *@testdomain.tld        my.user.box.name

>>
>> It is not the way described above - is this correct ?


> Well, test that out with a nonexistent mailbox:
> exim -d -bt nonexistent@???
> Exim will tell you what it thinks ;-)


And I run into trouble.

In the beginning my email to "user@???" will be 'redirected' to
u0034. So far so fine (I hope, it is the correct way to handle emails,
but I believe :-).
In the second run, - it was a redirect - the Database will be asked for
*@domain1.com and answers with another account. But this is not what I
want. I want this only if the user does not exist, but user@???
exists in my system.

Sorry for so many asking, but I am very new to exim. After this day I
understand the basic principles and even quering the database from exim
but not the details :-(.

> I believe I run into trouble, when the delivery fails; the address is
> already re-written an so the bounced mail gets an incorrect sender
> (?).


re-written by what??

"Re-written" ist not exactly what I mean, sorry. Because of the
"redirect" in virtual_mysql: the username is now u0034. What happens if
a mail get bounced after this ?

Sebastian