[comp.unix.ultrix] Getting inside the quotes in sendmail...

rainwatr@ucunix.SAN.UC.EDU (Don Rainwater) (12/02/89)

Hello,
	I have a VAX running Ultrix 3.0 which is setup to be a "mail
gateway" between the Internet and an internal network of Office
Automation VAXen running VMS and All-in-1.  To make it easy to get mail
from an Internet site to a user on the OA net, I have a pseudo-domain
defined so that an address can look like 'user@node.oa.uc.edu'.  In
sendmail, this type of address is intercepted and translated to
'node::mrgate::"a1::user"' and goes out over DECnet to the right
machine.

	For OA mail that is bound for the Internet, I would like to
change the 'From:' address to something that looks like Internet.  (ie.
I want to change 'node::mrgate::"a1::user"' to 'user@node.oa.uc.edu')
This seems to be a problem, since '"a1::user"' is treated as a single
token and there appears to be no way to get inside the quotes.

	Does anyone have any suggestions for getting around this
problem?  What I would really like is info on how to get inside the
quotes, but I'm open to other suggestions as well.  Thanks in advance
for any help.

--
Don Rainwater, Univ. of Cincinnati Computer Center
rainwatr@ucunix.san.uc.edu
rainwatr@ucbeh.san.uc.edu
rainwatr@ucbeh.bitnet

peirce@gumby.cc.wmich.edu (Leonard J. Peirce) (12/04/89)

In article <71@ucunix.SAN.UC.EDU> rainwatr@ucunix.san.uc.edu (Don Rainwater) writes:
>	For OA mail that is bound for the Internet, I would like to
>change the 'From:' address to something that looks like Internet.  (ie.
>I want to change 'node::mrgate::"a1::user"' to 'user@node.oa.uc.edu')
>This seems to be a problem, since '"a1::user"' is treated as a single
>token and there appears to be no way to get inside the quotes.

You're correct, there is no way to get inside the double qoutes in sendmail
short of having the source and fixing it yourself.  That's not out of the
question since 5.61 and IDA are both available but there is another alter-
native (see below).

>	Does anyone have any suggestions for getting around this
>problem?  What I would really like is info on how to get inside the
>quotes, but I'm open to other suggestions as well.  Thanks in advance
>for any help.

The problem exists in sendmail.  When a user on a VMS machine sends mail
through a DECnet/Internet gateway and uses an address such as

	To: GATEWAY::"address-spec"

sendmail doesn't strip off the double quotes.  I had the same problem
a while back and a kind person from DEC sent me a patched version that
takes care of it.  I'm willing to send out uuencoded versions to people
who want it; if there is sufficient interest, I'll make it available for
anonymous FTP.

BTW, this was *supposed* to be fixed in 3.1 but apparently isn't so don't
think that it will go away if you upgrade.
--
Leonard J. Peirce               Internet:  peirce@gumby.cc.wmich.edu
Western Michigan University                peirce@gw.wmich.edu
Academic Computer Center        UUCP:      ...!uunet!sharkey!wmichgw!peirce
Kalamazoo, MI  49008            Phone:     (616) 387-5469

This is STILL the Al Franken Decade.....

peirce@gumby.cc.wmich.edu (Leonard J. Peirce) (12/06/89)

In article <922@gumby.cc.wmich.edu> I wrote:
>In article <71@ucunix.SAN.UC.EDU> rainwatr@ucunix.san.uc.edu (Don Rainwater) writes:
>>	Does anyone have any suggestions for getting around this
>>problem?  What I would really like is info on how to get inside the
>>quotes, but I'm open to other suggestions as well.  Thanks in advance
>>for any help.
>
>The problem exists in sendmail.

I'm not sure what I was thinking at the time but this is wrong.  The problem
is in /usr/etc/mail11dv3, *not* sendmail.  I knew that when I posted before
but I mistakenly said sendmail; it's been a while since I had to deal with
it.  Mondays are hell......

Anyway...

/usr/etc/mail11dv3 is the actual culprit.  And I do have a copy that works
if anyone wants it.  Everyone who asked for the patched version of sendmail
will instead get a patched /usr/etc/mail11dv3.

BTW, I also have a fixed version of sendmail if anyone wants it.  It fixes
a problem with having hosts first in /etc/svcorder and resolving outgoing
mail to MX'd sites.  I must have been thinking about this the other day.
Sigh....
--
Leonard J. Peirce               Internet:  peirce@gumby.cc.wmich.edu
Western Michigan University                peirce@gw.wmich.edu
Academic Computer Center        UUCP:      ...!uunet!sharkey!wmichgw!peirce
Kalamazoo, MI  49008            Phone:     (616) 387-5469

This is STILL the Al Franken Decade.....

litwack@dccs.upenn.edu (Mark Litwack) (12/07/89)

Check out the DEC Ultrix Mail Connection if you want to hide All-in-1
users behind Internet addresses.  It allows an Ultrix machine to talk
directly to the message router on a VMS machine.

We've been using it here now for about a year with some local modifications.

Anything's better than trying to get sendmail to deal with quotes.  I've
tried and it isn't pleasant.

-mark

vixie@decwrl.dec.com (Paul A Vixie) (12/29/89)

There is not a good way to get inside of quoted strings.  To sendmail's
parser, a "quoted string" looks like a single token, which means that it
will for example match $- and show up in $1 or whatever.  This is a boon
if you are trying to encapsulate a very-foriegn address in a way that
guarantees that sendmail will leave it alone.  It is a pain when you want
to poke at the address.

Standard sendmail has an "s" mailer flag that lets you strip off the
quotes when you submit the message to an outgoing mailer.  One thing you
could do as a workaround is to submit to a mailer that just reinvoked
sendmail in its A=; if you said M=s, the next round of sendmail process-
ing would not see the quotes.  This is a performance hog as well as very
inelegant.

I was running into this same problem on the DECWRL gateway recently, and
my solution was to hack the sendmail source (which is freely available
from Berkeley, UUNET, DECWRL, and a lot of other places).  What I did was
to notice, at the end of a given rule, that the address being rewritten
had dwindled to a single argument and that that argument was a quoted
string.  In that event I strip off the quotes and re-tokenize the result.
Since DECnet/mail11 insists on sending me things like DECWRL::"foo@baz",
quotes and all, it fell to me only to strip off the DECWRL:: and my hacked
sendmail binary pulled off the quotes automagically.

Don't try this at home :-)..

Paul Vixie
DEC WRL
--
Paul Vixie
Work:    vixie@decwrl.dec.com    decwrl!vixie    +1 415 853 6600
Play:    paul@vixie.sf.ca.us     vixie!paul      +1 415 864 7013