Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!linac!att!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal L. Schwartz) Newsgroups: comp.mail.sendmail Subject: Re: Envelope-To and Envelope-From in PROG mailer? Message-ID: <1991May24.143629.17892@iwarp.intel.com> Date: 24 May 91 14:36:29 GMT References: <1991May23.195333.27759@iwarp.intel.com> <1991May23.212448.8455@mp.cs.niu.edu> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal L. Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 75 In-Reply-To: rickert@mp.cs.niu.edu (Neil Rickert) In article <1991May23.212448.8455@mp.cs.niu.edu>, rickert@mp (Neil Rickert) writes: | In article <1991May23.195333.27759@iwarp.intel.com> merlyn@iwarp.intel.com (Randal L. Schwartz) writes: | >I don't seem to see any way to get the Envelope-To and Envelope-From | >in a PROG mail delivery agent in a stock sendmail with more-or-less | >standard sendmail.cf's. I've checked the environment and the command | >line arguments. (No, I don't have quick access to the sources.) | > | >(1) is there something I'm overlooking? | | It would help if you explained the REAL problem that is causing you to | ask this question. | | When the program mailer gets hold of your message, the envelope sender | should be on the unix 'From ' line which will be the first line of | standard input. The envelope recipient by now is exactly the name of the | program command you are using. You probably should know what that is! | My guess is that you wanted the envelope recipient before aliasing. But | you can't get that, since the purpose of aliasing is to completely replace | the envelope recipient with the alias. However if you control the alias | file, you can always put the desired information somewhere into the | command line in the alias. | | More than likely the question arose from a simple problem for which there | is a straightforward solution. But you will have to tell us the problem | before we can give you the solution. Thanks for all the answers so far. But yours hit the nail on the head. I didn't realize that the envelope-FROM was in the first line. Amazing. That was too simple. Right now, I have a PROG mail agent parsing all the headers to get the "From:" and "Reply-to:" address. However, I hotwired my sendmail.cf in ruleset 0 so that "user.foo" is delivered to "user", via the following declarations (in ease): field something: match(1*); [...] /* remaining names must be local */ /* protect filenames from subfunction interpretation */ if ("/" something) resolve(mailer(local), user("/" $1)); /* allow username.subfunction, ala Andrew */ if (something "." something) resolve(mailer(local), user($1)); /* and the rest... */ if (something) resolve(mailer(local), user($1)); so I can get mail delivered to "merlyn.server" delivered to me. Now, I wanted a quick way to know that the original address was "merlyn.server", without relying on parsing the "to:" and "cc:" addresses (because one of them could have been a system alias that expanded to merlyn.server). But I can see the problem on two counts: (1) yes, after aliasing to the PROG mailer, the "envelope to" really is the name of my program, and (2) from the rule above, "user" is "merlyn", not "merlyn.server". Ugh. So, I'm heading down the wrong dark alley, about to get my throat cut, eh? :-) Sigh. Hmm... can I pass a token via "host" to "local", and use that as an argument in my /bin/sh invocation? I've already hacked it a bit... would hacking it a bit more reek of a bigger kludge (but would it get the job done anyway? :-). Thanks mucho so far. Just another sendmail.cf hacker (but maybe not a very good one :-), -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/