Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!dmr.asa.com!sean From: sean@dmr.asa.com (Sean Baker) Newsgroups: comp.mail.mh Subject: Re: Checking if recipient is on To: or Cc: list Message-ID: <394.675710593@smb> Date: 31 May 91 17:23:13 GMT Sender: rwh@ucbvax.BERKELEY.EDU Reply-To: sean@dmr.asa.com Organization: The Internet Lines: 79 Sean, In your letter dated Thu, 30 May 91 12:58:14 PDT, you wrote: >I'm trying to do some maildelivery stuff, and I have a >function that I'd like to perform only if the recipient is >in the To: list of addresses. So why not use To foo file ? mail/foo >If I have not made myself clear as to what I'm asking, please let me know >and I'll try to clarify. Please do. Regards, Neil. Neil, In a way, this would work. But, ideally, this is what I would like to do: Have an entry in the .maildelivery file that says: X-Testheader "doprogram" pipe R "program" So, if a message comes in with the following header: X-Testheader: doprogram nocc The program would run, parse the X-Testheader body, and find the "nocc" directive. The program would then figure out if the user is in the To: or Cc: list. In this case, if the user is on the To: list, no problem. If the user is on the Cc: list, the program would exit. If the header were this: X-Testheader: doprogram cc and the user is on the Cc: list, the program would run normally. In other words, I'd be sending this message out to many users, but I want to be able to say "run this program for the people on the To: list only", or, "run this program for every recipient." So, the question is, is there a reliable way for the program to figure out if the user is on the To: or Cc: list? So far, I'm inclined to say no, simply because the actual address text in the To: and Cc: lines could be almost anything. E.g., I get messages where my address is: Sean Baker S-Baker@DMR.ASA.COM S-Baker sean@DMR.ASA.COM Sean M. Baker smb@DMR.ASA.COM All of which are accepted because of aliasing (I'm using MMDF as the MTA, by the way). From the looks of these addresses, there doesn't seem to be a reliable way to do what I want to do. However, I think I may be able to use your example to get the job done, by using the following: To foo pipe R "program to" Cc foo pipe R "program cc" And then let the program check the X-Testheader: header for the "doprogram" directive. The only problem with this is that I'd be piping every message I receive into the program. Any other suggestions or comments are welcome. Thanks for your help, Sean.