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

Fix delivery to Exchange IMAP #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

filippz
Copy link

@filippz filippz commented Mar 22, 2019

When I try to deliver messages to my MS Exchange 2007 via IMAP the whole thing stops when doing APPEND since Exchange doesn't reply with OK APPEND completed., and after some time the timeout occurs. This seems to be caused by the fact that Exchange (for whatever reason) expects one more additional character to be sent in APPEND. The workaround I've made simply reduces message length by 1 when we're storing to Exchange IMAP. I do have two things to note:

  • detection of Exchange IMAP is done by simply looking for the string Exchange in greeting message from server and the result is stored together with the values reported by CAPABILITY
  • I have only 2007 version at hand so I'm not sure how other Exchange versions behave.

@nicm
Copy link
Owner

nicm commented Mar 22, 2019 via email

@filippz
Copy link
Author

filippz commented Mar 22, 2019

Yes, 2007 is rather old, and I can't really think of a way to detect which version of Exchange we're connected to (hence the clumsy looking at the greeting message). So even if there is difference between IMAP implementations between Exchange versions I'm not sure how would that be handled in code. I'll try to see if I can get my hands on some other version for test.

Possible solution is to use some other means of activating workaround - I'm okay with using getenv to detect the presence of environmental variable (for example FDM_EXCHANGE_QUIRKS = 2007) That (probably) won't break anything.

@nicm
Copy link
Owner

nicm commented Mar 22, 2019 via email

Set env FDM_EXCHANGE_VERSION=2007 to activate workaround
@filippz
Copy link
Author

filippz commented Mar 22, 2019

I've rewritten the workaround so it's only active if FDM_EXCHANGE_VERSION=2007 is set in the env.
Review is appreciated.

@nicm
Copy link
Owner

nicm commented Mar 25, 2019

This looks OK, but think it would be better as an option on the deliver imap line in the config, like no-login and no-cram-md5. However, TBH I don't want to add something like that without some knowledge of how later Exchange versions behave. If this is only a problem with 2007, then I would be inclined not to bother with it at all. If later versions are also affected then it would be worth having a config option.

@filippz
Copy link
Author

filippz commented Mar 25, 2019

Agreed - trouble is I don't have access to any other Exchange version, so I don't have any way of testing if this is 2007 specific. Still, we can use this workaround "as is" and if it at some point proves to be needed on other Exchange version, we can rework it to be activated via mentioned config line instead of env variable.

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

Successfully merging this pull request may close these issues.

2 participants