Re: [exim] Using Full Email Address for Cyrus LMTP Deliver

Pàgina inicial
Delete this message
Reply to this message
Autor: Mark Nipper
Data:  
A: Andre Nicholson
CC: exim-users
Assumpte: Re: [exim] Using Full Email Address for Cyrus LMTP Deliver
On 10 Aug 2005, Andre Nicholson wrote:
> I have a dilemma that I don't know how to solve involving Cyrus IMAP and
> delivering to LMTP. I've tried Googling and searching the archives but
> nothing.
>
> I have unixhierarchysep set to 'yes' for Cyrus, which means that
> accounts are 'username@???'.
>
> I'd like to transition Exim to deliver to LMTP as opposed to calling
> Cyrus's deliver command manually like I'm doing now. The problem that
> I'm having is that the '@' character (at sign) must be escaped in order
> for LMTP to accept it.
>
> $ telnet localhost lmtp
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> 220 neo-anime.org LMTP Cyrus v2.2.12 ready
> LHLO marge.neo-anime.com
> 250-neo-anime.org
> 250-8BITMIME
> 250-ENHANCEDSTATUSCODES
> 250-PIPELINING
> 250-SIZE
> 250-AUTH EXTERNAL
> 250 IGNOREQUOTA
> MAIL FROM:<andre@???>
> 250 2.1.0 ok
> RCPT TO:<webmaster@???>
> 550-Mailbox unknown. Either there is no mailbox associated with this
> 550-name or you do not have authorization to see it.
> 550 5.1.1 User unknown
> RCPT TO:<webmaster\@neo-anime.org>
> 250 2.1.5 ok
>
> Here are the relevant routers and transport I'm trying:
>
> begin routers
>
>     escape_at_sign:
>         driver          = redirect
>         redirect_router = cyrus_router
>         domains         = +local_domains
>         data            = $local_part\\@$domain

>
>     cyrus_router:
>         driver    = accept
>         domains   = +local_domains
>         transport = cyrus_delivery

>
> begin transports
>
>     cyrus_lmtp_delivery:
>         driver                = smtp
>         rcpt_include_affixes  = true
>         gethostbyname         = true
>         transport_filter      = /usr/bin/tr -d \\000
>         protocol              = lmtp
>         hosts                 = localhost
>         allow_localhost

>
> What happens however is that Exim alters the sender address to append
> $primary_hostname. In my above LMTP session, the sender address at the
> cyrus_transport router ends up being
> <webmaster\@neo-anime.org@???> and fails.
>
> I hope I'm not being too confusing and I've made some kind of sense in
> this. Has anyone encountered this sort of setup before and have a
> solution? Is there a way to escape the '@' character for LMTP delivery?
>
> Thanks for any help.


    As no one else is replying to this (and I was really
hoping that someone would as I think my way of doing things with
Cyrus is fairly much a hack), here's how I do Cyrus with Exim
(and handle the escaping of the @).


    I'll just paste the relevant parts of my config here:
---
domainlist local_domains = @ : dsearch;/etc/exim4/domains


begin routers

cyrus_aliases:
driver = redirect
domains = dsearch;/etc/exim4/domains
data = ${lookup{$local_part}lsearch*{/etc/exim4/domains/$domain}}
user = Debian-exim
group = Debian-exim
file_transport = address_file
pipe_transport = address_pipe

localuser:
driver = accept
transport = local_delivery
cannot_route_message = Unknown user

begin transports

local_delivery:
driver = lmtp
socket = /var/run/cyrus/socket/lmtp
batch_max = 50
user = cyrus
---

with some other things left out of course (let me know if you
have questions on the rest). I can just send you my full config
if need be.

    Insides of /etc/exim4/domains (it is a directory), I have
one text file for each mail domain I want to handle.  Each file
is basically the same as /etc/aliases (or /etc/mail/aliases) and
looks something like this (this is
/etc/exim4/domains/bitgnome.net for what it's worth):
---
nipsy: nipsy\@bitgnome.net
bzflag: nipsy@???


abuse: nipsy@???
postmaster: nipsy@???
mailer-daemon: nipsy@???
---

so that a real, physical Cyrus account will have the e-mail
address with the @ escaped by a backslash and any virtual or
aliased addresses will point to that same address but without the
backslash.

    Let me know if that doesn't make sense.  I'll be glad to
help if I can!  :)


-- 
Mark Nipper                                                e-contacts:
4475 Carter Creek Parkway                           nipsy@???
Apartment 724                               http://nipsy.bitgnome.net/
Bryan, Texas, 77802-4481           AIM/Yahoo: texasnipsy ICQ: 66971617
(979)575-3193                                      MSN: nipsy@???


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GG/IT d- s++:+ a- C++$ UBL++++$ P--->+++ L+++$ !E---
W++(--) N+ o K++ w(---) O++ M V(--) PS+++(+) PE(--)
Y+ PGP t+ 5 X R tv b+++@ DI+(++) D+ G e h r++ y+(**)
------END GEEK CODE BLOCK------

---begin random quote of the moment---
"My name is Maximus Decimus Meridius, commander of the armies of
the North, general of the Felix Legions, loyal servant to the
true emperor, Marcus Aurelius. Father to a murdered son, husband
to a murdered wife. And I will have my vengeance, in this life
or the next."

-- Maximus, "Gladiator", 2000
----end random quote of the moment----