[comp.soft-sys.andrew] Mail captions

wollman@kira.UVM.EDU (Garrett Wollman) (02/22/91)

I have noticed that, very often, the host listed as the user's in mail
captions has been pulled out of a hat from somewhere and doesn't really
reflect reality.

So, here are a few IWBNIs for everyone to comment on:

	There is a lot of mail which still comes in with the mutant form
"foo!bar!baz@somehost".  This should be recognized and dealt with
properly, when possible.  For example:

From: cbmvax!snark.thyrsus.com!eric@uunet.UU.NET (Eric S. Raymond)

should be captioned as Eric S. Raymond@snark.thyrsus.com, and not as
Eric S. Raymond@uunet.UU.NET (the current behavior).  Similarly,

From: Bob Rahe <CES00661%UDELVM@VTVM2.CC.VT.EDU>

should be captioned as (suggested syntax) Bob Rahe@CES00661.???.  While
this is indeed ugly, it would be helpful for sites that live in three
worlds such as ours.  Not to mention that many of these kinds of
addresses show up in mailing lists, which AMS generally excels at.

-GAWollman

PS:  How about an option to add the "--\n" before pasting the signature
on?  And maybe four different signature files (local and non-local ATK
and non-ATK)?

-- (manually typed)
Garrett A. Wollman - wollman@sadye.uvm.edu

Disclaimer:  I'm not even sure this represents *my* opinion, never
mind UVM's, EMBA's, EMBA-CF's, or indeed anyone else's.

nsb@thumper.bellcore.com (Nathaniel Borenstein) (02/22/91)

Well, it isn't quite pulled out of a hat; the process is at least
deteriministic, if not correct...

I agree that it would be nice if the caption-building code were smart
about "!" and "%" syntax.  If anyone feels like tackling this, the code
is not too terrible to look at, and can be found in
ams/libs/ms/prettyn.c.  In that file, at around line 190, you can see
that the code starts looking at the "Addr->Hosts" structure, which is
where the stuff following the "@" has been placed by the address parser.
 However, if you look through the string that is currently in the
variable "s", you can probably find a better version of the host name if
s contains "!" or "%", and you can concatenate that to FromBuf instead
of what you get from the host structure.

Another good fix, for anyone who tackles this, would be, in
ams/libs/ms/shrkname.c, in "ShrinkName", to do the right thing with "%"
when looking for the "real" user name.  Currently that routine correctly
picks out "nsb" from "foo!bar!nsb" but it doesn't know how to pick out
"nsb" from "nsb%foobar".  Should be a trivial fix for anyone who cares
enough to make it...

Finally, I *really* like the idea of having differential signature files
depending on whether or not you're using ATK.  (Local versus non-local
is also appealing.)  I like that idea enough that I might actually write
up a patch for it one of these days, if nobody else gets to it first. 
(The caption-related stuff is something I was willing to be helpful on,
but I'm not motivated enough to actually make & test the fix and submit
a patch.)