[comp.mail.mh] Bouncing mail...

scott@grlab.UUCP (Scott Blachowicz) (03/02/90)

I'm a new user to mh. I'm running on a couple different HP-UX systems
with these options:
   version: MH 6.6 #1[UCI] (ics) of Tue May 24 15:51:53 PDT 1988
   options: [ATZ] [SYS5] [BERK] [TTYD] [DUMB] [NDIR] [MHE] [NETWORK]
            [RPATHS] [MHRC] [SBACKUP='"#"'] [MORE='"/usr/bin/more"']
            [SENDMTS] [SMTP]

Some questions...
1) Should I be using the "BERK" option on HP-UX? any other options
   that I should change?

2) For lack of knowing any better alternatives...I've done a script
   that scans my +inbox piping the results to a nawk script that spits
   out refile commands to auto-file my mail into appropriate folders.
   I also want to "bounce" some messages to other people. Is there
   some way to do this with mh/dist/rcvdist/whatever without having to
   do an edit? I always get something like this from rcvdist:
       -- Posting for All Recipients --
      post: problem initializing server; [BHST] no servers available
      /net/sw/mh/lib/post: Exit 1

   I tried using dist with -form <file> where the file had a
      Resent-To: addr1 addr2
   line in it using the command
      dist 16 -anno -nodraft -noedit -nowhat -inplace -form <file>
   and nothing got delivered.

   What I'm currently doing is doing an 'anno' of the message to add
   an "X-Bounced-To" header, then feeding it to /usr/lib/sendmail -...
   Is the "recommended" way of doing such things?

3) Is there any better way of "auto-filing" the messages? I've looked
   .maildelivery stuff, but it didn't seem to be flexible enough for
   I wanted to do.

4) My mh messages seem to end with a couple of Return-Path headers. Is
   inc adding one to them? Should it be?

Thanx,
--
Scott Blachowicz                E-mail:  scott@grlab.UUCP
USPS:  Graphicus                 ..or..  ...!hpubvwa!grlab!scott
       150 Lake Str S, #206     VoicePh: 206/828-4691
       Kirkland, WA 98033       FAX:     206/828-4236

jdpeek@RODAN.ACS.SYR.EDU (Jerry Peek) (03/03/90)

I'll just pick one of Scott's questions:

> 3) Is there any better way of "auto-filing" the messages? I've looked
>    .maildelivery stuff, but it didn't seem to be flexible enough for
>    I wanted to do.

You might look into scan format strings and form files.  They're a nice
way to pull out exactly the header information your shell script needs.
(I used to use "sed" and "awk" to parse "scan" output--what a pain!)
With this, your shell/awk/whatever auto-filer can probably get to the real
job more efficiently.

Here's a quick example of a format string that prints the message number
in a field of width 4, then a space.  After that, it prints the "Sender:"
field, if the message has one--otherwise, it prints the "From:" field.

	$ scan -format "%4(msg) %<{sender}%{sender}%|%{from}%>" last:5
	1146 "Jerry Peek" <jdpeek>
	1147 Rick Amory <RAMORY@MVUS.BITNET>
	1148 "Wilbur, Orville" <orwilbur@monk.ncs.syr.edu>
	1151 EAMYLON@SUNSET.CAS.SYR.EDU (Edwin A. Mylon)
	1152 mh-users-request@ICS.UCI.EDU

There's a lot more to this.  For instance, the %(friendly) escape gives
just addresses without the users' "real" names.  The mh-format(5) manual
page will get you going on this (if you aren't, already).

--Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY
  jdpeek@rodan.acs.syr.edu, JDPEEK@SUNRISE.BITNET        +1 315 443-3995

khera@juliet.cs.duke.edu (Vick Khera) (03/05/90)

In article <SCOTT.90Mar1115219@grlab.grlab.UUCP> scott@grlab.UUCP (Scott Blachowicz) writes:
>I'm a new user to mh. I'm running on a couple different HP-UX systems
>with these options:
>   version: MH 6.6 #1[UCI] (ics) of Tue May 24 15:51:53 PDT 1988
>   options: [ATZ] [SYS5] [BERK] [TTYD] [DUMB] [NDIR] [MHE] [NETWORK]
>            [RPATHS] [MHRC] [SBACKUP='"#"'] [MORE='"/usr/bin/more"']
>            [SENDMTS] [SMTP]
>
>Some questions...
>
>2) For lack of knowing any better alternatives...I've done a script
>   that scans my +inbox piping the results to a nawk script that spits
>   out refile commands to auto-file my mail into appropriate folders.
>   I also want to "bounce" some messages to other people. Is there
>   some way to do this with mh/dist/rcvdist/whatever without having to
>   do an edit? [ ... ]

i was able to accomplish this with the Resent-To: field filled in in a file
i called xxxx, and then echo-ing in "s" to dist: (it should also work for
the "p" option to the whatnow? prompt.)

echo "s" | dist -noedit -form xxxx

where xxxx is the following file (one line):

Resent-To: khera

so you should be able to generate the appropriate forwarding header format
file (xxxx in this case) and then have it dist'ed automatically in a shell
script, presumably in the same script that does the refile's based on pick
(see answer to next question)

>3) Is there any better way of "auto-filing" the messages? I've looked
>   .maildelivery stuff, but it didn't seem to be flexible enough for
>   I wanted to do.

something simpler that what you described above with the awk script would
be to use the pick command and unix back-quoting.  for instance, try
"refile +unimportant `pick -from bozo`" to refile the messages from a user
named bozo into the folder called unimportant.  check out the pick man-page
for other options.  asynchronous distribution of messages into various
folders is something i gave up on quite a while ago, especially with NFS
mounted home directories and local delivery on various machines.

>4) My mh messages seem to end with a couple of Return-Path headers. Is
>   inc adding one to them? Should it be?

inc includes them if you include the option RPATHS in the configuration,
which you have done.  if you don't want them, remove RPATHS and recompile.

>Thanx,
>--
>Scott Blachowicz                E-mail:  scott@grlab.UUCP
>USPS:  Graphicus                 ..or..  ...!hpubvwa!grlab!scott