[comp.mail.mh] Scan format for From: line question -- getting most significant part

avolio@decuac.DEC.COM (Frederick M. Avolio) (01/03/90)

When I scan my mail in a folder, I'd like to see the msot significant
part of the address.  Is there a way to do this?  For example

user@host.domain
host1!host2!host3!host4!user

shows up as:

user@host.domain
host1!host2!host3!ho

(or whatever fits....)

when I really would like that second address to show up as
ost2!host3!host4!user

Thanks

Fred

gregg@cbnewsc.ATT.COM (gregg.g.wonderly) (01/04/90)

From article <2859@decuac.DEC.COM>, by avolio@decuac.DEC.COM (Frederick M. Avolio):
> 
> When I scan my mail in a folder, I'd like to see the msot significant
> part of the address.  Is there a way to do this?  For example

At first thought, I tried the following fragment in the file foo via

	scan -format "`cat foo`" +inbox

%(void(type{from}))\
%<(lt 0)\
%(host{from})!%(mbox{from})\
%|\
%<(gt 0)\
%(mbox{from})@%(host{from})\ 
%|\
%(mbox{from})\
%>\
%>

This almost works except %(host{from}) yields the path and %(path{from})
is empty.  This is in MH 6.5 with some local modifications.  I remember
adding %(lt) or %(gt) which was missing, but don't remember which it was.

-- 
-----
gregg.g.wonderly@att.com   (AT&T bell laboratories)

avolio@decuac.DEC.COM (Frederick M. Avolio) (01/04/90)

> %(void(type{from}))\
> %<(lt 0)\
> %(host{from})!%(mbox{from})\
> %|\
> %<(gt 0)\
> %(mbox{from})@%(host{from})\ 
> %|\
> %(mbox{from})\
> %>\
> %>



Well, this might work unless BERK is defined according to the documentation.
Then none of the host stuff works.  (Every address is type local, host is
empty, mbox is the whole address.)

No substring capability, huh? 


Fred