Message headers

38 views
Skip to first unread message

Paulo Matos

unread,
Aug 16, 2021, 4:47:22 AM8/16/21
to mu-di...@googlegroups.com
Hi,

I just learned that Gandi writes some specific headers
(https://docs.gandi.net/en/gandimail/sieve/getting_started.html#x-gnd-status)
into messages to automatically tag them.

This brought up two questions.
1. Can I ask on demand mu4e to show all headers for a given (current)
message?
2. Can I always show a header for each message like X-GND-Status?

Thanks,

--
Paulo Matos

Tassilo Horn

unread,
Aug 16, 2021, 4:57:32 AM8/16/21
to mu-di...@googlegroups.com, Paulo Matos
Paulo Matos <pa...@matos-sorge.com> writes:

Hi Paulo,

> I just learned that Gandi writes some specific headers
> (https://docs.gandi.net/en/gandimail/sieve/getting_started.html#x-gnd-status)
> into messages to automatically tag them.
>
> This brought up two questions.
> 1. Can I ask on demand mu4e to show all headers for a given (current)
> message?

You can at least view the raw message using `.'
(`mu4e-view-raw-message') which will naturally show all headers.

> 2. Can I always show a header for each message like X-GND-Status?

The docs suggest you can, see (info "(mu4e) MSGV Custom headers").

Bye,
Tassilo

Paulo Matos

unread,
Aug 16, 2021, 5:05:32 AM8/16/21
to mu-di...@googlegroups.com, Tassilo Horn

Tassilo Horn <ts...@gnu.org> writes:

> Paulo Matos <pa...@matos-sorge.com> writes:
>
> Hi Paulo,
>
>> I just learned that Gandi writes some specific headers
>> (https://docs.gandi.net/en/gandimail/sieve/getting_started.html#x-gnd-status)
>> into messages to automatically tag them.
>>
>> This brought up two questions.
>> 1. Can I ask on demand mu4e to show all headers for a given (current)
>> message?
>
> You can at least view the raw message using `.'
> (`mu4e-view-raw-message') which will naturally show all headers.
>

Thanks.

>> 2. Can I always show a header for each message like X-GND-Status?
>
> The docs suggest you can, see (info "(mu4e) MSGV Custom headers").
>

Yes, that looks like it's what I want.

--
Paulo Matos

Paulo Matos

unread,
Sep 24, 2021, 5:00:06 AM9/24/21
to mu-di...@googlegroups.com, Tassilo Horn

Tassilo Horn <ts...@gnu.org> writes:

>
>> 2. Can I always show a header for each message like X-GND-Status?
>
> The docs suggest you can, see (info "(mu4e) MSGV Custom headers").

Thanks, I managed to get this done with:

(defun get-gandi-status (msg)
"Get X-GND-Status for msg."
(my-mu4e-any-message-field msg "X-GND-Status"))

(add-to-list 'mu4e-header-info-custom
'(:gandistatus .
( :name "Gandi Status"
:shortname "GndStatus"
:help "Gandi Status Header"
:function (lambda (msg)
(or (get-gandi-status msg) "")))))

(add-to-list 'mu4e-view-fields :gandistatus t)

One thing I didn't manage though is to create a bookmark for this
header. So, create a bookmark when X-GND-Status is LEGIT for
example. The reason I can't create the bookmark is because there's no
way to search for this specific header as far as I understand. Is there
a hook I can use to teach mu4e about new headers to search for besides
from:, list:, etc? Or maybe a way to do a full headers search?

Thanks,

--
Paulo Matos

Tassilo Horn

unread,
Sep 24, 2021, 5:12:10 AM9/24/21
to mu-di...@googlegroups.com
Paulo Matos <pma...@linki.tools> writes:

Hi Paulo,

> One thing I didn't manage though is to create a bookmark for this
> header. So, create a bookmark when X-GND-Status is LEGIT for
> example. The reason I can't create the bookmark is because there's no
> way to search for this specific header as far as I understand. Is
> there a hook I can use to teach mu4e about new headers to search for
> besides from:, list:, etc?

You can somehow tag messages [1] and then search for tag:foo but I don't
know how you'd automatically add some tag to new messages...

> Or maybe a way to do a full headers search?

Just tried to search for /X-ME-VSCategory: community:social/ which is a
header in your mail but got no result.

Bye,
Tassilo

[1] (info "(mu4e) Adding a new kind of mark")

Paulo Matos

unread,
Sep 24, 2021, 6:37:19 AM9/24/21
to mu-di...@googlegroups.com, Tassilo Horn

Tassilo Horn <ts...@gnu.org> writes:

> Paulo Matos <pma...@linki.tools> writes:
>
> Hi Paulo,
>
>> One thing I didn't manage though is to create a bookmark for this
>> header. So, create a bookmark when X-GND-Status is LEGIT for
>> example. The reason I can't create the bookmark is because there's no
>> way to search for this specific header as far as I understand. Is
>> there a hook I can use to teach mu4e about new headers to search for
>> besides from:, list:, etc?
>
> You can somehow tag messages [1] and then search for tag:foo but I don't
> know how you'd automatically add some tag to new messages...

Thanks, I have seen that but as far as I understand after you create a
custom mark, you can still not use it in searches.

>
>> Or maybe a way to do a full headers search?
>
> Just tried to search for /X-ME-VSCategory: community:social/ which is a
> header in your mail but got no result.

I have the same problem here. So I am baffled that nobody as faced this
problem before. It seems a common thing, to be able to search for a
non-standard header tag, although to be honest I have been using mu4e
for 2 years now and it's the first time that it occurred to me. :)

>
> Bye,
> Tassilo
>
> [1] (info "(mu4e) Adding a new kind of mark")


--
Paulo Matos
Reply all
Reply to author
Forward
0 new messages