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

  • SEARCH
  • Home
  • 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 8675169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:53:09+00:00 2026-06-12T19:53:09+00:00

I am writing a tool that is able to backup and restore emails in

  • 0

I am writing a tool that is able to backup and restore emails in Gmail via IMAP in python.
In some case the emails that are backed up from Gmail contain weird characters: ^@ that then cannot be reingested by Gmail IMAP.

Delivered-To: xxxxx@lxxxxxx
Received: by 1x.xx.xx.xx with SMTP id jjjjjjjj;
        Tue, 14 Jun 2011 16:56:26 -0700 (PDT)
Received: by x.x.x.x with SMTP id xxxx.xxx;
        Tue, 14 Jun 2011 16:56:16 -0700 (PDT)
Return-Path: <foo.bar@email.com>
Delivery-Date: Mon, 23 Aug 2010 17:58:56 +0200
Received: from xxxxx (xxxxx [x.x.x.x])
    by xxxx (node=xxx) with ESMTP (xxx)
    id xxx ; Mon, 23 Aug 2010 17:58:56 +0200
Received: from [x] (x)
    by x (x) with x (x)
    id x; Mon, 23 Aug 2010 17:58:50 +0200
Message-ID: <x@foo.com>
Date: Mon, 23 Aug 2010 17:58:48 +0200
From: Foo Bar <foo.bar@email.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.8) Gecko/20100802             Thunderbird/3.1.2
MIME-Version: 1.0
To: bar.foo@email.com <x>
Subject: The subject
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
X-Provags-ID: xxxxxxxxxxx=
Envelope-To: foo.bar@email.com


  Hello All,

blah blah blah


^@

At the end their is this special character. Sometimes it appears in other emails in the middle.
When I store the email on disk (eml format) I just save it and revive it.

The encoding seems correct.

What is this character ?
Am I doing something wrong when I store the email in eml.

A bit of guidance would be appreciated.

Thanks.

  • 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-06-12T19:53:11+00:00Added an answer on June 12, 2026 at 7:53 pm

    Short answer: You can strip null characters from the body of the email prior to sending them back to Google.**

    Longer answer:

    Old email (according to RFC 822) was allowed to have null characters. New email (according to RFC 2822, circa 2003) is not allowed to have null characters. Note RFC 2822 reads: “Differences from earlier standards… ASCII 0 (null) removed.”

    It’s entirely possible that Gmail accepts 822-style emails via SMTP (that’s how the email first got to your inbox) but only 2822-style emails via IMAP (which is why you can’t put it back via IMAP).

    ** Note: Don’t blindly strip nulls from MIME documents included in the email. RFC 2822 “specifies that messages are made up of characters in the US-ASCII range of 1 through 127. There are other documents, specifically the MIME document series [RFC2045, RFC2046, RFC2047, RFC2048, RFC2049], that extend [RFC 2822] to allow for values outside of that range.”

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

Sidebar

Related Questions

I'm writing a GUI tool using PowerShell that is able to do most AD
I'm writing some code (Python, but really isn't important) that analyzes strings inside PE
I'm actually writing a templating tool that will be able to read a test
I'm writing a testing tool that requires known traffic to be captured from a
We're writing a diagnostic tool that needs to run for many hours at a
I'm writing a tool in Perl that needs to scan for certain binary patterns
For kicks I'm writing a schema documentation tool that generates a description of the
I'm writing a small visualization tool in wpf, the idea is that average users
I am writing one tool and I need to gather some information about running
I am writing a tool to scrape Javadoc from pre-existing Java source files and

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.