Scan all folders for unseen messages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Scan all folders for unseen messages

aalinovi
It has taken the better part of 2 days for a non-technical person such
as I to get getmail, procmail and nmh all working together.

Is there any way to scan all folders at once to determine which have new
unseen messages or am I reduced to going into each folder individually
in which case I may scrap procmail and just have everything go into
inbox?

Thank you

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Conrad Hughes
Hi aalinovi,

> Is there any way to scan all folders at once to determine which have new
> unseen messages or am I reduced to going into each folder individually
> in which case I may scrap procmail and just have everything go into
> inbox?

This might work for you:

  flists -rec -noshowzero -sequence unseen

.. the "-sequence unseen" may be unnecessary for you, not sure: I've
changed my unseen-sequence to "un", so may not be representative.

Check the man page, but the switches are fairly obvious: -rec descends
to all folders and subfolders, and -noshowzero stops it from listing
folders with no unseen items.

Best,
Conrad

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Robert Elz
In reply to this post by aalinovi
    Date:        Thu, 26 Dec 2019 13:13:26 -0500
    From:        [hidden email]
    Message-ID:  <[hidden email]>

  | Is there any way to scan all folders at once to determine which have new
  | unseen messages

Try "new" ... of course using this assumes that the new messages have
correctly been added to "unseen" (or some other equivalent sequence)
when added (that is, that procmail is saving messages using rcvstore, not
its internal MH folder understanding, which does not understand sequences).

I use both methods from procmail ... rcvstore for folders where I want to
be told about new messages, and direct store for those (eg: "spam" where I
don't).

And while "new" works, personally I prefer using a local shell script which
tries the folders I care about one at a time, stopping at the first one (or
those) which has unseen messages, which makes it easier to prioritize the
order in which I look at them.

kre


Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Conrad Hughes
Robert> Try "new" ...

Dear oh dear.  That's been in nmh for ten years and this is the first
I've heard of it?  Ouch.

C.

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

aalinovi
In reply to this post by aalinovi
>
On Dec 26, I asked:

>Is there any way to scan all folders at once to determine which have new
>unseen messages or am I reduced to going into each folder individually
>in which case I may scrap procmail and just have everything go into
>inbox?

I would just like to thank Conrad and Robert for taking the time to
reply to me.

Both suggestions - Conrad's "flist -rec-noshowzero -sequence unseen"
and Robert's to use the "new" command
do what I need so thanks again to both.

Arthur

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Ralph Corderoy
Hi Arthur,

> From: [hidden email]
> To: [hidden email]
> To: [hidden email]
> Cc: [hidden email]
> Message-ID: <[hidden email]>

Your email had two To fields.  That's against RFC 2822 that states it
may have none or one.  Just pointing it out in case you had software
create that problem instead of a human.  :-)

Some mailing-list subscribers bounced that email due to this problem.

--
Cheers, Ralph.

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

aalinovi
>Your email had two To fields.  That's against RFC 2822 that states it
>may have none or one.  Just pointing it out in case you had software
>create that problem instead of a human.  :-)
>
>Some mailing-list subscribers bounced that email due to this problem.
>
>--
>Cheers, Ralph.

No, that was me and my ignorance showing.

What I was trying to do was send email to both Conrad Hughes and Robert
Elz thanking them for their help.

I just find the relevantsection of the comp man page:

"By default the "To:" and "cc:" fields are empty.  You may add addresses
to these fields with the -to address and -cc address switches.
You may give these switches multiple times to add multiple addresses."

to be confusing. I'd appreciate an example as I have a serious aversion
to making a fool of myself.

Thanks, Arthur


Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Ralph Corderoy
Hi Arthur,

> What I was trying to do was send email to both Conrad Hughes and
> Robert Elz thanking them for their help.
>
> I just find the relevantsection of the comp man page:
>
> "By default the "To:" and "cc:" fields are empty.  You may add
> addresses to these fields with the -to address and -cc address
> switches.  You may give these switches multiple times to add multiple
> addresses."
>
> to be confusing. I'd appreciate an example as I have a serious
> aversion to making a fool of myself.

comp(1)'s -to can be given more than once, but comp constructs a single
To field.

    $ grep To /etc/nmh/components
    %<{to}%(void(width))%(putaddr To: )%|To:%>
    $
    $ comp -build -form /etc/nmh/components -from me -to foo -to bar
    $
    $ cat mail/draft
    From: me
    To: foo, bar
    cc:
    Fcc: +outbox
    Subject:
    --------
    $

