in reply to Getting BCC: header from a message.

That's the whole point about "Bcc": it doesn't show up in the recipients' message. (Hence the "blind" part!)

You can try looking for an "Apparently-To" header, although not every agent will add that. Or you can try parsing through the "Received" headers.

HTH

  • Comment on Re: Getting BCC: header from a message.

Replies are listed 'Best First'.
Re: Re: Getting BCC: header from a message.
by unixdown (Scribe) on Jun 29, 2001 at 19:50 UTC
    Yea, I understand why it is called Blind Carbon Copy, but how would sendmail handle this? There is absolutly nothing in the headers that would allow me to trace where it should go. How should I forward this mail? I would hate to dump 20,000+ aliases in the sendmail alias file. That just seems like it would bloat sendmail and make it drag its knees. Plus we would have to re-write the email forwarding system to work with the sendmail aliases file, and we are trying to avoid that. Any suggestions for a semi-easy fix?
      As VSarkiss says, you may need to parse the first (i.e. most recent-- assuming you haven't already used sendmail after receiving the mail from the outside world) "recieved" header
      Received: from mail.fromdomain.com (localhost [127.0.0.1]) by mail.domain.com (x.x.x/x.x.x) with ESMTP id Mxxxxxx for <user_ID@domain.com>; Fri, 29 Jun 2001 01:23:45
      for the <user_ID@domain.com> since that should have the name of the mailbox the email is intended for.
        This works to a point. If CC is used, this won't work (the Received Header does not contain the "for"). If there is more than one address in the BCC field, only the first is in the received header. (This is all after sendmail forwards the mail to the program. I'm sure its doing some type of manipulation before it hits my mail forwarder.)