[comp.mail.sendmail] sendmail parsing questions

Lovstrand.EuroPARC@Xerox.COM (04/22/89)

In article <357@anvil.oz> michi@anvil.oz (Michael Henning) writes:

> will a $=T match both "com" and "COM" ?  Is there any option that allows

Yes, sendmail always uses case insensitive string matching.

> [...], I would like to construct a class of all users known to
> the local machine by cutting all the user id's out of the password
> file and another one by cutting all the machine names out of the uucp
> Systems file.

For users from /etc/passwd:

	FX/etc/passwd %[^:]

For UUCP host names from L.sys:

	FX/usr/lib/uucp/L.sys %[^:]

This won't be able to handle continuation lines or comments, though,
so a better way is to use something like the IDA Kit's ability to call
programs for class definitions:

	FX|uuname

> destination "relay_host" and a user part "user@machine1@machine2.dom".

That is not a legal RFC822 address, please consider using something
like "user%machine1@machine2.dom" instead.

> 554: buildaddr: no user.

This means the mailer was invoked without a "user" part.  The
invokation of a mailer in sendmail.cf is done using a triple, as in:

	$# mailer $@ host $: user

The meaning of this is to invoke the mailer (Mmailer) with the address
"user" and send that to the host "host".  The "host" part is sometimes
optional, but "user" never is.

Hope this helps,
--Lennart <Lovstrand.EuroPARC@Xerox.COM>
Rank Xerox EuroPARC, 61 Regent St, Cambridge, England

msir@uhura.cc.rochester.edu (Mark Sirota) (04/23/89)

In article <701@arisia.Xerox.COM> Lovstrand.EuroPARC@Xerox.COM writes:
>In article <357@anvil.oz> michi@anvil.oz (Michael Henning) writes:
>> destination "relay_host" and a user part "user@machine1@machine2.dom".
>
> That is not a legal RFC822 address, please consider using something
> like "user%machine1@machine2.dom" instead.

That is not a legal RFC822 address, either.  Please never recommend the
use of '%' in addresses.  Please consider using something like

	@machine2.dom:user@machine1

Unfortunately, this is not quite legal either, is it?  I seem to recall
that route-addrs need an accompanying phrase and should be in <>'s, as in:

	Mark Sirota <@relay.cs.net:msir@cc.rochester.edu>
-- 
Mark Sirota - University of Rochester, Rochester, NY
 Internet: msir@cc.rochester.edu
 Bitnet:   msir_ss@uordbv.bitnet
 UUCP:     ...!rochester!ur-cc!msir

cfe+@andrew.cmu.edu (Craig F. Everhart) (04/24/89)

> *Excerpts from ext.nn.comp.mail.sendmail: 22-Apr-89 Re: sendmail parsing*
> *questions Mark Sirota@uhura.cc.roc (855)*
> > That is not a legal RFC822 address, please consider using something
> > like "user%machine1@machine2.dom" instead.
> That is not a legal RFC822 address, either.  Please never recommend the
> use of '%' in addresses.
Pray tell, what's not legal about it?  Lots of characters are perfectly
legitimate in unquoted ``local-part''s (the part to the left of an ``@'' in an
RFC822 mailbox).

To summarize:
user@host1@host2        not RFC822-legal; dates from RFC733 (pre-1982) days
user%host1@host2        legal if host2 is registered in the capital-I Internet
<@host2:user@host1>     if both host1 and host2 are registered in the Internet,
OK as an envelope address but not RFC822
user <@host2:user@host1>        if both host1 and host2 are registered in the
Internet, legal RFC822

Notes:
(a) ``%'' is a perfectly legal character, according to RFC822, in an unquoted
local-part, as are letters [A-Za-z]or digits [0-9] or any of:
        !#$%&'*+-/=?^_`{|}~

(b) RFC822 requires that all ``@host'' names used in a route-addr be registered
(presumably with a domain parent or with the root administrator).  The ``%''
pseudo-routing character is often used to express routings to hosts that are not
so registered.  The existence of such routings is of no concern to the
correctness of an RFC822 address, since in the mailbox address
``local-part@domain'', only the given ``domain'' is supposed to attempt to
interpret the ``local-part'' text.

(c) RFC822, in something of a botch, requires that a mailbox address that uses a
route-addr contain some text (a ``phrase'') to the left of the route-addr
(which, indeed, is required to be surrounded by ``<>'').

Needless to say, the fine points in (b) and (c) are often not enforced.  Be
liberal in what you accept and strict about what you generate.

                Craig Everhart
                Andrew message system

rick@uunet.UU.NET (Rick Adams) (04/24/89)

In article <1635@ur-cc.UUCP>, msir@uhura.cc.rochester.edu (Mark Sirota) writes:
> > That is not a legal RFC822 address, please consider using something
> > like "user%machine1@machine2.dom" instead.
> 
> That is not a legal RFC822 address, either.  Please never recommend the
> use of '%' in addresses.  Please consider using something like
> 
> 	@machine2.dom:user@machine1
> 
> Unfortunately, this is not quite legal either, is it?  I seem to recall
> that route-addrs need an accompanying phrase and should be in <>'s, as in:

If you don't know what you're talking about, keep quiet and save everyone
a lot of hassle.

user%machine1@machine2.dom is PERFECTLY LEGAL. Everything to the
left of the at sign is the local part and you should not be
interpreting it at all. The local part is totally machine2's problem.

Source routes such as you "recommend" are strongly discouraged. They
are a pain to parse and often end up being an undeliverable address.

I continue to maintain that we should find everyone who thinks
rfc822 source addresses are a good idea and kill them. This will set
mailer "science" ahead 10 years.

---rick

msir@uhura.cc.rochester.edu (Mark Sirota) (04/26/89)

In article <1635@ur-cc.UUCP> I write:
>In article <701@arisia.Xerox.COM> Lovstrand.EuroPARC@Xerox.COM writes:
>>In article <357@anvil.oz> michi@anvil.oz (Michael Henning) writes:
>>> destination "relay_host" and a user part "user@machine1@machine2.dom".
>>
>> That is not a legal RFC822 address, please consider using something
>> like "user%machine1@machine2.dom" instead.
>
> That is not a legal RFC822 address, either.  Please never recommend the
> use of '%' in addresses.  Please consider using something like
>	@machine2.dom:user@machine1

Okay, okay.  You are right, Lennart's address is perfectly legal.  It's
just not kosher, if you will.  It's a bad idea to recommend the use of %'s
in addresses, since it is not reasonable to expect any sort of consistent
behavior out of them.

Someone pointed out that we are just stuck with a bad standard (RFC822,
that is), which doesn't provide any reasonable mechanism for routing.
When will we have a new standard?
-- 
Mark Sirota - University of Rochester, Rochester, NY
 Internet: msir@cc.rochester.edu
 Bitnet:   msir_ss@uordbv.bitnet
 UUCP:     ...!rochester!ur-cc!msir