Commit Graph

66 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema b55e191421 update for lib/utils split
Update sources with the new paths
2019-12-22 15:26:45 +02:00
Alex Murray 5a450b1aee Treat text/markdown as plain text for issue #1503 2019-11-07 15:03:36 +10:30
Yuri D'Elia 61341486d2 Support gmime 3.0 2017-07-30 16:47:38 +02:00
djcb 78275278cf mu: fix some compiler warnings 2016-12-11 18:33:31 +02:00
djcb 10b3352565 mu: include patch/diff files in plain-text body
Some text/... parts can be show inline as part of the body text; for
instance patches. So, treat those specially.
2016-11-12 13:50:32 +02:00
djcb 7526f118ba mu: some cosmetics / minor cleanup 2016-10-26 22:36:40 +03:00
Aaron LI 297df938d6 Use Unicode characters when cleaning up attachment filename
Improve the function ``cleanup_filename()`` of ``lib/mu-msg-part.c`` to
use Unicode characters when replacing the control characters, slashes
and colons with ``-``.

Originally, this function just use plain C characters (i.e., assuming
ASCII string) when checking each character is or not a control character,
slash or colon.  However, when the attachment filename contains non-ASCII
(e.g., Chinese characters), all the non-ASCII characters are replaced
with ``-``.

For example:
* Before:
```
> mu view test_chinese_attachment_filename.eml
From: Tester <tester@example.com>
To: Example <example@example.com>
Subject: Test email with attachment of Chinese filename
Date: Mon 23 May 2016 05:22:09 PM CST
Attachments: 'attachment-test.txt', '------------.txt', '-------test.txt'
Hello,

This is a simple test email with three attachments:

1. `attachment:test.txt`: filename is all English;
2. `测试附件.txt`: filename is all Chinese (exclude the extension);
3. `附件-test.txt`: filename mixes Chinese and English.
```

* After:
```
> ./build/mu/mu/mu view test_chinese_attachment_filename.eml
From: Tester <tester@example.com>
To: Example <example@example.com>
Subject: Test email with attachment of Chinese filename
Date: Mon 23 May 2016 05:22:09 PM CST
Attachments: 'attachment-test.txt', '测试附件.txt', '附件-test.txt'
Hello,

This is a simple test email with three attachments:

1. `attachment:test.txt`: filename is all English;
2. `测试附件.txt`: filename is all Chinese (exclude the extension);
3. `附件-test.txt`: filename mixes Chinese and English.
```
2016-05-23 19:26:04 +08:00
Jun Hao f998a0ad1e mu: expose content id to attachment plist 2016-05-07 09:07:11 +08:00
djcb 66f205f6c5 mu: improve filename escaping
Sanitize attachment-names by replacing all control characters, '/' and
':'' by '-', but leave spaces alone.
2016-03-15 06:59:35 +02:00
djcb 50d25ce0e0 mu: use '.msgpart' as extension
We were using '.part', but some desktop software interprets that as a
partial download.
2015-10-24 11:45:50 +03:00
djcb 0678d31056 mu: special-case text/calendar parts
Set the name for (otherwise unnamed) mime-parts of type text/calendar to
"vcal-<n>.vcs"; this allows for easier processing with external tools.
2015-10-21 08:06:40 +03:00
attila f5a5cde965 Fix core dump in mu-server (at least) for cmd:extract index:0 ... 2015-06-30 16:28:26 -05:00
djcb d3457ec56c fix compiler warning 2015-02-21 14:18:24 -08:00
Foivos S. Zakkak edd463186e Fix handling of only signed messages 2015-02-16 01:56:11 +02:00
Foivos S. Zakkak 8456c1c2dc Fix #280
Since `parent` is not really used as a parent, I use it as the last
visited encrypted part while going down the parts-tree.

At the decryption of a part (`mu_msg_crypto_decrypt_part`) I check,
through the GMimeDecryptResult, for signatures (`check_decrypt_result`)
and add them to the part (`tag_with_sig_status`).  Any nested parts hold
that encrypted part as their parent.  Finally at `handle_part`, for each
part I check if it a descendent of an encrypted part.  If so, I proceed
checking for signatures and adding them to the `msgpart`.
2015-02-16 01:19:32 +02:00
djcb c6dd538975 mu-msg-part.c: some cosmetic changes 2014-10-19 11:38:49 +03:00
Foivos S. Zakkak 8f8bc52023 Revert "Do not handle signature parts after verification"
This reverts commit 6e9b9ad2d0.

Unfortunately the reverted commit breaks the Signature field for
encrypted and, at the same time, signed messages.

TODO: details button in the Signatures field does not work for such
cases because the signature is encrypted.

Conflicts:
	lib/mu-msg-part.c
2014-10-19 03:39:32 +03:00
Foivos S. Zakkak 2d843ca887 Add Decryption field
Add a decryption field of the form

Decryption: 2 part(s) decrypted 1 part(s) failed

Meaning that 2 encrypted mime parts where successfully decrypted and 1
part failed.  Note that the number 2 refers to the number of
successfully decrypted mime parts and not the number of successfully
decrypted encryptes multiparts, i.e., if an encrypted multipart
contains 4 parts and decryption is successful the field will be

Decryption: 4 part(s) decrypted

TODO: Add details button listing the names and indexes of the
decrypted (or not) mime-parts
2014-10-19 03:27:58 +03:00
Dirk-Jan C. Binnema ae75060b6a Merge pull request #498 from zakkak/skip_signatures
Do not handle signature parts after verification
2014-10-18 13:16:44 +03:00
Foivos S. Zakkak 6e9b9ad2d0 Do not handle signature parts after verification
Since signatures are not listed as attachments there is no reason to
handle them after the verification.
2014-10-18 12:44:33 +03:00
Foivos S. Zakkak a79cd23cd1 Improve decrypt failure handling
On failure to decrypt, list the encrypted part as an attachment
2014-10-18 12:33:20 +03:00
Foivos S. Zakkak c40522b632 Fix #494. Start indexing from 1 instead of 0 2014-10-17 15:53:32 +03:00
Foivos S. Zakkak a6a58b65f1 Remove left over argument from merge 2014-10-13 13:27:47 +03:00
Foivos S. Zakkak 6f50298667 Fix encrypted multiparts and attachments indexing
Pull request #483 does not handle encrypted multiparts properly.  It
used to just verify the signature and not process the parts of the
multipart.  This commit resolves this issue.

Additionally it did not index attachments properly and in the case of a
multipart directly containing more than one multiparts resulted on non
unique indexing of attachments/parts.  This commit resolves this issue
as well.
2014-10-12 22:43:58 +03:00
Foivos S. Zakkak 51037be7fb Fix #186 Part 3
This patch fixes the attachment extraction (open, save, temp) when using
`mu4e`.  `mu4e` used to not notify the mu-server about the
mu4e-decryption-policy.  As a result mu-server did not decrypt the
attachments for extract, open, or temp.
2014-10-10 18:34:57 +03:00
Foivos S. Zakkak 29e53d2eba Fix gpg decryption (#186)
After a multipart/encrypted part gets decrypted the result is usually a
`multipart/mixed` part (see enigmail).

Before this commit mime multiparts where handled only by
`g_mime_message_foreach`.  As a result the decrypted mime multiparts
where not processed.

This patch handles mime multiparts explicitly by removing the
`g_mime_message_foreach` invocations.  This might come at the cost of
reduced maintainability, in the case of radical gmime changes.  However,
gmime is pretty stable and that scenario is highly unlikely.

TODO: After decryption make any attachments available
2014-10-10 07:48:24 +03:00
djcb b7324d5af6 * cleanup: drop gmime-2.4 support 2013-07-21 14:44:44 +03:00
djcb 55acd92bd9 * mu: fix some valgrind reports 2013-04-18 00:12:37 +03:00
djcb 8c0b7eb92a * mu-msg-part: don't free wrapper, we don't own it 2013-04-17 00:07:05 +03:00
djcb 855e81db99 * update copyright years 2013-03-30 11:32:07 +02:00
djcb ab431a4a69 * lib: don't be too picky considering what's an attachment 2012-09-27 17:31:49 +03:00
djcb 506f26a342 * mu4e: unbreak attachments in forwarded messages 2012-09-25 15:20:26 +03:00
djcb 18096f326a * mu4e: allow message attachment to be viewed with mu4e (WIP) 2012-09-21 12:35:53 +03:00
djcb cc59c83756 * lib: mu-msg-part: improve handling of b0rked messages, s/HAVE_CRYPTO/BUILD_CRYPTO/ 2012-09-17 12:43:53 +03:00
djcb cd506d6d79 * add missing ifdef BUILD_CRYPTO block, so things build without crypto, too 2012-09-17 10:07:26 +03:00
djcb b4219bd06b * minor 2012-09-16 18:00:51 +03:00
djcb cb810010e1 * mu-msg-part: some refactoring, warn user about gmime pw bug 2012-09-14 12:17:40 +03:00
djcb 6a4b094ac9 * some refactoring for line35 2012-09-14 10:06:14 +03:00
djcb 61ade73332 * lib: add support for asking user for password from console 2012-09-13 22:57:04 +03:00
djcb ac1d1b2ed8 * cosmetics 2012-09-13 21:12:12 +03:00
djcb 0445d87ab9 * lib/mu-msg-part.c: enable decryption (WIP) 2012-09-12 12:12:24 +03:00
djcb 9d6ef76f5f * crypto: improve signature checking code 2012-09-01 20:03:48 +03:00
djcb 14661a6d7b * restore mu-verify (WIP) 2012-08-30 20:26:35 +03:00
djcb adc23614a1 * enable signature verification (WIP) 2012-08-30 12:53:52 +03:00
djcb dcda69e459 * lib: don't check for bogus error 2012-08-23 00:00:28 +03:00
djcb 8e6903cb61 * mu-msg-part: don't use g_mime_part_iter_*: it's gmime 2.6 only 2012-08-11 11:54:08 +03:00
djcb 51fe7fcae8 * lib: refactor attachment checking 2012-08-09 11:45:04 +03:00
djcb 86bf7b7165 * lib: cleanup mu_msg_get_body_(html|text) (WIP) 2012-08-09 09:38:22 +03:00
djcb c3391b3929 * lib: cleanups: remove mu-msg-cache (WIP) 2012-08-08 19:13:59 +03:00
djcb d7dabca0b6 * lib: fixes for make line35/make cc10 2012-08-07 12:02:44 +03:00