Cyrus IMAP and lmtp

Cyrus IMAP and lmtp

am 01.04.2005 01:40:53 von NFN Smith

I'm trying to configure sendmail and Cyrus IMAP together, and having
problems getting inbound mail to deliver to local (Cyrus) mailboxes.

Specifically, this is box running Debian 3.1, using sendmail 8.13.2 and
Cyrus IMAP 2.2.10-1, both of which have been installed from Debian .deb
distribution packages.

A complicating factor is in machine naming (and that might be part of my
problem). While I'm assembling this machine, I'm calling it
test.foobar.com (there is currently an active mail server called simply
foobar.com), and when this machine is fully functioning, it will be
renamed as foobar.com (and we remove the existing foobar.com).

I believe my problem is in correctly passing mail (and addressing) from
sendmail to Cyrus IMAP. If I send the machine a message from outside
the domain, I get a simple bounce:

> :
> xx.xx.xx.xx does not like recipient.
> Remote host said: 550 5.7.1 ... we do not
> relay
> Giving up on xx.xx.xx.xx.

If I send a message locally (e.g. piping text through /bin/mail, and
addressing to a defined mailbox), the message bounces, and because the
bounce isn't deliverable, the text is copied to
/var/lib/sendmail/dead.letter. Relevant text:

> The original message was received at Thu, 31 Mar 2005 22:55:10 GMT
> from localhost.localdomain [127.0.0.1]
>
> ----- The following addresses had permanent fatal errors -----
>
> (reason: 550-Mailbox unknown. Either there is no mailbox associated with this)
>
> ----- Transcript of session follows -----
> ... while talking to localhost:
>>>> DATA
> <<< 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
> 550 5.1.1 ... User unknown
> <<< 503 5.5.1 No recipients

On this one, the rejection is coming after the SMTP dialogue, has
completed. If I telnet into port 25, I can successfully issue HELO,
MAIL FROM, RCPT TO and DATA commands, and there's no problems until the
dot that terminates the DATA command.

Also, running sendmail in test mode a /parse shows that sendmail is
correctly selecting cyrusv2 as the delivery agent.

A typical set of entries from mail.log shows:

> Mar 31 23:15:09 test sendmail[6141]: j2VNF9NO006141: from=root, size=168, class=0, nrcpts=1, msgid=<200503312315.j2VNF9NO006141@test.foobar.com>, relay=root@localhost
> Mar 31 23:15:09 test sm-mta[6142]: j2VNF99m006142: from=, size=464, class=0, nrcpts=1, msgid=<200503312315.j2VNF9NO006141@test.foobar.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
> Mar 31 23:15:09 test master[6148]: set maximum file descriptors to 256/256
> Mar 31 23:15:09 test master[6148]: about to exec /usr/lib/cyrus/bin/lmtpd
> Mar 31 23:15:09 test sendmail[6141]: j2VNF9NO006141: to=testuser@test.foobar.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30168, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j2VNF99m006142 Message accepted for delivery)
> Mar 31 23:15:09 test lmtpunix[6148]: executed
> Mar 31 23:15:09 test lmtpunix[6148]: telling master 2
> Mar 31 23:15:09 test master[6025]: service lmtpunix pid 6148 in READY state: now unavailable and in BUSY state
> Mar 31 23:15:09 test master[6025]: service lmtpunix now has 0 ready workers
> Mar 31 23:15:09 test lmtpunix[6148]: accepted connection
> Mar 31 23:15:09 test lmtpunix[6148]: telling master 3
> Mar 31 23:15:09 test master[6025]: service lmtpunix pid 6148 in BUSY state: now serving connection
> Mar 31 23:15:09 test master[6025]: service lmtpunix now has 0 ready workers
> Mar 31 23:15:09 test lmtpunix[6148]: lmtp connection preauth'd as postman
> Mar 31 23:15:09 test lmtpunix[6148]: verify_user(user.testuser) failed: Mailbox does not exist
> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006142: to=, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=120464, relay=localhost, dsn=5.1.1, stat=User unknown
> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006142: j2VNF99m006147: DSN: User unknown
> Mar 31 23:15:09 test lmtpunix[6148]: verify_user(user.root) failed: Mailbox does not exist
> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006147: to=root@test.foobar.com, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=31820, relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]], dsn=5.1.1, stat=User unknown
> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006147: j2VNF99n006147: return to sender: User unknown
> Mar 31 23:15:09 test lmtpunix[6148]: verify_user(user.root) failed: Mailbox does not exist
> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99n006147: to=root@test.foobar.com, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=32844, relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]], dsn=5.1.1, stat=User unknown
> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006147: Saved message in /var/lib/sendmail/dead.letter
> Mar 31 23:15:09 test lmtpunix[6148]: telling master 1
> Mar 31 23:15:09 test master[6025]: service lmtpunix pid 6148 in BUSY state: now available and in READY state
> Mar 31 23:15:09 test master[6025]: service lmtpunix now has 1 ready workers
> Mar 31 23:16:09 test master[6025]: process 6148 exited, status 0
> Mar 31 23:16:09 test master[6025]: service lmtpunix now has 0 ready workers

In this, running as user root, I piped text through /bin/mail, addressed
to testuser@test.foobar.com -- that bounced, and since I don't yet have
a usable root mailbox, the bounce was dropped into dead.letter.

I'm wondering if my local-host-names may be mis-defined. For this
machine, the intent is that it's a single domain machine, but in my
current configs for building and testing. In that file, I have:

> localhost
> test.foobar.com
> test

Finally, portions of my sendmail.mc file that seem to be relevant:

> define(`_USE_ETC_MAIL_')dnl
>
> define(`confTRY_NULL_MX_LIST',true)dnl
> define(`confDONT_PROBE_INTERFACES',true)dnl
>
> define(`CYRUSV2_MAILER_ARGS', `FILE /var/run/cyrus/socket/lmtp')dnl
> define(`confLOCAL_MAILER',`cyrusv2')dnl
>
> FEATURE(`no_default_msa')dnl
>
> FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
>
> FEATURE(redirect)dnl
> FEATURE(always_add_domain)dnl
> FEATURE(use_cw_file)dnl
> FEATURE(use_ct_file)dnl
>
> dnl # Masquerading options
> FEATURE(`always_add_domain')dnl
> MASQUERADE_AS(`fimltd.org')dnl
> FEATURE(`allmasquerade')dnl
> FEATURE(`masquerade_envelope')dnl
>
> dnl # Default Mailer setup
> MAILER_DEFINITIONS
> MAILER(`smtp')dnl
> MAILER(cyrusv2)dnl

This is one of those where it seems that I'm missing something small,
but I'm not seeing what it is.

Thanks in advance.

Smith

Re: Cyrus IMAP and lmtp

am 01.04.2005 13:55:29 von Yizhar Hurwitz

HI.

> I believe my problem is in correctly passing mail (and addressing) from
> sendmail to Cyrus IMAP. If I send the machine a message from outside the
> domain, I get a simple bounce:
>
>> :
>> xx.xx.xx.xx does not like recipient.
>> Remote host said: 550 5.7.1 ... we do not relay
>>
>> Giving up on xx.xx.xx.xx.
This seems like a Sendmail issue not related to Cyrus.
Check the "Local Domains" option in sendmail.

[...]

>> ----- The following addresses had permanent fatal errors -----
>>
>> (reason: 550-Mailbox unknown. Either there is no mailbox associated
>> with this)
>>
This seems like a Cyrus issue - you haven't created mailboxes yet.

You should to the following:
cyradm --user cyrus localhost
lm
cm user.testuser

If you have problems to login and use cyradm, then you should first
configure your cyrus authentication method.
(sasldb2, unix system accounts, etc...)
http://asg.web.cmu.edu/cyrus/download/imapd/
[...]

You should also verify that the lmtp socket in "cyrus.conf":
lmtpunix cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=1
Matches the lmtp socket in "sendmail.cf":
A=FILE /var/lib/imap/socket/lmtp

It does not have to be the same socket as I wrote,
You just need to make sure that cyrus and sendmail match and agree about it.

[...]

Bye

--

Yizhar Hurwitz
Kibutz Gaaton, Israel

http://yizhar.mvps.org
http://www.new-ofek.co.il/yizhar

yizhar@mail.com
yizhar@new-ofek.co.il




"NFN Smith" wrote in message
news:RU%2e.63002$le4.22302@fed1read04...
> I'm trying to configure sendmail and Cyrus IMAP together, and having
> problems getting inbound mail to deliver to local (Cyrus) mailboxes.
>
> Specifically, this is box running Debian 3.1, using sendmail 8.13.2 and
> Cyrus IMAP 2.2.10-1, both of which have been installed from Debian .deb
> distribution packages.
>
> A complicating factor is in machine naming (and that might be part of my
> problem). While I'm assembling this machine, I'm calling it
> test.foobar.com (there is currently an active mail server called simply
> foobar.com), and when this machine is fully functioning, it will be
> renamed as foobar.com (and we remove the existing foobar.com).
>
> I believe my problem is in correctly passing mail (and addressing) from
> sendmail to Cyrus IMAP. If I send the machine a message from outside the
> domain, I get a simple bounce:
>
>> :
>> xx.xx.xx.xx does not like recipient.
>> Remote host said: 550 5.7.1 ... we do not relay
>>
>> Giving up on xx.xx.xx.xx.
>
> If I send a message locally (e.g. piping text through /bin/mail, and
> addressing to a defined mailbox), the message bounces, and because the
> bounce isn't deliverable, the text is copied to
> /var/lib/sendmail/dead.letter. Relevant text:
>
>> The original message was received at Thu, 31 Mar 2005 22:55:10 GMT
>> from localhost.localdomain [127.0.0.1]
>>
>> ----- The following addresses had permanent fatal errors -----
>>
>> (reason: 550-Mailbox unknown. Either there is no mailbox associated
>> with this)
>>
>> ----- Transcript of session follows -----
>> ... while talking to localhost:
>>>>> DATA
>> <<< 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
>> 550 5.1.1 ... User unknown
>> <<< 503 5.5.1 No recipients
>
> On this one, the rejection is coming after the SMTP dialogue, has
> completed. If I telnet into port 25, I can successfully issue HELO, MAIL
> FROM, RCPT TO and DATA commands, and there's no problems until the dot
> that terminates the DATA command.
>
> Also, running sendmail in test mode a /parse shows that sendmail is
> correctly selecting cyrusv2 as the delivery agent.
>
> A typical set of entries from mail.log shows:
>
>> Mar 31 23:15:09 test sendmail[6141]: j2VNF9NO006141: from=root, size=168,
>> class=0, nrcpts=1, msgid=<200503312315.j2VNF9NO006141@test.foobar.com>,
>> relay=root@localhost
>> Mar 31 23:15:09 test sm-mta[6142]: j2VNF99m006142:
>> from=, size=464, class=0, nrcpts=1,
>> msgid=<200503312315.j2VNF9NO006141@test.foobar.com>, proto=ESMTP,
>> daemon=MTA, relay=localhost.localdomain [127.0.0.1]
>> Mar 31 23:15:09 test master[6148]: set maximum file descriptors to
>> 256/256
>> Mar 31 23:15:09 test master[6148]: about to exec /usr/lib/cyrus/bin/lmtpd
>> Mar 31 23:15:09 test sendmail[6141]: j2VNF9NO006141:
>> to=testuser@test.foobar.com, ctladdr=root (0/0), delay=00:00:00,
>> xdelay=00:00:00, mailer=relay, pri=30168, relay=[127.0.0.1] [127.0.0.1],
>> dsn=2.0.0, stat=Sent (j2VNF99m006142 Message accepted for delivery)
>> Mar 31 23:15:09 test lmtpunix[6148]: executed
>> Mar 31 23:15:09 test lmtpunix[6148]: telling master 2
>> Mar 31 23:15:09 test master[6025]: service lmtpunix pid 6148 in READY
>> state: now unavailable and in BUSY state
>> Mar 31 23:15:09 test master[6025]: service lmtpunix now has 0 ready
>> workers
>> Mar 31 23:15:09 test lmtpunix[6148]: accepted connection
>> Mar 31 23:15:09 test lmtpunix[6148]: telling master 3
>> Mar 31 23:15:09 test master[6025]: service lmtpunix pid 6148 in BUSY
>> state: now serving connection
>> Mar 31 23:15:09 test master[6025]: service lmtpunix now has 0 ready
>> workers
>> Mar 31 23:15:09 test lmtpunix[6148]: lmtp connection preauth'd as postman
>> Mar 31 23:15:09 test lmtpunix[6148]: verify_user(user.testuser) failed:
>> Mailbox does not exist
>> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006142:
>> to=, delay=00:00:00, xdelay=00:00:00,
>> mailer=cyrusv2, pri=120464, relay=localhost, dsn=5.1.1, stat=User unknown
>> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006142: j2VNF99m006147: DSN:
>> User unknown
>> Mar 31 23:15:09 test lmtpunix[6148]: verify_user(user.root) failed:
>> Mailbox does not exist
>> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006147:
>> to=root@test.foobar.com, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2,
>> pri=31820, relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]],
>> dsn=5.1.1, stat=User unknown
>> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006147: j2VNF99n006147: return
>> to sender: User unknown
>> Mar 31 23:15:09 test lmtpunix[6148]: verify_user(user.root) failed:
>> Mailbox does not exist
>> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99n006147:
>> to=root@test.foobar.com, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2,
>> pri=32844, relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]],
>> dsn=5.1.1, stat=User unknown
>> Mar 31 23:15:09 test sm-mta[6147]: j2VNF99m006147: Saved message in
>> /var/lib/sendmail/dead.letter
>> Mar 31 23:15:09 test lmtpunix[6148]: telling master 1
>> Mar 31 23:15:09 test master[6025]: service lmtpunix pid 6148 in BUSY
>> state: now available and in READY state
>> Mar 31 23:15:09 test master[6025]: service lmtpunix now has 1 ready
>> workers
>> Mar 31 23:16:09 test master[6025]: process 6148 exited, status 0
>> Mar 31 23:16:09 test master[6025]: service lmtpunix now has 0 ready
>> workers
>
> In this, running as user root, I piped text through /bin/mail, addressed
> to testuser@test.foobar.com -- that bounced, and since I don't yet have a
> usable root mailbox, the bounce was dropped into dead.letter.
>
> I'm wondering if my local-host-names may be mis-defined. For this
> machine, the intent is that it's a single domain machine, but in my
> current configs for building and testing. In that file, I have:
>
>> localhost
>> test.foobar.com
>> test
>
> Finally, portions of my sendmail.mc file that seem to be relevant:
>
>> define(`_USE_ETC_MAIL_')dnl
>>
>> define(`confTRY_NULL_MX_LIST',true)dnl
>> define(`confDONT_PROBE_INTERFACES',true)dnl
>>
>> define(`CYRUSV2_MAILER_ARGS', `FILE /var/run/cyrus/socket/lmtp')dnl
>> define(`confLOCAL_MAILER',`cyrusv2')dnl
>>
>> FEATURE(`no_default_msa')dnl
>>
>> FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
>>
>> FEATURE(redirect)dnl
>> FEATURE(always_add_domain)dnl
>> FEATURE(use_cw_file)dnl
>> FEATURE(use_ct_file)dnl
>>
>> dnl # Masquerading options
>> FEATURE(`always_add_domain')dnl
>> MASQUERADE_AS(`fimltd.org')dnl
>> FEATURE(`allmasquerade')dnl
>> FEATURE(`masquerade_envelope')dnl
>>
>> dnl # Default Mailer setup
>> MAILER_DEFINITIONS
>> MAILER(`smtp')dnl
>> MAILER(cyrusv2)dnl
>
> This is one of those where it seems that I'm missing something small, but
> I'm not seeing what it is.
>
> Thanks in advance.
>
> Smith
>

Re: Cyrus IMAP and lmtp

am 01.04.2005 20:14:05 von NFN Smith

Yizhar Hurwitz wrote:

> HI.
>

Thanks for the feedback.

>
>>I believe my problem is in correctly passing mail (and addressing) from
>>sendmail to Cyrus IMAP. If I send the machine a message from outside the
>>domain, I get a simple bounce:
>>
>>
>>>:
>>>xx.xx.xx.xx does not like recipient.
>>>Remote host said: 550 5.7.1 ... we do not relay
>>>
>>>Giving up on xx.xx.xx.xx.
>
> This seems like a Sendmail issue not related to Cyrus.
> Check the "Local Domains" option in sendmail.

Domain resolution could be a part of the problem. As a test machine,
this one doesn't have an MX record, although there is a DNS record.

Where specifically do I check the this one?

>
> [...]
>
>
>>> ----- The following addresses had permanent fatal errors -----
>>>
>>> (reason: 550-Mailbox unknown. Either there is no mailbox associated
>>>with this)
>>>
>
> This seems like a Cyrus issue - you haven't created mailboxes yet.

No, actually, I have -- on this box, I'm running both OpenLDAP and
SquirrelMail, and following creation of the mailbox, I can successfully
log into SquirrelMail, and I can successfully send outbound mail.
However, if I use the account to try to send mail to itself (either
testuser@foobar.com or testuser@test.foobar.com, I still get the problem
of a bounce, and the bounce message being dumped to dead.letter,
because of the "user unknown" error.

[ ... ]


> You should also verify that the lmtp socket in "cyrus.conf":
> lmtpunix cmd="lmtpd" listen="/var/lib/imap/socket/lmtp" prefork=1
> Matches the lmtp socket in "sendmail.cf":
> A=FILE /var/lib/imap/socket/lmtp
>

They both match:

cyrus.conf shows:

> lmtpunix cmd="lmtpd" listen="/var/run/cyrus/socket/lmtp" prefork=0 maxchild=20

sendmail.cf shows:

> A=FILE /var/run/cyrus/socket/lmtp


So -- there's something else that I'm missing here.

Thanks for your continued feedback.


Smith

Re: Cyrus IMAP and lmtp

am 01.04.2005 21:08:00 von NFN Smith

Following up on my own post:

NFN Smith wrote:


>>>
>>>
>>>> :
>>>> xx.xx.xx.xx does not like recipient.
>>>> Remote host said: 550 5.7.1 ... we do not
>>>> relay
>>>> Giving up on xx.xx.xx.xx.
>>
>>
>> This seems like a Sendmail issue not related to Cyrus.
>> Check the "Local Domains" option in sendmail.
>
>
> Domain resolution could be a part of the problem. As a test machine,
> this one doesn't have an MX record, although there is a DNS record.
>
> Where specifically do I check the this one?

On further testing, I realized that this one is an unrelated error.
Since there's currently no MX record pointing to test.foobar.com. mail
is being routed to the existing, live foobar.com, and since there's no
user testuser@foobar.com, that box is correctly rejecting with the 550
error.

Thus, what I need to resolve is local delivery on the test box -- I
think if I get this one done, then we won't have external delivery
problems when there's a correct MX record pointing to this box.

Sorry for added confusion...

Smith

Re: Cyrus IMAP and lmtp

am 01.04.2005 23:10:57 von NFN Smith

Yizhar Hurwitz wrote:

> HI.
>
> What happens if you try sending an email to:
>
> testuser@localhost
>

Good question. I forgot to check this before.

As it turns out, same error, a "user unknown" error, and a dump to
dead.letter.


> The original message was received at Fri, 1 Apr 2005 20:58:36 GMT
> from localhost.localdomain [127.0.0.1]
>
> ----- The following addresses had permanent fatal errors -----
>
> (reason: 550-Mailbox unknown. Either there is no mailbox associated with this)
>
> ----- Transcript of session follows -----
> ... while talking to localhost:
>>>> DATA
> <<< 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
> 550 5.1.1 ... User unknown
> <<< 503 5.5.1 No recipients

Still no joy...

Smith

Re: Cyrus IMAP and lmtp

am 01.04.2005 23:24:49 von Yizhar Hurwitz

HI.

What happens if you try sending an email to:

testuser@localhost

??

--
Yizhar Hurwitz
http://yizhar.mvps.org


"NFN Smith" wrote in message
news:5%g3e.63241$le4.35068@fed1read04...
> Following up on my own post:
>
> NFN Smith wrote:
>
>
>>>>
>>>>
>>>>> :
>>>>> xx.xx.xx.xx does not like recipient.
>>>>> Remote host said: 550 5.7.1 ... we do not
>>>>> relay
>>>>> Giving up on xx.xx.xx.xx.
>>>
>>>
>>> This seems like a Sendmail issue not related to Cyrus.
>>> Check the "Local Domains" option in sendmail.
>>
>>
>> Domain resolution could be a part of the problem. As a test machine,
>> this one doesn't have an MX record, although there is a DNS record.
>>
>> Where specifically do I check the this one?
>
> On further testing, I realized that this one is an unrelated error. Since
> there's currently no MX record pointing to test.foobar.com. mail is being
> routed to the existing, live foobar.com, and since there's no user
> testuser@foobar.com, that box is correctly rejecting with the 550 error.
>
> Thus, what I need to resolve is local delivery on the test box -- I think
> if I get this one done, then we won't have external delivery problems when
> there's a correct MX record pointing to this box.
>
> Sorry for added confusion...
>
> Smith
>

Re: Cyrus IMAP and lmtp

am 02.04.2005 00:32:04 von Yizhar Hurwitz

HI.

What is the exact error message?
Can you post here the NDR message when sending to testuser@localhost ?

Are you using virtual users / virtual domains?

Maybe there is a mismatch, and Sendmail passes the whole email address to
Cyrus lmtp,
but Cyrus is configured for "regular" users (only the mailbox name instead
of full email address).
What do you think?
If you are using virtual domains, then go to:
man imapd.conf
and search for virtual domains related parameters.

Maybe you can also try making the system work first without LDAP?

Bye

--
Yizhar Hurwitz
http://yizhar.mvps.org


"NFN Smith" wrote in message
news:mOi3e.63261$le4.20120@fed1read04...
> Yizhar Hurwitz wrote:
>
>> HI.
>>
>> What happens if you try sending an email to:
>>
>> testuser@localhost
>>
>
> Good question. I forgot to check this before.
>
> As it turns out, same error, a "user unknown" error, and a dump to
> dead.letter.
>
>
>> The original message was received at Fri, 1 Apr 2005 20:58:36 GMT
>> from localhost.localdomain [127.0.0.1]
>>
>> ----- The following addresses had permanent fatal errors -----
>>
>> (reason: 550-Mailbox unknown. Either there is no mailbox associated
>> with this)
>>
>> ----- Transcript of session follows -----
>> ... while talking to localhost:
>>>>> DATA
>> <<< 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
>> 550 5.1.1 ... User unknown
>> <<< 503 5.5.1 No recipients
>
> Still no joy...
>
> Smith
>
>
>

Re: Cyrus IMAP and lmtp

am 02.04.2005 00:49:13 von NFN Smith

Yizhar Hurwitz wrote:

> HI.
>
> What is the exact error message?
> Can you post here the NDR message when sending to testuser@localhost ?

Here's the complete dump from my syslog. For this example,I'm working
as user root, sending via /bin/mail, and there's no local mailbox
defined for root -- it's actually an alias pointing to a mailbox on the
live machine. Thus, the command that generated this output was:

cat filename | mail -s"test message" testuser@localhost

>> Apr 1 22:21:48 test sendmail[8891]: j31MLmJJ008891: from=root, size=116, class=0, nrcpts=1, msgid=<200504012221.j31MLmJJ008891@test.foobar.com>, relay=root@localhost
>> Apr 1 22:21:48 test sm-mta[8892]: j31MLmIc008892: from=, size=410, class=0, nrcpts=1, msgid=<200504012221.j31MLmJJ008891@test.foobar.com>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
>> Apr 1 22:21:49 test sendmail[8891]: j31MLmJJ008891: to=testuser@localhost, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30116, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (j31MLmIc008892 Message accepted for delivery)
>> Apr 1 22:21:49 test master[8898]: set maximum file descriptors to 256/256
>> Apr 1 22:21:49 test master[8898]: about to exec /usr/lib/cyrus/bin/lmtpd
>> Apr 1 22:21:49 test lmtpunix[8898]: executed
>> Apr 1 22:21:49 test lmtpunix[8898]: telling master 2
>> Apr 1 22:21:49 test lmtpunix[8898]: accepted connection
>> Apr 1 22:21:49 test lmtpunix[8898]: telling master 3
>> Apr 1 22:21:49 test lmtpunix[8898]: lmtp connection preauth'd as postman
>> Apr 1 22:21:49 test master[6025]: service lmtpunix pid 8898 in READY state: now unavailable and in BUSY state
>> Apr 1 22:21:49 test master[6025]: service lmtpunix now has 0 ready workers
>> Apr 1 22:21:49 test master[6025]: service lmtpunix pid 8898 in BUSY state: now serving connection
>> Apr 1 22:21:49 test master[6025]: service lmtpunix now has 0 ready workers
>> Apr 1 22:21:49 test lmtpunix[8898]: verify_user(user.testuser) failed: Mailbox does not exist
>> Apr 1 22:21:49 test sm-mta[8897]: j31MLmIc008892: to=, delay=00:00:01, xdelay=00:00:00, mailer=cyrusv2, pri=120410, relay=localhost, dsn=5.1.1, stat=User unknown
>> Apr 1 22:21:49 test sm-mta[8897]: j31MLmIc008892: j31MLnIc008897: DSN: User unknown
>> Apr 1 22:21:49 test lmtpunix[8898]: verify_user(user.root) failed: Mailbox does not exist
>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnIc008897: to=root@foobar.com, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=31765, relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]], dsn=5.1.1, stat=User unknown
>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnIc008897: j31MLnId008897: return to sender: User unknown
>> Apr 1 22:21:49 test lmtpunix[8898]: verify_user(user.root) failed: Mailbox does not exist
>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnId008897: to=root@foobar.com, delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=32789, relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]], dsn=5.1.1, stat=User unknown
>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnIc008897: Saved message in /var/lib/sendmail/dead.letter
>> Apr 1 22:21:49 test lmtpunix[8898]: telling master 1
>> Apr 1 22:21:49 test master[6025]: service lmtpunix pid 8898 in BUSY state: now available and in READY state
>> Apr 1 22:21:49 test master[6025]: service lmtpunix now has 1 ready workers

>
> Are you using virtual users / virtual domains?
>

There's only a single domain defined, although virtdomains has been
enabled in imapd.conf. Is there a possibility that there may be a place
where I'm bumping into an inconsistency between test.foobar.com (the
current temporary name) and foobar.com (the intended permanent name of
the machine)?

> Maybe there is a mismatch, and Sendmail passes the whole email address to
> Cyrus lmtp,
> but Cyrus is configured for "regular" users (only the mailbox name instead
> of full email address).
> What do you think?

It's definitely possible that we're getting a conflict in domain resolution.

One thing that I've noticed is that on the machine that this one is
replacing, when I'm in cyradm, a 'lm' command shows user names with domain:

user/testuser@foobar.com (\HasChildren)

Yet on this machine, 'lm' shows no domain:

user/testuser (\HasChildren)

I'm not sure of what to make of this -- whether it's something that
needs to be resolved, or something that can be ignored...


> If you are using virtual domains, then go to:
> man imapd.conf
> and search for virtual domains related parameters.

As noted, virtdomains is enabled, and the default domain is set to
'fakedomain'. My understanding on this one is that if the domain is set
to the real domain, then all authentication attempts to that domain have
the realm re-written to 'localhost', which prevents saslauthd from
building a valid LDAP query.

>
> Maybe you can also try making the system work first without LDAP?

Not a bad idea, but I'm not sure I know how to easily disable just LDAP
on this one...


Smith

Re: Cyrus IMAP and lmtp

am 02.04.2005 14:15:11 von Yizhar Hurwitz

HI.

> One thing that I've noticed is that on the machine that this one is
> replacing, when I'm in cyradm, a 'lm' command shows user names with
> domain:
> user/testuser@foobar.com (\HasChildren)
> Yet on this machine, 'lm' shows no domain:
> user/testuser (\HasChildren)
>
> I'm not sure of what to make of this -- whether it's something that needs
> to be resolved, or something that can be ignored...

I'm almost sure that this is the main cause of the problem.
Sendmail and Cyrus must agree about user / domain names, and the status of
virtual domains.

> As noted, virtdomains is enabled, and the default domain is set to
> 'fakedomain'. My understanding on this one is that if the domain is set
So maybe the default domain should be set to "foobar.com" ? or "localhost"?
Or best choice - use your real domain name!


--
Yizhar Hurwitz
http://yizhar.mvps.org






"NFN Smith" wrote in message
news:vek3e.63281$le4.7323@fed1read04...
> Yizhar Hurwitz wrote:
>
>> HI.
>>
>> What is the exact error message?
>> Can you post here the NDR message when sending to testuser@localhost ?
>
> Here's the complete dump from my syslog. For this example,I'm working as
> user root, sending via /bin/mail, and there's no local mailbox defined for
> root -- it's actually an alias pointing to a mailbox on the live machine.
> Thus, the command that generated this output was:
>
> cat filename | mail -s"test message" testuser@localhost
>
>>> Apr 1 22:21:48 test sendmail[8891]: j31MLmJJ008891: from=root,
>>> size=116, class=0, nrcpts=1,
>>> msgid=<200504012221.j31MLmJJ008891@test.foobar.com>,
>>> relay=root@localhost
>>> Apr 1 22:21:48 test sm-mta[8892]: j31MLmIc008892:
>>> from=, size=410, class=0, nrcpts=1,
>>> msgid=<200504012221.j31MLmJJ008891@test.foobar.com>, proto=ESMTP,
>>> daemon=MTA, relay=localhost.localdomain [127.0.0.1]
>>> Apr 1 22:21:49 test sendmail[8891]: j31MLmJJ008891:
>>> to=testuser@localhost, ctladdr=root (0/0), delay=00:00:01,
>>> xdelay=00:00:01, mailer=relay, pri=30116, relay=[127.0.0.1] [127.0.0.1],
>>> dsn=2.0.0, stat=Sent (j31MLmIc008892 Message accepted for delivery)
>>> Apr 1 22:21:49 test master[8898]: set maximum file descriptors to
>>> 256/256
>>> Apr 1 22:21:49 test master[8898]: about to exec
>>> /usr/lib/cyrus/bin/lmtpd
>>> Apr 1 22:21:49 test lmtpunix[8898]: executed
>>> Apr 1 22:21:49 test lmtpunix[8898]: telling master 2
>>> Apr 1 22:21:49 test lmtpunix[8898]: accepted connection
>>> Apr 1 22:21:49 test lmtpunix[8898]: telling master 3
>>> Apr 1 22:21:49 test lmtpunix[8898]: lmtp connection preauth'd as
>>> postman
>>> Apr 1 22:21:49 test master[6025]: service lmtpunix pid 8898 in READY
>>> state: now unavailable and in BUSY state
>>> Apr 1 22:21:49 test master[6025]: service lmtpunix now has 0 ready
>>> workers
>>> Apr 1 22:21:49 test master[6025]: service lmtpunix pid 8898 in BUSY
>>> state: now serving connection
>>> Apr 1 22:21:49 test master[6025]: service lmtpunix now has 0 ready
>>> workers
>>> Apr 1 22:21:49 test lmtpunix[8898]: verify_user(user.testuser) failed:
>>> Mailbox does not exist
>>> Apr 1 22:21:49 test sm-mta[8897]: j31MLmIc008892:
>>> to=, delay=00:00:01, xdelay=00:00:00,
>>> mailer=cyrusv2, pri=120410, relay=localhost, dsn=5.1.1, stat=User
>>> unknown
>>> Apr 1 22:21:49 test sm-mta[8897]: j31MLmIc008892: j31MLnIc008897: DSN:
>>> User unknown
>>> Apr 1 22:21:49 test lmtpunix[8898]: verify_user(user.root) failed:
>>> Mailbox does not exist
>>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnIc008897: to=root@foobar.com,
>>> delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=31765,
>>> relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]], dsn=5.1.1,
>>> stat=User unknown
>>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnIc008897: j31MLnId008897:
>>> return to sender: User unknown
>>> Apr 1 22:21:49 test lmtpunix[8898]: verify_user(user.root) failed:
>>> Mailbox does not exist
>>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnId008897: to=root@foobar.com,
>>> delay=00:00:00, xdelay=00:00:00, mailer=cyrusv2, pri=32789,
>>> relay=localhost [[UNIX: /var/run/cyrus/socket/lmtp]], dsn=5.1.1,
>>> stat=User unknown
>>> Apr 1 22:21:49 test sm-mta[8897]: j31MLnIc008897: Saved message in
>>> /var/lib/sendmail/dead.letter
>>> Apr 1 22:21:49 test lmtpunix[8898]: telling master 1
>>> Apr 1 22:21:49 test master[6025]: service lmtpunix pid 8898 in BUSY
>>> state: now available and in READY state
>>> Apr 1 22:21:49 test master[6025]: service lmtpunix now has 1 ready
>>> workers
>
>>
>> Are you using virtual users / virtual domains?
>>
>
> There's only a single domain defined, although virtdomains has been
> enabled in imapd.conf. Is there a possibility that there may be a place
> where I'm bumping into an inconsistency between test.foobar.com (the
> current temporary name) and foobar.com (the intended permanent name of the
> machine)?
>
>> Maybe there is a mismatch, and Sendmail passes the whole email address to
>> Cyrus lmtp,
>> but Cyrus is configured for "regular" users (only the mailbox name
>> instead of full email address).
>> What do you think?
>
> It's definitely possible that we're getting a conflict in domain
> resolution.
>
> One thing that I've noticed is that on the machine that this one is
> replacing, when I'm in cyradm, a 'lm' command shows user names with
> domain:
>
> user/testuser@foobar.com (\HasChildren)
>
> Yet on this machine, 'lm' shows no domain:
>
> user/testuser (\HasChildren)
>
> I'm not sure of what to make of this -- whether it's something that needs
> to be resolved, or something that can be ignored...
>
>
>> If you are using virtual domains, then go to:
>> man imapd.conf
>> and search for virtual domains related parameters.
>
> As noted, virtdomains is enabled, and the default domain is set to
> 'fakedomain'. My understanding on this one is that if the domain is set
> to the real domain, then all authentication attempts to that domain have
> the realm re-written to 'localhost', which prevents saslauthd from
> building a valid LDAP query.
>
>>
>> Maybe you can also try making the system work first without LDAP?
>
> Not a bad idea, but I'm not sure I know how to easily disable just LDAP on
> this one...
>
>
> Smith
>

Re: Cyrus IMAP and lmtp

am 06.04.2005 18:14:14 von NFN Smith

Yizhar Hurwitz wrote:

>>One thing that I've noticed is that on the machine that this one is
>>replacing, when I'm in cyradm, a 'lm' command shows user names with
>>domain:
>> user/testuser@foobar.com (\HasChildren)
>>Yet on this machine, 'lm' shows no domain:
>> user/testuser (\HasChildren)
>>
>>I'm not sure of what to make of this -- whether it's something that needs
>>to be resolved, or something that can be ignored...
>
>
> I'm almost sure that this is the main cause of the problem.
> Sendmail and Cyrus must agree about user / domain names, and the status of
> virtual domains.
>

I'm inclined to agree.

I think what's happening is that what sendmail is passing to the the
Cyrus mailer isn't matching what Cyrus is expecting. At this stage, I'm
more inclined to believe it's on the Cyrus side.

Is there a way of tracing/logging what sendmail is sending, and what
Cyrus is expecting?

Smith

Re: Cyrus IMAP and lmtp

am 09.04.2005 06:26:10 von NFN Smith

One final follow-up --

It turns out that my problem was a matter of getting the correct
send/receive flags in the M4 file that is used for the definition for
cyrusv2 mailer. I had seen notes on this before, but originally decided
to stick with the defaults.

Specifically, I found:

> You'll have to use the Cyrus mailer in LMTP mode, and you'll have to
> change the mailer flags so that it provides the full domain while
> communicating LMTP.

What I was using was:

S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL, E=\r\n,

I changed that one to:

S=EnvFromSMTP/HdrFromL, R=EnvToSMTP, E=\r\n,

Following a recompile of sendmail.mc, and a restart of the daemon, we're
now correctly delivering mail to local mailboxes.

Smith