sendmail and virtual domains and catchalls?

Andrzej Filip anfi at priv.onet.pl
Thu Mar 18 01:44:21 EST 2004


Carl Brewer wrote:
> I've been trying a number of combinations of configs to
> try and get sendmail (8.12.10) to handle virtual domains
> and catchall addresses for those virtual domains, but am not
> sure if what I'm trying to do can be achieved with sendmail?
> 
> Say I have 2 virtual domains and a default.
> 
> Call them foo.com, bar.com and bl.echidna.id.au
> 
> I have in my imapd.conf :
> 
> virtdomains: userid
> defaultdomain: bl.echidna.id.au

Sendmail expects the following syntax in virtusertable:
@virtdomains: userid
@defaultdomain: bl.echidna.id.au

But it will "catch & rewrite" *every* address in the domains

You can get get what I think you want by listing all valid addresses in the 
domains in virtusertable. Search news:comp.mail.sendmail for postings with 
_VIRTUSER_STOP_ONE_LEVEL_RECURSION_


> I have in my sendmail .mc file :
> 
> define(`confLOCAL_MAILER', `cyrusv2')
> MAILER(cyrusv2)
> MAILER(smtp)
> 
> (yes, no MAILER(local), if I put that in, nothing works!)
> 
> and I've modified the cyrusv2 definition in mailer/cyrusv2.mc
> 
> 
>                 # setup for virtual domains, Carl
>                 S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP E=\r\n,
>                 # S=EnvFromSMTP/HdrFromL, R=EnvToL/HdrToL, E=\r\n,

You can use MAILER(`cyrusv2') [release B] and mailer cyrusv2d if you copy one 
file into cf/mailer/ directory of sendmail distribution.

http://anfi.webhop.org/sendmail/cyrusv2.html

> In /etc/mail/mailertables I have
> 
> bl.echidna.id.au            cyrusv2:/var/imap/socket/lmtp
> rollcage2.bl.echidna.id.au      cyrusv2:/var/imap/socket/lmtp
> foo.com                cyrusv2:/var/imap/socket/lmtp
> 
> I've created (using cyradm) 'normal' virtual domain accounts, eg
> carl at foo.com, and this works just fine, mail goes happily into that
> mailbox and I can see it.  Mail sent to the default domain however
> doesn't work :
> 
> for mail sent (locally using /bin/mail) to carl at bl.echidna.id.au :
> [...]

1) mailertable DOES NOT work for local email domains
echo '$=w' | sendmail -bt
2) your "per domain catch all" virtusertable entries does not work without 
leading @
3) whenever sendmail selects local mailer (or its substitute defines via 
confLOCAL_MAILER) domain part of envelope recipient address is stripped 
*before* R= rulestes get it [changing R= alone is not sufficient].

> That's not good :)
> 
> It works fine for mail to carl at foo.com though.
> 
> cyradm>lm shows :
> 
> user/carl (\HasChildren)
> user/carl/Sent (\HasNoChildren)
> user/carl/Sent at foo.com (\HasNoChildren)
> user/carl/Trash (\HasNoChildren)
> user/carl/Trash at foo.com (\HasNoChildren)
> user/carl at foo.com (\HasChildren)
> user/postmaster (\HasNoChildren)
> user/postmaster at foo.com (\HasNoChildren)
> 
> I've done something wrong with my setup .. but I don't know
> what.  Do I need the MAILER(local) definition in my sendmail.mc
> file (doesn't that get overridden by
>     define(`confLOCAL_MAILER', `cyrusv2')
> ?
> 
> I can get around that though, if I ditch the default domain and
> just have everything as a virtual domain.
> 
> what I need to be able to do though, is have some catchalls and aliases,
> different for each virtual domain.
> 
> for example, I need bar at foo.com to point to carl at foo.com, and I
> need <anything>@foo.com to go to catchall at foo.com, and
> different catchalls for the other domains.  Google's not been helpful
> here (although I may havemissed something).
> 
> Does/can sendmail's virtusertable provide this kind of thing when used
> with cyrusv2?  If so, is there any doco anywhere that explains
> how to set it up, or should I ditch sendmail and cut over
> to postfix?  (I'd prefer to make this work with sendmail if
> possible).
> 
> Thanks for any help anyone can provide!
> 
> Cyrus is cyrus-imapd-2.2.3 installed from the NetBSD ports collection
> O/S is NetBSD 1.6.2 on i386
> SASL is cyrus-sasl-2.1.17nb1 installed from the NetBSD ports collection
> Sendmail is 8.12.10 installed from the NetBSD ports collection

My recommendation:
Implement http://anfi.webhop.org/sendmail/rtcyrus2.html solution in its 
mailertable version [it rejects messages to non existing cyrus mailboxes], I 
can easily modify it to make it support "per domain catch remaining".

More "sendmail & cyrus" links:
http://anfi.webhop.net/sendmail/#cyrus

-- 
Andrzej [en:Andrew] Adam Filip anfi at priv.onet.pl anfi at xl.wp.pl
http://anfi.webhop.net http://slashdot.org/~anfi
---
Home Page: http://asg.web.cmu.edu/cyrus
Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list