Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Decrypting all mail messages in an imap folder

1 view
Skip to first unread message

Matto Fransen

unread,
Aug 3, 2023, 9:35:45 AM8/3/23
to
Hi,

I have a folder on a IMAP account with a number of PGP-ecrypted
mail messages. I would like to have those decrypted somewhere, so
I can grep or otherwise search for some content.

The messages can all be decrypted with my key, of course.

Is there a handy way to save these messages in decrypted form, or
extract the decrypted content and save that somewhere?

Thanks for any suggestions!

Best regards,

Matto

Gijs Hillenius

unread,
Aug 3, 2023, 11:07:35 AM8/3/23
to
since you're asking it here;

From the gnus group buffer you could run a macro (or something more
elisp) to decrypt those messages and then save all of them to
/tmp/somewhere/. I just tried that, and it "seems to work"™.

It would require you to have opengpg/pgp and gnus configured







Matto Fransen

unread,
Aug 6, 2023, 2:18:04 PM8/6/23
to
Hi,

On 3 August 2023 15:35 Matto Fransen, wrote:
>
> I have a folder on a IMAP account with a number of PGP-ecrypted
> mail messages. I would like to have those decrypted somewhere, so
> I can grep or otherwise search for some content.
>
> The messages can all be decrypted with my key, of course.
>
> Is there a handy way to save these messages in decrypted form, or
> extract the decrypted content and save that somewhere?

With the offline help of Gijs Hillenius this is the current solution:

- Select messages
- Run gnus-summary-save-article-file
- At the prompt, give the name of the file to save to

Select messages:
---------------
This can be either be done by marking some
messages with the '#' key, or by giving a number
as argument to gnus-summary-save-article-file:

(gnus-summary-save-article-file 42)
will save the next 42 messages as plain text

(gnus-summary-save-article-file -42)
will save the previous 42 messages as plain text

Run gnus-summary-save-article-file:
----------------------------------
A single message can be saved as plain text with
the keys 'O f'

The messages marked with '#' can be saved as plain
text with the keys 'O f'

At the prompt, give the name of the file to save to
---------------------------------------------------
In either method, single file, marked file, or a
number of files, the name of the file to save the
plain texzt version to, has to be supplied.

After the first messages has been saved this way,
the supplied name will be prompted as default.
This means, that just typen RET (Enter-key), the
plain text version of next message will appended
to file, the plain text version of first messsage
was saved into.

This behaviour can be changed by setting
gnus-prompt-before-saving to 't'. In that case,
you are only prompted once for the file name, or
by setting gnus-prompt-before-saving to 'nil, in
which case Gnus will simply save all the articles
in the default files.

See:
https://www.gnu.org/software/emacs/manual/html_node/gnus/Saving-Articles.html

The messages are decrypted and then saved,
starting from the "From: <email-address" line.
A blank line is inserted between the messages.

So, the answer was in the friendly manual .,,

Best regards,

Matto
0 new messages