[prev in list] [next in list] [prev in thread] [next in thread] 

List:       procmail
Subject:    Re: Virtual domain with his own user list
From:       Philip Guenther <guenther () gac ! edu>
Date:       1996-11-27 6:58:41
[Download RAW message or body]

David Graves <www@graves.com> writes:
>Now lemme get this straight:
>
>Even if I WERE to hack sendmail and do the following:
>
>1) Add procmail as a delivery agent using the -a to accept the user
>2) Add rules in Rulset 0 that would call this new delivery agent.
>
>I'd STILL have problems with BCC's due to various other problems such as sendm
ail collapsing duplicates, etc...


Sorry, I didn't make myself clear.  Given your two points above, if
you crafted those lines in ruleset 0 correctly, then it would all work,
even in the face of Bcc's and mailing lists.  Heck, if you use procmail
as the local mailer (that is, the "Mlocal" definition calls procmail),
you could even use that and skip step 1, but the local mailer is overloaded
enough (with aliasing and stuff) that I would _not_ suggest doing that.
The hard part is getting the lines that invoke the procmail mailer correct.
When make the database lookup to see whether the address being processed
is that of a virtual domain, you need to save the 'current' address past
the database lookup and then give that as the user ($:) part of the mailer
call ($#procmail) line.

For example, to quote the mailertable related lines in sendmail 8.8.3's
m4 generated config, here's the ruleset 0 lines:

# not local -- try mailer table lookup
R$* <@ $+ > $*		$: < $2 > $1 < @ $2 > $3        extract host name
R< $+ . > $*		$: < $1 > $2                    strip trailing dot
R< $+ > $*		$: < $(mailertable $1 $) > $2   lookup
R< $~[ : $+ > $*	$>95 < $1 : $2 > $3             check -- resolved?

And here's ruleset 95:

S95
R< > $*				$@ $1			strip off null relay
R< error : $- $+ > $*		$#error $@ $1 $: $2	special case errors
R< local : > $* < @ $* >	$#local $@ $1@$2 $: $1	no host: use old user
R< local : $+ > $* <@ $* . > $*	$#local $@ $2@$3 $: $1	special case local
R< $- : $+ @ $+ > $*<$*>$*	$# $1 $@ $3 $: $2<@$3>	use literal user
R< $- : $+ > $*			$# $1 $@ $2 $: $3	try qualified mailer
R< $=w > $*			$@ $2			delete local host
R< $+ > $*			$#_RELAY_ $@ $1 $: $2	use unqualified mailer


Watch what happens when an address like
	user<@virtualdomain.>
goes through this:
	user<@virtualdomain.>
	<virtualdomain.>user<@virtualdomain.>
	<virtualdomain>user<@virtualdomain.>
  lookup "virtualdomain" in mailertable, get back "procmail:/some/dir/virtdom"
	<procmail:/some/dir/virtdom>user<@virtualdomain.>
  call 95
     unchanged until ....
	$#procmail $@ /some/dir/virtdom $: user<@virtualdomain.>

The key thing to note is that the original recipient address being processed
is still availible past the database lookup for passing to the mailer via $:.

You should note that while this appears to require a procmailrc for each
virtual domain, that is not true.  You can either have several all linked
together and use $_ to figure out what name it was 'called' under, or
you can just look at the recipient address, as it will look like:

	user@virutaldomain

(don't forget that it gets passed through ruleset 4, not to mention the
ones listed in the mailer definition, thus the 'missing' braces.)


...
>If that IS the case, then does that mean that I throw my Solaris stock 2.4 sen
dmail in the crapper, throw my 
>procmail in the crapper and pull my hair out compiling and installing V8.whate
ver sendmail and use THAT to deliver 
>mail to my thousands of virtual users on my dozens of virtual domains?


Well, I would suggest upgrading the sendmail V8 anyway, and that it really
isn't that hard, but your environment is different from mine, so it's your
call.  You _should_ be able to do the above without compiling sendmail V8
yourself, but I haven't done so myself.

Perhaps now is a good time to throw in a disclaimer: I don't run an ISP,
but rather a medium sized (60+ unix hosts, 1000+ hosts total) academic
network, and there's only one 'virtual host' here, though there is some
other sendmail trickery involved.  What I haven't done myself, I have
either heard from others whom I consider experts, or reasoned from too
much documentation and experimentation.  After that it was just a matter
of my mind (to invoke Lovecraft) "correlating all of its contents".  If
you think something I've said is flakey, feel free to bash it, just be
prepared to back yourself up with logic (and 3km of 1/2" tape).

Philip Guenther

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic