Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 214403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:22:16+00:00 2026-05-11T18:22:16+00:00

I try to store a draft e-mail via IMAP to a folder running on

  • 0

I try to store a draft e-mail via IMAP to a folder running on MS Exchange. Everything ok, except that Bcc recipients don’t get shown in the draft message stored on the server. Bcc recipients also don’t receive the email if I send it with MS Outlook. If I read the message back with Python after I have stored it on the server, I can see the Bcc in the draft.

The following Python code reproduces this behavior:

import imaplib 
import time 
from email.MIMEMultipart import MIMEMultipart 
from email.MIMEText import MIMEText 

message = MIMEMultipart() 
message['Subject'] = 'Test Draft' 
message['From'] = 'test@test.net' 
message['to'] = 'test@test.com' 
message['cc'] = 'testcc@test.com' 
message['bcc'] = 'testbcc@test.com' 
message.attach(MIMEText('This is a test.\n')) 

server= imaplib.IMAP4('the.ser.ver.ip') 
server.login('test', 'test') 
server.append("Drafts" 
              ,'\Draft' 
              ,imaplib.Time2Internaldate(time.time()) 
              ,str(message)) 
server.logout() 

If I run this code, a draft gets stored into the Draft folder on the Exchange Server. But if I look at the draft with MS Outlook, it does not include the bcc recipient (message['bcc'] = 'testbcc@test.com'). Message, to, from, cc ok, no error.

If I download drafts that already include a bcc from an Exchange folder, I can also see the bcc. Only uploading doesn’t work for me.

Any help very much appreciated. Thanks. BTW, MAPI is not an option.

Update: X-Receiver didn’t work for me. As for playing around with an IMAP-Folder in Outlook, I got an interesting result. If I access the draft via the IMAP-Folder in Outlook, I see the bcc. But if I access it via the MAPI-Folder, I don’t see it. Will play a little bit around with that.

Conclusion: Actually, the code works just fine. See below for the answer that I found.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:22:17+00:00Added an answer on May 11, 2026 at 6:22 pm

    Actually, the code works just fine. It creates the proper mail with all the right headers including bcc.

    How does the mail client display bcc?

    The mail client (e.g. Python or MS Outlook via IMAP or MAPI in my case) decides whether and how to display bcc-headers. Outlook for example doesn’t display bcc headers from an IMAP folder. This is a feature to hide bcc recipients from each other where they have not been stripped away from the mail before (it is not clear from the standard whether one bcc recipient is allowed to see all other bcc recipients or not, see Wikipedia).

    Who handles bcc upon sending an email?

    Suppose now that we have drafted a message in a mail client and stored it in an IMAP or MAPI folder. The server providing the IMAP / MAPI folders leaves the draft message unchanged. What happens to the bcc-headers upon sending the mail is implementation dependent, and might depend both on the mail client and the mail transfer agent (e.g. MS Exchange Server in my case). In a nutshell, people do not agree whether the mail client or the mail transfer agent is reponsible for removing bcc headers. It seems however to be the case that a majority of developers is of the opinion that it is the mail client’s business with the mail transfer agent not touching the mail (e.g. MS Exchange, MS SMTP, Exim, OpenWave). In this case, the mail transfer agent sends the email to the recipient as defined in the RCPT TO: of the SMTP communication, and leaves the email unchanged otherwise. Some other mail transfer agents strip bcc headers from emails however (e.g. sendmail, Lotus Notes). A very thorough discussion can be found on the Exim mailing list starting here.

    In the case of MS Outlook and MS Exchange, MS Outlook never sends bcc (but sends individual emails for each bcc recipient) and MS Exchange does not touch the email headers, but sends the full email (possibly including bcc recipients) to the recipients defined in RCPT TO:.

    Conclusion

    I did not understand that there is no guaranteed behavior for bcc, and that usually the client handles bcc. I will rewrite my Python code to loop over bcc recipients and generate one email for each bcc recipient.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 98k
  • Answers 98k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Do you want to read (query) the data in a… May 11, 2026 at 7:38 pm
  • Editorial Team
    Editorial Team added an answer Looks like a custom field. Your choices with built-in fields… May 11, 2026 at 7:38 pm
  • Editorial Team
    Editorial Team added an answer Excel rocks for importing data. You can quickly edit, troubleshoot,… May 11, 2026 at 7:38 pm

Related Questions

I'm looking for best practices for establishing connections between Oracle 8 and Visual Studio
I'm using Windows Forms and VS2008. I want to store an enum value in
In a C function called from my Lua script, I'm using luaL_ref to store
I am developing a PHP-based login system. Each user has an ID(a number) and
I have a collection of polymorphic objects, all derived from my Animal class: Cat,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.