Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

How to extract mail_ids from bcc field

by jesuashok (Curate)
on Jul 06, 2007 at 06:36 UTC ( #625202=perlquestion: print w/replies, xml ) Need Help??
jesuashok has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks,

I suspect this could be slightly off-topic. apologies if so.

We have a written a script which will extract mail id(s) from TO and CC field ( by accessing the mail client only, no connection with the mail server ). I have to enhance this script to extract mail id(s) from BCC field.
=> firt of all is it possible to extract the informations available in BCC field ? If so, I presume I need to connect to the mail server to extract the information. correct me If I am wrong.

If anyone of you did such assignments in your time, Please guide me with your input(s).

i m possible

Replies are listed 'Best First'.
Re: How to extract mail_ids from bcc field
by vcTheGuru (Chaplain) on Jul 06, 2007 at 07:58 UTC

    I think this could be slightly off-topic, but worth answering.

    If your program is reading mails from "Sent Items" you can extract Bcc info like other fields (To & Cc)

    In the second case where your program is reading mails from "reader's" end(i.e. the client has received the mail and you're trying to see who else the mail was sent to) You Can NOT get info. See the RFC 2821 for SMTP. The relevant part is quoted below.

    7.2 "Blind" Copies.

    Addresses that do not appear in the message headers may appear in the RCPT commands to an SMTP server for a number of reasons. The two most common involve the use of a mailing address as a "list exploder" (a single address that resolves into multiple addresses) and the appearance of "blind copies". Especially when more than one RCPT command is present, and in order to avoid defeating some of the purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy the full set of RCPT command arguments into the headers, either as part of trace headers or as informational or private-extension headers. Since this rule is often violated in practice, and cannot be enforced, sending SMTP systems that are aware of "bcc" use MAY find it helpful to send each blind copy as a separate message transaction containing only a single RCPT command.

    There is no inherent relationship between either "reverse" (from MAIL, SAML, etc., commands) or "forward" (RCPT) addresses in the SMTP transaction ("envelope") and the addresses in the headers. Receiving systems SHOULD NOT attempt to deduce such relationships and use them to alter the headers of the message for delivery. The popular "Apparently-to" header is a violation of this principle as well as a common source of unintended information disclosure and SHOULD NOT be used.

    Connecting the servers also won't work as the Bcc is handled by the "Sending" server. You may get Bcc info, if the sending server is NOT sticking to the RFC.


Re: How to extract mail_ids from bcc field
by tirwhan (Abbot) on Jul 06, 2007 at 07:33 UTC
    I suspect this could be slightly off-topic

    And I suspect there may be faulty reasoning in there somewhere. You fail to specify whether you are trying to extract the Bcc field from messages which have been sent or received. If the former (i.e. you're extracting the headers from mails in the clients "Sent" box), it should work exactly the same way you're already extracting the other headers. If the latter (i.e. the client has received the mail and you're trying to see who else the mail was sent to) I suggest you sit back and reflect on the purpose and implementation of the Bcc field (repeated blows to the head with a blunt object may aid in this reflection).

    All dogma is stupid.
      Hi, I have used a shorcut key in lotus notes 3 yrs back, which helped me check the names of the person in BCC where in the email was marked to me 2 more persons. I was able to trace it was actually sent to approx 7 people. But currently I am unable recolloect the shortcut key. Will surely try to trce and revert. If you get an answer for the same do revert.
        Hi, Could you pls mail me if u get any details on how to get the e mail ID's from BCC field. I have received a e mail want to know to whom and all its marked. my e mail id is
        Hi, if you could recollect those steps pls forward the same to my personal id,, i suspect, which ever mail i receive from my colleague all are marked bcc, I would like to view those.. pls help me out... thanks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://625202]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2017-08-18 05:25 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (294 votes). Check out past polls.