in reply to Re: Getting BCC: header from a message.
in thread Getting BCC: header from a message.

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?
  • Comment on Re: Re: Getting BCC: header from a message.

Replies are listed 'Best First'.
Re: Re: Re: Getting BCC: header from a message.
by davorg (Chancellor) on Jun 29, 2001 at 20:05 UTC
(ichimunki) Re x 3: Getting BCC: header from a message.
by ichimunki (Priest) on Jun 29, 2001 at 20:15 UTC
    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.)
        The "envelope-to" is not in the header reliably anywhere. It's in the envelope. If you can't get an envelope-to out-of-band somehow, then you cannot complete your task reliably, and you'll need to back up a step to figure out how to do it instead.

        This is why I hacked sendmail so that envelope-to was available to my .procmailrc as $1. It shows up under Joey Pruett's name because he was the one that submitted the modifications to the sendmail crew.

        -- Randal L. Schwartz, Perl hacker