I used -form because my personal mail/components file works differently.

--
Cheers, Ralph.

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Ken Hornstein-2
In reply to this post by aalinovi
>I just find the relevantsection of the comp man page:
>
>"By default the "To:" and "cc:" fields are empty.  You may add addresses
>to these fields with the -to address and -cc address switches.
>You may give these switches multiple times to add multiple addresses."
>
>to be confusing. I'd appreciate an example as I have a serious aversion
>to making a fool of myself.

I wrote that section of the man page and I just re-read it now and I
don't find it confusing, but obviously I am biased because I wrote
it.  :-)  But I feel if people find it confusing then I didn't do a good
enough job.  Can you elaborate on what you find confusing about it?
I know Ralph explained how it works in practice; if an example in the
man page would be helpful, then we could add that.

--Ken

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

aalinovi
>>I just find the relevantsection of the comp man page:
>>
>>to be confusing. I'd appreciate an example as I have a serious aversion
>>to making a fool of myself.
>
>I wrote that section of the man page and I just re-read it now and I
>don't find it confusing, but obviously I am biased because I wrote
>it.  :-)  But I feel if people find it confusing then I didn't do a good
>enough job.  Can you elaborate on what you find confusing about it?
>I know Ralph explained how it works in practice; if an example in the
>man page would be helpful, then we could add that.

How does one put into words what one finds confusing?

When I read it I wasn't sure if it was:

From: [hidden email]
To: person1
To: person2

or To: person1, person2

or To: person1 To: person2

or To: person1 -to person2

or To: person1
-to person2

Now, all of this may seem absurd to the technically inclined, but for
the rest of us, in many cases if it isn't spelled out step by step,
we're lost.

That's why in many cases when I have a problem my first resort is
searching for examples on the web. Man pages are usually my last resort.

Arthur

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Ken Hornstein-2
>How does one put into words what one finds confusing?
>
>When I read it I wasn't sure if it was:
>
>From: [hidden email]
>To: person1
>To: person2
>
>or To: person1, person2
>
>or To: person1 To: person2
>
>or To: person1 -to person2
>
>or To: person1
>-to person2

I guess I was thinking that it was clear that this part of the man page
was talking about the command-line switch "-to" and NOT the format of
the draft file.

But ... now that I think about it, most modern man pages start out
explaining what each switch does, and we don't do that.  So if you're
coming in cold it could be honestly confusing.  Maybe we should explain
each switch up front and then have the longer description below?

--Ken

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

aalinovi
>
>I guess I was thinking that it was clear that this part of the man page
>was talking about the command-line switch "-to" and NOT the format of
>the draft file.
>
>But ... now that I think about it, most modern man pages start out
>explaining what each switch does, and we don't do that.  So if you're
>coming in cold it could be honestly confusing.  Maybe we should explain
>each switch up front and then have the longer description below?
>
>--Ken

Right there you have cleared things up for me. When you say command line
switch you're talking:

comp -to person1 -to person2

from the command line. I never knew you could do that. (But then Conrad
didn't know about "new" and he knows a lot more than I do :-)).

So, yes, I think explaining each switch up front, combined with an
example, would be helpful.

And, as always, thanks to you and everyone else for putting up with me.
I'm sure there are more than a few out there shaking their heads and
wondering why this guy just doesn't use Windows.

--Arthur

Reply | Threaded
Open this post in threaded view
|

Re: Scan all folders for unseen messages

Ken Hornstein-2
>Right there you have cleared things up for me. When you say command line
>switch you're talking:
>
>comp -to person1 -to person2
>
>from the command line. I never knew you could do that. (But then Conrad
>didn't know about "new" and he knows a lot more than I do :-)).

Well, to be fair, that's a new (pun intended) feature of nmh; it's only
7 years old :-).  And adding that feature broke things for MH-E users;
there's always a trade-off when adding new stuff to nmh.  So if you're
a long-time MH user, it's not surprising you wouldn't be aware of that.

>So, yes, I think explaining each switch up front, combined with an
>example, would be helpful.

I'll add it to the to-do list!  (it's a long list, sadly).

--Ken