unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Workaround for Exchange-corrupted PGP/Mime structure
@ 2019-11-20 16:36 Carl Worth
  2019-11-20 18:41 ` Ralph Seichter
  0 siblings, 1 reply; 8+ messages in thread
From: Carl Worth @ 2019-11-20 16:36 UTC (permalink / raw)
  To: Notmuch List

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

I recently received a GPG-encrypted message that notmuch was not able to
handle transparently as I'm used to. (That is, instead of decrypting the
message and verifying the signature inside, etc.—instead I was just
presented with an attachment that contained the encrypted message.)

After some poking around, it appears that the problem is that the
message was sent through Microsoft Exchange which corrupts PGP/mime
structure by changing the outer content-type from "multipart/encrypted"
to "multipart/mixed".

I've verified this bug by sending mail from notmuch through Exchange as
the MTA and it indeed does corrupt the mail in exactly this fashion.

It looks like this bug in Exchange is known[1] and there's evidence of
other MUAs working around the bug[2].

Have other notmuch users encountered this problem?

What would anyone think about a workaround where notmuch-emacs could
grub around inside a "multipart/mixed" structure looking for child parts
that look like they really should have been a part of a
"multipart/encrypted" container?

-Carl

[1] https://social.technet.microsoft.com/Forums/en-US/c5059734-5031-4d82-96eb-c74fe60b5e9e/quotthis-is-a-broken-pgpmime-message-from-msexchangequot

[2] https://gitlab.com/mikecardwell/gpgit/blob/master/gpgit.pl#L108
which also refers to Enigmail having a workaround for thi.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 16:36 Workaround for Exchange-corrupted PGP/Mime structure Carl Worth
@ 2019-11-20 18:41 ` Ralph Seichter
  2019-11-20 19:19   ` David Bremner
  0 siblings, 1 reply; 8+ messages in thread
From: Ralph Seichter @ 2019-11-20 18:41 UTC (permalink / raw)
  To: notmuch

* Carl Worth:

> What would anyone think about a workaround where notmuch-emacs could
> grub around inside a "multipart/mixed" structure looking for child
> parts that look like they really should have been a part of a
> "multipart/encrypted" container?

Personally, I see no reason to spend any effort in Notmuch to fix
whatever Exchange has screwed up this week. Microsoft has more than
enough resources to clean up their own messes, don't you think?

-Ralph

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 18:41 ` Ralph Seichter
@ 2019-11-20 19:19   ` David Bremner
  2019-11-20 20:55     ` Carl Worth
  0 siblings, 1 reply; 8+ messages in thread
From: David Bremner @ 2019-11-20 19:19 UTC (permalink / raw)
  To: Ralph Seichter, notmuch; +Cc: Daniel Kahn Gillmor

Ralph Seichter <abbot@monksofcool.net> writes:

> * Carl Worth:
>
>> What would anyone think about a workaround where notmuch-emacs could
>> grub around inside a "multipart/mixed" structure looking for child
>> parts that look like they really should have been a part of a
>> "multipart/encrypted" container?
>
> Personally, I see no reason to spend any effort in Notmuch to fix
> whatever Exchange has screwed up this week. Microsoft has more than
> enough resources to clean up their own messes, don't you think?
>

There's some recent work by dkg in (currrently unreleased) commits on
master. "git log -Smangled"

d

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 19:19   ` David Bremner
@ 2019-11-20 20:55     ` Carl Worth
  2019-11-20 21:19       ` Carl Worth
  0 siblings, 1 reply; 8+ messages in thread
From: Carl Worth @ 2019-11-20 20:55 UTC (permalink / raw)
  To: David Bremner, Ralph Seichter, notmuch; +Cc: Daniel Kahn Gillmor

[-- Attachment #1: Type: text/plain, Size: 271 bytes --]

On Wed, Nov 20 2019, David Bremner wrote:
> There's some recent work by dkg in (currrently unreleased) commits on
> master. "git log -Smangled"

Thanks, David, and Daniel!

Those commit messages look very useful to me.

I'll update my notmuch and give this a try.

-Carl

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 20:55     ` Carl Worth
@ 2019-11-20 21:19       ` Carl Worth
  2019-11-20 22:10         ` Brian Sniffen
  2019-11-21  2:24         ` Daniel Kahn Gillmor
  0 siblings, 2 replies; 8+ messages in thread
From: Carl Worth @ 2019-11-20 21:19 UTC (permalink / raw)
  To: David Bremner, Ralph Seichter, notmuch; +Cc: Daniel Kahn Gillmor

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

On Wed, Nov 20 2019, Carl Worth wrote:
> I'll update my notmuch and give this a try.

Just a "git pull; make; make install" and my problem went away.

Thanks again for the fixes, Daniel.

-Carl


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 21:19       ` Carl Worth
@ 2019-11-20 22:10         ` Brian Sniffen
  2019-11-21  3:06           ` Daniel Kahn Gillmor
  2019-11-21  2:24         ` Daniel Kahn Gillmor
  1 sibling, 1 reply; 8+ messages in thread
From: Brian Sniffen @ 2019-11-20 22:10 UTC (permalink / raw)
  To: Carl Worth, David Bremner, Ralph Seichter, notmuch; +Cc: Daniel Kahn Gillmor

Carl Worth <cworth@cworth.org> writes:

> On Wed, Nov 20 2019, Carl Worth wrote:
>> I'll update my notmuch and give this a try.
>
> Just a "git pull; make; make install" and my problem went away.
>
> Thanks again for the fixes, Daniel.

Yeah, these have been fantastic for me too.  MSFT has no intention of
fixing PGP or MIME support; it's been well over a decade.  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 21:19       ` Carl Worth
  2019-11-20 22:10         ` Brian Sniffen
@ 2019-11-21  2:24         ` Daniel Kahn Gillmor
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Kahn Gillmor @ 2019-11-21  2:24 UTC (permalink / raw)
  To: Carl Worth, David Bremner, Ralph Seichter, notmuch

[-- Attachment #1: Type: text/plain, Size: 372 bytes --]

On Wed 2019-11-20 13:19:12 -0800, Carl Worth wrote:
> On Wed, Nov 20 2019, Carl Worth wrote:
>> I'll update my notmuch and give this a try.
>
> Just a "git pull; make; make install" and my problem went away.
>
> Thanks again for the fixes, Daniel.

Glad that it worked for you!

(and, thanks for the pointers to the additional documentation of the
problem)

        --dkg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Workaround for Exchange-corrupted PGP/Mime structure
  2019-11-20 22:10         ` Brian Sniffen
@ 2019-11-21  3:06           ` Daniel Kahn Gillmor
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Kahn Gillmor @ 2019-11-21  3:06 UTC (permalink / raw)
  To: Brian Sniffen, Carl Worth, David Bremner, Ralph Seichter, notmuch

[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]

On Wed 2019-11-20 17:10:40 -0500, Brian Sniffen wrote:
> Yeah, these have been fantastic for me too.  MSFT has no intention of
> fixing PGP or MIME support; it's been well over a decade.  

I'm unwilling to accept this situation, and i hope that other people
will join me in exerting pressure on MSFT to fix this.

fwiw, there are versions or configurations of Exchange (or of their
SMTP/submission subsystem) that *do not* introduce this failure, and
I've had some success in getting MSFT to adjust the version or
configuration of Exchange used by some clients that can demonstrate that
their sent mail is being mangled, to the point where the messages are no
longer being mangled.

While i've documented the mangling publicly:

   https://tools.ietf.org/html/draft-dkg-openpgp-pgpmime-message-mangling-00#section-4.1

I would *really* like to see MSFT publicly acknowledge this as a
flaw/vulnerability in specific versions/configurations of their
products, so that we can push people running vulnerable
versions/configurations to upgrade/change.

If you know anyone whose messages are being mangled in this way, i would
appreciate being put in touch with them, so that i can help them (as a
customer) push Microsoft into a better position.

If you've encountered any message like this while running notmuch from
git master, you should be able to identify those messages with:

    notmuch search property:index.repaired=mixedup

Feel free to reply to me off-list if you have identified anyone who
might be interested in trying to improve the situation (or if you
yourself are interested in doing this).  I might be able to help you
figure out specific ways to push Microsoft to avoid causing this failure
in the future.

      --dkg

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-21  5:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 16:36 Workaround for Exchange-corrupted PGP/Mime structure Carl Worth
2019-11-20 18:41 ` Ralph Seichter
2019-11-20 19:19   ` David Bremner
2019-11-20 20:55     ` Carl Worth
2019-11-20 21:19       ` Carl Worth
2019-11-20 22:10         ` Brian Sniffen
2019-11-21  3:06           ` Daniel Kahn Gillmor
2019-11-21  2:24         ` Daniel Kahn Gillmor

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).