bug: subject line with several chunks of base64

2022-12-08 Thread Emmanuel Beffara
Hello,

I am stumbling upon what looks to be a bug.

Sometimes I receive messages where a header entry consists of several chunks
of base64-encoded quoted utf-8 text. For instance:

Subject: 
=?UTF-8?B?dGhpcyBpcyBqdXN0IGFuIGV4YW1wbGUgZm9yIGRlbW9uc3RyYXRpb24gcHVycA==?=  
=?UTF-8?B?b3Nlcw==?=

For such input, `notmuch search` and `notmuch show` (whatever the output
format) consider only the first block as part of the subject, the second block
is ignored. Apparently, this happens when the first block is padded with =
signs as in my example, not when the base64 encoded part is full.

Note that other MUAs treat this header by concatenating the blocks and
ignoring the two spaces between them. At least, mutt does that (as well as
neomutt accessing the message through notmuch) and so do the webmails I could
test with.

This should be fixed, because truncating header lines is certainly an
important problem.

-- 
Emmanuel
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


feature request: parameters for reply templates

2020-05-11 Thread Emmanuel Beffara
Hello,

Unless I missed something, there is essentially no way to control how
`notmuch reply` formats its template message. The standard behaviour is
adequate except for a few details:

- The attribution line uses a default format which is informative but
  overly verbose for my taste. It would be useful to have a setting to
  control it (something like Mutt's `attribution` settings).

- There is no automatic signature.

- Any part not in plain text produces a line “Non-text part: …” or
  “Attachment: …”, which is essentially useless when writing a reply to
  a message.

- The above is particularly annoying when it comes to replying to
  HTML-only messages, because you get no chance to quote the original
  message in your reply.

I use `notmuch reply` with the default format indirectly, because I use
bower an it delegates the task of preparing replies to this command. I
feel it would make sense to define new settings to handle all this, but
maybe there are good reasons not to?

-- 
Emmanuel
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


tagging moved messages

2012-05-19 Thread Emmanuel Beffara
Hello,

What would be the proper way of automatically tagging messages whose
file has been renamed?

My use case is the following:

In order to have some synchronization of tags between several machines,
I use folders on the IMAP server. The idea is simply that messages
tagged "foo" are actually moved to a folder "foo". The same applies to
the "inbox" tag, and as an exception, messages in a folder named "saved"
are those with no tags. Of course this excludes having several tags on a
given message (except for the special tags like "unread" and "signed"),
but it does fit my needs for now. The post-new hook says this:

#!/bin/sh
for FOLDER in *
do
case $FOLDER in
INBOX) TAG=inbox ;;
Drafts) TAG=draft ;;
Trash) TAG=killed ;;
saved) continue ;;
*) TAG=$FOLDER
esac
notmuch tag -$TAG -- tag:$TAG not folder:$FOLDER
notmuch tag +$TAG -- folder:$FOLDER not tag:$TAG
done

It does work but it is rather slow: 8 seconds, for a collection of 16000
messages. I can live with that but it does involve browsing the whole
collection for each tag. Having a tag on all moved messages, like for
the new ones, would dramatically improve this process.

Besides, the "folder:" prefix is not an exact search, so the above does
not work well if one folder name is part of another, like if I had a
folder "bar" and a folder "foo.bar". Is there a way around this?

I have another script called "pre-sync" that moves messages to folders
according to their tags. This one is called before offlineimap does the
full actual synchronization (calling notmuch new after that).

I welcome any comments on my usage pattern, as there may well be better
approaches I didn't think of...

-- 
Emmanuel


tagging moved messages

2012-05-19 Thread Emmanuel Beffara
Hello,

What would be the proper way of automatically tagging messages whose
file has been renamed?

My use case is the following:

In order to have some synchronization of tags between several machines,
I use folders on the IMAP server. The idea is simply that messages
tagged "foo" are actually moved to a folder "foo". The same applies to
the "inbox" tag, and as an exception, messages in a folder named "saved"
are those with no tags. Of course this excludes having several tags on a
given message (except for the special tags like "unread" and "signed"),
but it does fit my needs for now. The post-new hook says this:

#!/bin/sh
for FOLDER in *
do
case $FOLDER in
INBOX) TAG=inbox ;;
Drafts) TAG=draft ;;
Trash) TAG=killed ;;
saved) continue ;;
*) TAG=$FOLDER
esac
notmuch tag -$TAG -- tag:$TAG not folder:$FOLDER
notmuch tag +$TAG -- folder:$FOLDER not tag:$TAG
done

It does work but it is rather slow: 8 seconds, for a collection of 16000
messages. I can live with that but it does involve browsing the whole
collection for each tag. Having a tag on all moved messages, like for
the new ones, would dramatically improve this process.

Besides, the "folder:" prefix is not an exact search, so the above does
not work well if one folder name is part of another, like if I had a
folder "bar" and a folder "foo.bar". Is there a way around this?

I have another script called "pre-sync" that moves messages to folders
according to their tags. This one is called before offlineimap does the
full actual synchronization (calling notmuch new after that).

I welcome any comments on my usage pattern, as there may well be better
approaches I didn't think of...

-- 
Emmanuel
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch