OT: Mail delivery problems.

Nikola Milutinovic Nikola.Milutinovic at ev.co.yu
Tue Dec 30 01:55:12 EST 2003

Oliver Jones wrote:

> This isn't entirely specific to Cyrus but I figured I'd ask here anyway
> as it is related to my recent Cyrus install...
> I've setup Cyrus with virtual domain support.  I've configured sendmail
> 8.12.10 on our server to deliver local mail to cyrus by doing this in
> sendmail.mc:
> MAILER(local)dnl
> Mcyrusv2,       P=[IPC], F=lsDFMnqA5@/:|SmXz, E=\r\n,
>                 S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP,
> T=DNS/RFC822/X-Unix,
>                 A=FILE /usr/local/cyrus/var/lib/imap/socket/lmtp

First of all, I don't think this has set your CyrusV2 mailer as local. There is 
a FEATURE for doing just that, if you must use it. Secondly, man, that path is 
awfully long. I'm not saying that something will not work, just that it looks 
ugly. Consider installing under custom paths. On Tru64 UNIX I use 
"/usr/opt/Cyrus-IMAP-2.1.15" for program and config files and 
"/var/opt/Cyrus-IMAP-2.1.15" for maildir, cyrus config and sockets. Just a 

> For the Cyrus virtual domains I've added entries into
> /etc/mail/mailertable like this:
> example.com        cyrusv2:/usr/local/cyrus/var/lib/imap/socket/lmtp

This definitely proves that "cyrusv2" is not local. "mailertable" is consulted 
only for non-local domains/hostnames.

> I've also setup SMTP AUTH and SSL for sendmail.  And when I connect with
> SMTP AUTH sendmail will relay and deliver my mail.

As expected.

> However when I do not use SMTP AUTH sendmail rejects my mail even if it
> is addressed to someone at example.com.  It rejects with "Relaying Denied.
> Proper authentication required."

As expected - "example.com" is not local domain and the sender was not 
explicitely allowed to relay, either by "/etc/mail/relay-domains" or Access 
Table map.

> Normally when I've had "Relaying denied" errors I've added the domain
> into /etc/mail/local-host-names (for primary MX's) and it's worked fine.

Proper course of action.

> However I did this and instead I got "User unknown" errors.  Which is
> very odd because the address exists in the Cyrus store.

Sendmail is checking to see if "someone" is a local user of the system. Cyrus 
has it's own "users" (rather mailboxes, than users) and they have nothing to do 
with UNIX user accounts.

There are two paths you can follow.


You can use a FEATURE, similar to FEATURE(`local_procmail') that refers to 
Cyrus. Actually, there is a FEATURE(`local_lmtp', `/path/to/your/socket') which 
should be what you want. If you still get errors, check if "w" flag was removed 
from "local" mailer definition. You should have the option to define a class "N" 
of user accounts that should be delivered using "real local" mailer, but I'm not 
sure how it all works. I've never implemented this myself.


This is what I do:

  - add domain "example.com" to /etc/mail/local-host-names
  - add a virtual-user table entry: "someone at example.com someone at my.domain.com"
  - add a virtual-user table entry: "someone at my.domain.com someone at IMAP"
  - have/add an entry to mailer table: "IMAP cyrusv2:localhost"

Note that my solution will not work for virtual domains in Cyrus. It would be 
best to follow the first trail.


More information about the Info-cyrus mailing list