Brian Clark | 2 Nov 02:04

Multiple display_filters

Hi Mutt users,

This must be a FAQ, but my searches have come up empty.

I'm going to take a wild guess that there is no way to apply multiple
display_filters (E.g. with message_hook)?

I'm using t-prot, and often see a need to apply more than that
display_filter to the current message.

--

-- 
Brian Clark

Patrick Shanahan | 2 Nov 02:12
Picon

Re: Multiple display_filters

* Brian Clark <brian+mutt <at> unwell.org> [11-01-05 20:06]:
> This must be a FAQ, but my searches have come up empty.

I haven't seen it if it is.

> I'm going to take a wild guess that there is no way to apply multiple
> display_filters (E.g. with message_hook)?

guessing does not solve problems unless you apply the guesses and test
your theories.

> I'm using t-prot, and often see a need to apply more than that
> display_filter to the current message.

here is two sed filters and t-prot that functions fine:

set display_filter="sed s/\r//|sed '\''/^\\[-- .* --]$/d'\''|t-prot -acelmtS -Mmutt --spass
-L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters"

note: that's one line
--

-- 
Patrick Shanahan                        Registered Linux User #207535
http://wahoo.no-ip.org                        @ http://counter.li.org
HOG # US1244711         Photo Album:  http://wahoo.no-ip.org/gallery2

Gary Johnson | 2 Nov 02:18

Re: Multiple display_filters

On 2005-11-01, Brian Clark <brian+mutt <at> unwell.org> wrote:
> Hi Mutt users,
> 
> This must be a FAQ, but my searches have come up empty.
> 
> I'm going to take a wild guess that there is no way to apply multiple
> display_filters (E.g. with message_hook)?
> 
> I'm using t-prot, and often see a need to apply more than that
> display_filter to the current message.

The way I handle this is to create shell scripts that contain 
pipelines of display_filters.  For example, I have one hook that 
executes "set display_filter=mail-to-filter" and another one that 
executes "set display_filter=mutt_gen_disp_filter" where the 
mutt_gen_disp_filter script contains (in part):

    mail-to-filter |
    perl -pe '
    ...

I've omitted a lot of details, but that should give you the idea.

HTH,
Gary

--

-- 
Gary Johnson                               | Agilent Technologies
garyjohn <at> spk.agilent.com                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA
(Continue reading)

Brian Clark | 2 Nov 02:22

Re: Multiple display_filters

On Tue, Nov 01, 2005 at 08:12:43PM -0500, Patrick Shanahan wrote:

> * Brian Clark <brian+mutt <at> unwell.org> [11-01-05 20:06]:

[...]

> > I'm using t-prot, and often see a need to apply more than that
> > display_filter to the current message.

> here is two sed filters and t-prot that functions fine:

> set display_filter="sed s/\r//|sed '\''/^\\[-- .* --]$/d'\''|t-prot
> -acelmtS -Mmutt --spass -L$HOME/.mutt/mlfooters
> -A$HOME/.mutt/adfooters"

> note: that's one line

Thank you, Patrick. That would, indeed, be the obvious answer, and I'm
amazed I can find my own nose! That will work nicely.

--

-- 
Brian Clark

Brian Clark | 2 Nov 02:27

Re: Multiple display_filters

On Tue, Nov 01, 2005 at 05:18:23PM -0800, Gary Johnson wrote:

> On 2005-11-01, Brian Clark <brian+mutt <at> unwell.org> wrote:
> > Hi Mutt users,

> > This must be a FAQ, but my searches have come up empty.

> > I'm going to take a wild guess that there is no way to apply multiple
> > display_filters (E.g. with message_hook)?

> > I'm using t-prot, and often see a need to apply more than that
> > display_filter to the current message.

> The way I handle this is to create shell scripts that contain 
> pipelines of display_filters.  For example, I have one hook that 
> executes "set display_filter=mail-to-filter" and another one that 
> executes "set display_filter=mutt_gen_disp_filter" where the 
> mutt_gen_disp_filter script contains (in part):

>     mail-to-filter |
>     perl -pe '
>     ...

Thanks, Gary. I completely overlooked piping the output. 

--

-- 
Brian Clark

Chris Green | 2 Nov 15:23
Picon

Any way to get size/count with maildir?

The one thing I will miss when I go from mbox to maildir (which I'm
planning to do for ease of backing up) is an indication of folder size.

With mbox when one looks at real mbox folders (as opposed to
subdirectories) one sees the folder size displayed (if there's a %s in
$folder_format).  With maildir the folders are *always* subdirectories
so one just gets a boring 4096 (or maybe some other power of 2) for
the size, not very useful.

It should be possible I would have thought to display the count of
messages in the folder, are there any plans to do this, or is it
perchance available as a patch?

--

-- 
Chris Green (chris <at> areti.co.uk)

    "Never ascribe to malice that which can be explained by incompetence."

Derek Martin | 2 Nov 16:33
Gravatar

Re: Any way to get size/count with maildir?

