fdm
fdm copied to clipboard
Fix delivery to Exchange IMAP
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.
2007 was a long time ago, I think we need to know if this causes problems with newer versions.
On Fri, 22 Mar 2019, 06:34 Filip Matijević, [email protected] wrote:
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.
You can view, comment on, or merge this pull request online at:
https://github.com/nicm/fdm/pull/60 Commit Summary
- Fix delivery to Exchange IMAP
File Changes
- M deliver-imap.c https://github.com/nicm/fdm/pull/60/files#diff-0 (4)
- M fetch.h https://github.com/nicm/fdm/pull/60/files#diff-1 (1)
- M imap-common.c https://github.com/nicm/fdm/pull/60/files#diff-2 (7)
Patch Links:
- https://github.com/nicm/fdm/pull/60.patch
- https://github.com/nicm/fdm/pull/60.diff
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nicm/fdm/pull/60, or mute the thread https://github.com/notifications/unsubscribe-auth/AASkcxLSk8CSj2sv85vLljRQ_TqnewR5ks5vZHkbgaJpZM4cC7kM .
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.
Exchange 2007 was EOL two years ago so I wouldn't be too worried about it. But I would be concerned this will break newer versions if they have fixed it.
On Fri, 22 Mar 2019, 07:49 Filip Matijević, [email protected] wrote:
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.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nicm/fdm/pull/60#issuecomment-475524346, or mute the thread https://github.com/notifications/unsubscribe-auth/AASkc_72cjgpz_EJf2E9CarIapWWWJxOks5vZIsFgaJpZM4cC7kM .
I've rewritten the workaround so it's only active if FDM_EXCHANGE_VERSION=2007 is set in the env. Review is appreciated.
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.
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.