Coding Phase - Week 4 Report

Goals Achieved

  • Installed IMAP and its requirements and made the first IMAP connection in the plugin (SSL/TLS) (I will add another security layer command, STARTTLS, but only after reading about it well and testing it enough.).
  • Added the manual connection screen.
  • I read about RFC 822, the message email format, and the message parser behavior.
  • I have done a stress test for more than one email provider, which is to monitor the mailbox every 5 seconds if there is a new message from a specific email to check that there is no security problem that could have arisen.

Next week

  • Creating an error alarm, a warning alarm when an error is caused while logging
  • Create the Main Screen
  • Fetching & monitoring based on 'from'.
  • During this week, I will post in the forum an addition that I would like to get your opinion on :grinning:, and it is related to the conversion of emails, including attachments, to notes without logging into a plugin and without any external programs and Is it worth adding this feature or not :thinking:



could you summarize it?

yes sure

The RFC 822 specification defines an electronic message format, and this format is what I will receive from IMAP. It contains everything related to the message: headers (from, to, cc, etc.), text, images, media, and attachments.

This format deals with embedded images or attachments by the cid (content-id). Each image or attachment has a unique cid and this contains everything related to the image or attachment, from type, size, and the type of encoding of that attachment, like Base64.

Each content is separated from the other by a boundary that is specified at the beginning of the message.


------------ An example of the header content: -----------------------

Received: by 2002:a05:7110:70c2:b0:188:87bb:ab55 with SMTP id k5csp2160218geh;
Date: Sun, 3 Jul 2022 17:03:42 +0300 (MSK)
Message-ID: <>
Subject: Codeforces Round 804 (Div. 2)

------------ An example of the message content: -----------------------

Hi bishoy,
        Welcome to your new account. Outlook lets you stay conn=
ected, organized, and productive=97at work, at home, and everywhere in betw
Discover a more productive inbox across all your devices
Managing your busy life shouldn't be difficult. With email and calendar in =
just one service, Outlook makes it easy for you to stay on top of it all =
=97 whether you're catching up on conversations, setting up coffee dates, o=
r organizing a weekend trip.

Content-Type: multipart/related;
------------- An example of the cid content: -------------

Content-Type: image/png; name="colors.png"
Content-Description: colors.png
Content-Disposition: inline; filename="colors.png"; size=5306;
	creation-date="Sun, 12 Jun 2022 17:21:36 GMT";
	modification-date="Thu, 30 Jun 2022 12:44:28 GMT"
Content-ID: <colors>
Content-Transfer-Encoding: base64

Content-Type: image/png; name="devices.png"
Content-Description: devices.png
Content-Disposition: inline; filename="devices.png"; size=94183;
	creation-date="Sun, 12 Jun 2022 17:21:36 GMT";
	modification-date="Thu, 30 Jun 2022 12:44:28 GMT"
Content-ID: <devices.png>
Content-Transfer-Encoding: base64


-----------------------HTML formate------------------------
html content
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit

and so on

It also has other large amounts of information about the message, like ARC-Seal, ARC-Message-Signature, and other complex information.

I will pass this format to the parser and I will get an object containing the HTML, Text, array of attachments, from, to,...


Make sure you add a few simple tests to check you're getting the right data from the parser, since there are often strange edge cases with these old standards.

1 Like