Discussion:
how to match name part of a From header
(too old to reply)
Marc Haber
2017-01-30 17:51:14 UTC
Permalink
Hi,

I do have a mailbox that contains mails set by logcheck. Due to long
lines, I would like to have special handling for those when calling
them up in mutt.

They all have
From: logcheck system account <***@hostname.example>
and I would like to match for "logcheck system account", not for the
mail address as this may vary.

For the message given above, "~f logcheck" matches, but "~f system"
does not. I guess that the ~f match only goes for the address in the
head itself.

Does mutt have a match that matches the entire From-Header?

Greeitngs
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834
Shehu Dikko
2017-01-31 07:53:47 UTC
Permalink
[....]
They all have
and I would like to match for "logcheck system account", not for the
mail address as this may vary.
For the message given above, "~f logcheck" matches, but "~f system"
does not. I guess that the ~f match only goes for the address in the
head itself.
No, the pattern modifier can be followed by any regular expression.
"~f system" should match "system" anywhere in the "From:" header. I
have just confirmed this using Mutt 1.7.0. What version are you using?

regards,

s h e h u
Marc Haber
2017-07-24 11:33:53 UTC
Permalink
Post by Shehu Dikko
[....]
They all have
and I would like to match for "logcheck system account", not for the
mail address as this may vary.
For the message given above, "~f logcheck" matches, but "~f system"
does not. I guess that the ~f match only goes for the address in the
head itself.
No, the pattern modifier can be followed by any regular expression.
"~f system" should match "system" anywhere in the "From:" header. I
have just confirmed this using Mutt 1.7.0. What version are you using?
actually, what I want is a message hook.

Limiting my view to ~f "logcheck system account" does work,
message-hook '~f "logcheck system account"' 'set pager="less"'
does not.

What's the difference here? I guess it's a quoting issue.

Using mutt 1.7.2 (which identifies itself as NeoMutt) on Debian
stable.

Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Mannheim, Germany | Beginning of Wisdom " | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834
Loading...