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
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