Skip to content
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

APPEND command error: BAD ['invalid rfc5322 message: Sender should not be present if equal to From'] #733

Open
majorminors opened this issue Aug 26, 2023 · 5 comments

Comments

@majorminors
Copy link

majorminors commented Aug 26, 2023

General informations

  • system/distribution (with version): Ubuntu 22.04 LTS
  • offlineimap version (offlineimap -V): offlineimap v7.2.3, imaplib2 v2.57 (system), Python v2.7.18, OpenSSL 1.1.1f 31 Mar 2020
  • Python version: Python v2.7.18 (from offlineimap -V output)
  • CLI options: nil
  • server: Proton Mail

Configuration file offlineimaprc

[general]
accounts = proton
pythonfile = /path/to/a/password/function.py

[Account proton]
localrepository = proton-local
remoterepository = proton-remote

autorefresh = 0.2

quick = 10

postsynchook = notmuch new

[Repository proton-local]
type = Maildir
localfolders = /path/to/maildir

sync_deletes = yes

[Repository proton-remote]
type = IMAP
remoteport = 1143
remotehost = 127.0.0.1
remoteuser = username@example.com
remotepasseval = get_pass()

keepalive = 60
holdconnectionopen = yes

expunge = yes

folderfilter = lambda foldername: foldername not in ['Labels.', 'Labels']

ssl = no

pythonfile (if any)

import sys

pwd = 'proton bridge password'

if len(sys.argv) == 1:
def get_pass():
return pwd
elif sys.argv[1] == 'mutt':
print('set imap_pass=' + pwd)
else:
print('error')

Logs, error

...
Folder Trash [acc: proton]: Copy message UID -1 (1/1) proton-local:Trash -> proton-remote:Trash ERROR: Saving msg (<ADDRESS>) folder 'Trash', repo 'proton-remote'failed (error). Server responded: APPEND command error: BAD ['invalid rfc5322 message: Sender should not be present if equal to From']. Data: PDBB24 APPEND Trash () "25-Aug-2023 19:04:11 +0100" {102363}

Message content was:

<prints select header info and most if not all of the content for the offending email>
...

Steps to reproduce the error

Run offlineimap (with no CLI options) after using mutt to move an email from INBOX to any other folder. In this case, to Trash.

From and Sender are indeed equal, more or less. In this case:
From: "Substack" on@substack.com
Sender: Substack on@substack.com

This error will also occasionally stop offlineimap from syncing. I think this has something to do with it printing the mail contents, but I haven't quite worked out what does this. It didn't happen in the current case.

If I manually delete the sender line from the email, then offlineimap returns to work normally.

I am assuming this is some issue with protonmail thinking that offlineimap is trying to give it a badly formatted email so perhaps the fault is with badly formatted emails. Just wondering if there's something I can do to stop this from happening without manually locating and deleting the sender line in these cases.

@majorminors
Copy link
Author

Oh, I have just noticed there is an offlineimap3, so I'll probably install that and see if this fixes the problem. If there's interest in addressing this, I will happily help out though.

@majorminors
Copy link
Author

majorminors commented Aug 28, 2023

Same issue on offilineimap3. Posted as issue 159.

@ploum
Copy link

ploum commented Sep 10, 2023

Same problem here.

@majorminors
Copy link
Author

This appears to have resolved itself for offlineimap3 (see here). I don't have offlineimap anymore, so I can't confirm that it's resolved here, and I'll leave the issue open for you lot to triage as you see fit.

@ploum
Copy link

ploum commented Dec 21, 2023

AFAIK, the issue has been solved on the proton bridge side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants