[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(fwd) "Will You Be a Terrorist?"

   [...] giving both limited-use remailers 

Limited use remailers are exactly what a subscription service does.

   Could you send me what you've done on this?  I think it's a desirable
   feature to have, though requiring that people hack their sendmail.cfs
   is not a big boost to the "popularity of package" indicator.

Admittedly, sendmail.cf hacking is not for the light of heart.  I've
appended a little tutorial I wrote a few months ago on how to do this.
The only correction I have on rereading is that version 8 sendmail
doesn't use frozen configuration files.


How to add + to your email syntax

Ever wanted one of those cool <[email protected]> addresses?  So you can
use <[email protected]> and get a filter to easily move
the list out from your regular mail?  Now you can.

This tutorial works if you're running a fairly standard version of
sendmail.  It requires some hacking to sendmail.cf, so you need the
permission to do that; that's usually root.  The modifications are
fairly straightforward.

I.  Add + to the list of operator symbols.

The sendmail 'o' macro determines how to break up strings in
sendmail.cf rules into tokens.  In order to be able to recognize +
specially, you'll have to add to the operator symbols to make it
separately recognizable.

So, first do a 

	% grep -n ^Do sendmail.cf

Now, go in and edit line 116 and add a + sign at the end:


That's all.  Now sendmail will not include + inside of its tokens.

II.  Duplicate local delivery rules to accept + syntax.

Sendmail is a delivery multiplexer.  You want to change the syntax for
local deilvery, so all you need to change is the local mail
specifications.  First, make sure your local mailer is called 'local'.
You can search for the mailer definition as follows:

	% grep ^Mlocal sendmail.cf
	Mlocal,	P=/usr/libexec/mail.local, F=lsDFMmn, [...]

I've elided the tail end of the line, because all you really need to
ascertain is that the local mailer has the right name.

Now you want to search for all the delivery rules that deliver mail to
the local mailer:

	% grep -n '#local' sendmail.cf
	563:R$-<@$w>		$#local$:$1
	585:R$-<@$D>		$#local$:$1			[email protected]
	614:R$+			$#local$:$1			everything else

I have three rules for local delivery.  (The second one is custom, and
allows for delivery to a domain address for which no IP address
exists.)  All you do now is to add a rule for '+' delivery for each
kind of existing local delivery.  After I changed mine, it said:

	% grep -n '#local' sendmail.cf
	563:R$-<@$w>		$#local$:$1
	564:R$-+$*<@$w>		$#local$:$1
	586:R$-<@$D>		$#local$:$1			[email protected]
	587:R$-+$*<@$D>		$#local$:$1			[email protected]
	616:R$-+$*		$#local$:$1			everything else
	617:R$+			$#local$:$1			everything else

Rules that matched "$-", a single token, I changed to match "$-+$*", a
single token followed by "+" followed by zero or more tokens.

Rules that matched "$+", one or more tokens, I changed to match
"$-+$*", same as above.  I added the changed rule _before_ the
original rule because otherwise the $+ would swallow up everything.

The $1 in the second column refers to the first macro to match in the
pattern in column one.  That's the username the mail gets to delivered
to.  If you have more complicated usernames, you're likely already a
seasoned sendmail trooper.

III.  Install and Test

You should probably increment the version number when you make the
change.  It's in the 'Z' macro, do

	% grep -n ^DZ sendmail.cf

Freeze the sendmail configuration with

	sendmail -bz

otherwise your changes won't take effect.  Now send yourself some test
mail and make sure it works.

Eric Hughes
[email protected]
17 February 1994