🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.sendmail
Article #3436

Re: Getting inside the quotes in sendmail...

#3436
From: Paul A Vixie
Date: Fri, 29 Dec 1989 04:30
32 lines
2170 bytes
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
Technical Details
Message-ID: <VIXIE.89Dec28203003@vixmax.pa.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!sun-barr!decwrl!vixie
References: <71@ucunix.SAN.UC.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!sun-barr!decwrl!vixie
From: vixie@decwrl.dec.com (Paul A Vixie)
Newsgroups: comp.mail.sendmail,comp.unix.ultrix
Subject: Re: Getting inside the quotes in sendmail...
Message-ID: <VIXIE.89Dec28203003@vixmax.pa.dec.com>
Date: 29 Dec 89 04:30:03 GMT
References: <71@ucunix.SAN.UC.EDU>
Sender: news@decwrl.dec.com
Followup-To: comp.mail.sendmail
Organization: DEC Western Research Lab
Lines: 32
In-reply-to: rainwatr@ucunix.SAN.UC.EDU's message of 1 Dec 89 17:10:48 GMT