On Wed, Nov 02, 2005 at 02:23:18PM +0000, Chris Green wrote:
> The one thing I will miss when I go from mbox to maildir (which I'm
> planning to do for ease of backing up) is an indication of folder size.

I heartily agree; in fact I occasionally  make the point on mutt-dev
that -- from the user's perspective -- mbox and maildir should
function identically (albeit with somewhat different performance of
various operations, which is unavoidable).  The information displayed
to the user should be identical regardless of format, and the
difference in feature set should be nil.  The user should not need to
consider the storage format to get the desired feature set (excepting
cases where the format makes something technically impossible, which
is rare), nor should the user need to know or care about the storage
format at all, until and unless performance becomes an issue for them.

Usually when I bring up this idea, it's in response to a specific
feature inquiry/request from someone else, like yours.  Usually when I
advocate such a thing, one or more people on the dev list complain,
"That would be too slow."  Often that is somewhat true, though with
improvements in the design of the code, in many cases that performance
hit could be minimized...  But just as often, I think it's just
nonsense, as other mailers have those features without being absurdly
slow.  

Even when it does impact performance, I still think the feature
set should be the same.  Others argue that there should be a
difference, because having different formats means that you should be
able to optimize differently.  I think reasoning is sound, but the
conclusion is nonsense.  That is, yes: you should be able to optimize
for different formats.  But that doesn't mean the feature set should
(Continue reading)

Carthik Sharma | 2 Nov 16:49
Picon

Two beginner problems - formail and bogofilter

Hi,

I recently started using Mutt as a replacement for Evolution. I have
two problems.
I use fetchmail to fetch pop mail, procmail, bogofilter, and mutt.

Problem 1:
I have a 483 MB file from Evolution, called "Inbox". Since I wanted
the messages in the file to get filtered to the proper mailboxes so I
can read them with Mutt, I used the foloowing command, as suggested
somewhere on the web:

$ formail -s procmail < Inbox

I let it run overnight, and then in the morning, I found that only a
few messages had been processed. Significantly, some messages were not
re-delivered correctly. Does this always take a long, long time, or is
there a problem with how I am doing it?

Problem 2:
I have the following macro for unmarking a message as spam, marking it
as normal mail and re-filtering it:
macro   index   H       "<enter-command>unset
wait_key\n<pipe-entry>bogofilter -Sn -l\n<pipe-entry>formail -I
X-Bogosity|procmail\n<enter-command>set wait_key\n<delete-message>"
"Unmark as spam, mark as non-spam and refilter to correct mailbox"

The problem is that whenever I press H from some folder, it take about
1-2 minutes before I can use mutt again, since I have to wait for the
processing to complete before I can resume using Mutt. With about 100
(Continue reading)

Kyle Wheeler | 2 Nov 18:23

Re: Two beginner problems - formail and bogofilter

On Wednesday, November  2 at 10:49 AM, quoth Carthik Sharma:
>$ formail -s procmail < Inbox
>
>I let it run overnight, and then in the morning, I found that only a
>few messages had been processed. Significantly, some messages were not
>re-delivered correctly. Does this always take a long, long time, or is
>there a problem with how I am doing it?

No idea - I don't use formail much (I don't trust it -- it ends up 
mangling messages more than I think it should).

But, it may be faster to first convert your Inbox to a Maildir, and then 
send them through procmail, like so (uses this perl script: 
http://www.qmail.org/mbox2maildir -- remember to make a copy of your 
inbox first, as the script is destructive):

    env MAIL=Inbox MAILDIR=Inbox.tmp/ mbox2maildir
    for msg in Inbox.tmp/new/* ; do
        procmail < $msg &
    done

>Problem 2:
>I have the following macro for unmarking a message as spam, marking it
>as normal mail and re-filtering it:
>macro   index   H       "<enter-command>unset
>wait_key\n<pipe-entry>bogofilter -Sn -l\n<pipe-entry>formail -I
>X-Bogosity|procmail\n<enter-command>set wait_key\n<delete-message>"
>"Unmark as spam, mark as non-spam and refilter to correct mailbox"
>
>The problem is that whenever I press H from some folder, it take about
(Continue reading)

Patrick Shanahan | 2 Nov 19:16
Picon

Re: Two beginner problems - formail and bogofilter

* Carthik Sharma <carthik <at> gmail.com> [11-02-05 10:51]:
> Problem 1:
> I have a 483 MB file from Evolution, called "Inbox". Since I wanted
> the messages in the file to get filtered to the proper mailboxes so I
> can read them with Mutt, I used the foloowing command, as suggested
> somewhere on the web:

Why don't you open the evolution 'Inbox' with mutt and 'save' the
individual messages to the mutt mailbox of your choice?
  mutt -f /<path>/<to>/Inbox
  T   group tag
  .   tag all messages
  ;   act on all tagged
  s   save
  <mail-box><of><your><choice>

--

-- 
Patrick Shanahan                        Registered Linux User #207535
http://wahoo.no-ip.org                        @ http://counter.li.org
HOG # US1244711         Photo Album:  http://wahoo.no-ip.org/gallery2


Gmane