<OT> sendmail guru help needed

Gerry Doris gerry
Mon May 17 11:38:59 PDT 2004


> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gerry Doris spewed electrons into the ether that resembled:
>> Perhaps I'm missing something but I think you should be looking at
>> virtusertable.
>>
>> I'm assuming that all mail is going to come through the linux sendmail
>> box.  I believe you can forward all the mail not being processed by
>> sendmail over to the other mail server using virtusertable.  The other
>> mail accounts would simply be processed by sendmail.
>
> I had thought this too. But I couldn't find an example of how to
> accomplish  this. got one?
>
> - --
> Douglas J Hunley (doug at hunley.homeip.net) - Linux User #174778
> Admin: Linux StepByStep - http://www.linux-sxs.org
> 	and http://jobs.linux-sxs.org

I've used virtusertable to forward from one mail server to another.  For
example the following entry:

gdoris at dorfam.ca   gerry at tiger.dorfam.ca

would send all mail coming into my mailserver addressed to
gdoris at dorfam.ca to user gerry at an internal server called
tiger.dorfam.ca.  If I understand what you're trying to do then you would
need to add 75 addresses to the left hand side directing them to a
separate internal server.  Using virtusertable this will be done without
any processing.  The 25 names not listed will be processed.  You could
then use procmail to send those 25 users' mail onto the second server for
normal delivery after doing your filtering.



The following is from the sendmail docs....


virtusertable	A domain-specific form of aliasing, allowing multiple
		virtual domains to be hosted on one machine.  For example,
		if the virtuser table contained:

			info at foo.com	foo-info
			info at bar.com	bar-info
			joe at bar.com	error:nouser 550 No such user here
			jax at bar.com	error:5.7.0:550 Address invalid
			@baz.org	jane at example.net

		then mail addressed to info at foo.com will be sent to the
		address foo-info, mail addressed to info at bar.com will be
		delivered to bar-info, and mail addressed to anyone at baz.org
		will be sent to jane at example.net, mail to joe at bar.com will
		be rejected with the specified error message, and mail to
		jax at bar.com will also have a RFC 1893 compliant error code
		5.7.0.

		The username from the original address is passed
		as %1 allowing:

			@foo.org	%1 at example.com

		meaning someone at foo.org will be sent to someone at example.com.
		Additionally, if the local part consists of "user+detail"
		then "detail" is passed as %2 and "+detail" is passed as %3
		when a match against user+* is attempted, so entries like

			old+*@foo.org	new+%2 at example.com
			gen+*@foo.org	%2 at example.com
			+*@foo.org	%1%3 at example.com
			X++ at foo.org	Z%3 at example.com
			@bar.org	%1%3

		and other forms are possible.  Note: to preserve "+detail"
		for a default case (@domain) %1%3 must be used as RHS.
		There are two wildcards after "+": "+" matches only a non-empty
		detail, "*" matches also empty details, e.g., user+ at foo.org
		matches +*@foo.org but not ++ at foo.org.  This can be used
		to ensure that the parameters %2 and %3 are not empty.

		All the host names on the left hand side (foo.com, bar.com,
		and baz.org) must be in class {w} or class {VirtHost}.  The
		latter can be defined by the macros VIRTUSER_DOMAIN or
		VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and
		MASQUERADE_DOMAIN_FILE, see below).  If VIRTUSER_DOMAIN or
		VIRTUSER_DOMAIN_FILE is used, then the entries of class
		{VirtHost} are added to class {R}, i.e., relaying is allowed
		to (and from) those domains.  The default map definition is:

			hash /etc/mail/virtusertable

		A new definition can be specified as the second argument of
		the FEATURE macro, such as

			FEATURE(`virtusertable', `dbm /etc/mail/virtusers')



Gerry




More information about the Linux-users mailing list