-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement better detection of "multipart/encrypted" email with PGP encrypted message #2580
Comments
@sosnovsky I think better to finish this task first and then release current 1.3.1 version? |
Yes, after fixing this one we can publish a new release to App Store and switch back to |
@sosnovsky I don't have task assigned for iOS at the moment as you plan to migrate to Swift6 in the future. Do I have to move on browser extension? |
Oh, I've missed that this one was assigned to Mart, re-assigned it to you |
Okay, I see |
@martgil I can reproduce this issue in iOS app with email flowcrypt.compatibility account. |
Hi @ioanmo226, I'll try if I can craft one for you. Reason is that, the particular test email we have was just sent by the user and haven't had the chance to know to generate one for ourselves that time. |
Hello @ioanmo226 - I can't seemed to craft a test email for this one easily, may I ask for a little more time. Upon reviewing, it possibly be able to craft such email by using Enigmail in Thunderbird but upon testing, the Enigmail extension is no longer available and supported by Thunderbird Client. My plan is to craft and send a mime email that contains the following format in the test email from: FlowCrypt/flowcrypt-browser#5726, in which, it has "multipart/encrypted" part that has 2 attachment of the following: 1.)
|
I see. Thank you |
Hello @ioanmo226, there's some bad news here. I'm unable to generate such email even after making such similar mime email. I'm using the python (3.11.9) code below, while it sends similar mime email and being recognizable by FlowCrypt, the decryption fails: import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email import encoders
# Email account credentials
sender_email = "[email protected]"
recipient_email = "[email protected]"
password = "app specific password" # this canbe obtained in https://myaccount.google.com/apppasswords
boundary = "----=_Part_7_39145192.1715228097793"
msg = MIMEMultipart("encrypted", boundary=boundary)
msg["From"] = sender_email
msg["To"] = recipient_email
msg["Subject"] = "test multipart/encrypted"
msg["MIME-Version"] = "1.0"
pgp_encrypted_part = MIMEBase("application", "pgp-encrypted")
pgp_encrypted_part.add_header("Content-Transfer-Encoding", "7bit")
pgp_encrypted_part.set_payload("Version: 1")
# The email.txt contains ascii armored pgp encrypted email similar to the sample email in flowcrypt.compatibility
with open("email.txt", "r") as file:
encrypted_message = file.read()
pgp_data_part = MIMEBase("application", "octet-stream")
pgp_data_part.add_header("Content-Transfer-Encoding", "7bit")
pgp_data_part.set_payload(encrypted_message)
msg.attach(pgp_encrypted_part)
msg.attach(pgp_data_part)
# Send the email via Gmail's SMTP server
with smtplib.SMTP_SSL("smtp.gmail.com", 465) as server:
server.login(sender_email, password)
server.sendmail(sender_email, recipient_email, msg.as_string())
print("Email sent successfully.") |
You mean that test email was recognized by Flowcrypt which means Flowcrypt knows it is PGP but can't decrypt that email? |
Yes, that's what is happening in the test email generated using the python script when opened through the FlowCrypt browser extension. |
I see. |
If I remember it correctly, what I did there was just to replace the sensitive infos like exact email subject and sender while retaining the format for a "multipart/encrypted" mime email. |
…PGP encrypted message (#2643) * fix: better detection of multipart encrypted email * feat: added ui test * fix: pr reviews
Description: The FlowCrypt iOS didn't recognize "multipart/encrypted" email with PGP encrypted message. Emails at https://mail.google.com/mail/u/[email protected]/#inbox/FMfcgzGxTFXMFnDNbgknpqvXKtSmMgSK isn't recognized by the FlowCrypt app and shows not encrypted + no signed blank email thread.
Reference:
The text was updated successfully, but these errors were encountered: