[comp.unix.ultrix] Problems with forwarding PostScript files

jim@kanga.lcs.mit.edu (Jim Fulton) (02/01/90)

Here is a gross hack that we use to avoid the ugly "-" processing done in
the cpydgst() routine:

*** /tmp/,RCSt1a18322	Thu Feb  1 10:41:23 1990
--- mh/sbr/cpydgst.c	Tue Apr 18 17:44:46 1989
***************
*** 33,38 ****
--- 33,41 ----
  register char  *ifile,
                 *ofile;
  {
+ #ifdef NODASHPROCESSING
+     cpydata (in, out, ifile, ofile);
+ #else
      register int    i,
                      state;
      register char  *cp,
***************
*** 67,70 ****
--- 70,74 ----
      if (i == NOTOK)
  	adios (ifile, "error reading");
      flush ();
+ #endif
  }

michaud@decvax.dec.com (Jeff Michaud) (02/02/90)

> Sometimes perfectly good .PS documents are ruined by sending them by 
> email.
> 
> The problem became immediately apparent - the ULTRIX (and presumably
all UNIX) 
> forwarding mechanism adds a "dash space" to any dashes it finds in the first 
> column.

	How about simply pipe'ing the .ps file through a simple sed
	script to add a space before every line that begins with
	a dash.  Then mh would leave it alone.

	sed -e '/^-/s/^-/ /' file.ps | mail -s subject rcpt .....

/--------------------------------------------------------------\
|Jeff Michaud    michaud@decwrl.dec.com  michaud@decvax.dec.com|
|DECnet-ULTRIX   #include <standard/disclaimer.h>              |
\--------------------------------------------------------------/

lyndon@cs.AthabascaU.CA (Lyndon Nerenberg) (02/02/90)

In article <807@granite.dec.com> rwood@dec.com (Richard Wood) writes:
>I can see three potential solutions:

>- Modify the postscript definition so that a dash is not a legal character in 
>the first column.  Highly unlikely, eh?

>- Modify ULTRIX/UNIX mail handling programs to stop adding the extra
>characters, 

>- Advise everyone and anyone not to forward .PS documents.

- Run the file through  sed -e 's/^- -/-/'  and get back to work.
  (Or write an equivalently stupid program in whatever language
   is available on the target machine.)
-- 
Lyndon Nerenberg  VE6BBM / Computing Services / Athabasca University
     {alberta,decwrl}!atha!lyndon || lyndon@cs.AthabascaU.CA

                     UREP: Peru in disguise?

g7ahn@cc.ic.ac.uk (K. Krallis) (02/02/90)

   Well, Richard, it would be much better and efficient
to {compress | arc | zip | ...} the .ps file and then
{uuencode | btoa | xxencode | binhex |...} it. It would be
more incovenient, though....
 
Costas Krallis
Imperial College
London UK

E-Mail:    g7ahn@cc.ic.ac.uk

flee@shire.cs.psu.edu (Felix Lee) (02/02/90)

Richard Wood <rwood@vajra.dec.com> wrote:
> As chris@cs.umd.edu just pointed out, the problem that I ascribed to
> all UNIX mailers actually is limited to mh.

Note that MH's "burst" command also bursts forwarded mail and will
remove the extra hyphens.  This is useful only if everyone uses MH.
(Well, everyone involved at least.)
--
Felix Lee	flee@shire.cs.psu.edu	*!psuvax1!flee

sharpe@hollie.rdg.dec.com (Paul Sharpe) (02/04/90)

> From: rwood@dec.com (Richard Wood)
> Subject: Problems with forwarding PostScript files
> 	766c766
>	< -180 x 180 48 R 50 y -180 x 180 48 R 50 y -180 x 180 48 R 744 x
>	---
>	> - -180 x 180 48 R 50 y -180 x 180 48 R 50 y -180 x 180 48 R 744 x

The prepending of hyphens to lines beginning with hyphens is, as someone
mentioned,
a feature of MH: it attempts to conform to the message-encapsualation
scheme detailed in RFC934 (M.Rose: Jan 85) whereby lines beginning with hyphens
form message boundaries, and hence must be character-stuffed when such lines
are really part of the text.
Removing these prepended hyphens either by hand or by scripts does not seem to
cause MH grief,  but the official way to proceed is to use the MH burst
command.
Unfortunately, support for this is not available within dxmail yet......
Actually, MH6.6 does contain, as a 'hidden' option a '-nodashmunging' flag to
forw: when ULTRIX contains MH6.6, life will be a bowl of proverbials...

========================================================================
=========
Paul Sharpe,                        | sharpe@decvax.dec.com
Mail Group,                         | sharpe@wessex.rdg.dec.com
European ULTRIX Engineering Group,  | sharpe@wessex.uucp
Digital Equipment Corp.,            | 
Reading,                            | I promise to tell my opinions, my own
England.                            | opinions and nothing but my own opinions.
========================================================================
=========
Calvin for President!

C: What did you bring for show and tell, Susie,
S: I brought a letter I wrote to our congressman.
   What did you bring?
C: A bag of dead bugs I collected from our window sills.
   Best of all, this way Mom didn't have to pack me a lunch!

stefan@wheaton.UUCP (Stefan Brandle ) (02/06/90)

In article <2646@bacchus.dec.com> klee@decwrl.dec.com writes:
>In article <807@granite.dec.com>, rwood@dec.com (Richard Wood) writes:
>all UNIX) 
>> forwarding mechanism adds a "dash space" to any dashes it finds in the first 
>> column.
>I think this is only a problem when you use the MH forw program to
>forward your mail.  The workaround is to use a different forwarding
>mechanism or to configure your MH to do something different with lines
>starting with -.

Interesting.  I've had a problem getting mail from Ultrix to our remaining 
DECsystem-20 (TOPS-20) to people whose login names have a hyphen.  Since it was
the habit to create accounts with names like `firstinitial-lastname' this ended
up being just about everybody.  I'm not aware that MH is being invoked anywhere.
This will not be an issue too much longer since we are doing our best to get
the DECsystem-20 retired and start saving big $$ on hardware maintenance (which
savings will probably be swallowed up by the higher VMS software costs :-(.

On a similar theme, does anybody have a sendmail.cf that works with smail and
dnet under Ultrix 3.0?  I suppose that the macho way would be to experiment a
whole bunch, but I'm short on time.  So if some kind soul feels touched ...

-sb
-- 
---------------------------------------------- MA Bell: (708) 260-5019 ---------
Stefan Brandle                  UUCP: ...!{obdient,uunet!tellab5}!wheaton!stefan
Wheaton College			or	stefan@wheaton.UUCP
Wheaton, IL 60187 		"But I never claimed to be sane!"

ken@cs.rochester.edu (Ken Yap) (02/09/90)

|>> forwarding mechanism adds a "dash space" to any dashes it finds in the first 
|>> column.
|>I think this is only a problem when you use the MH forw program to
|>forward your mail.  The workaround is to use a different forwarding
|>mechanism or to configure your MH to do something different with lines
|>starting with -.

As several people have pointed out, the dash stuffing is due to the MH
forw program. This stuffing mechanism is santioned in an RFC.  It can
be undone with the burst program, also part of MH.

The real moral is this: one should not rely on mail programs to
transfer *program* source verbatim. Mail programs are allowed to make
transformations that would not damage the meaning of the message when
read by humans.  One could imagine that there might conceivably be a PS
program would be wrecked by Berk mail's indenting by one tab.  Or a PS
program that might contain a line with a period and nothing else which
gets some mailers all upset.  One should wrap the PS source with shar
or something of that genre, or even uuencode the source if it has
problem characters or if it will go through gateways that have line
length limits.