Re: mark as read all messages with message ID

2015-05-11 Thread Suvayu Ali
Hi Xu,

On Mon, May 11, 2015 at 03:19:35AM -0400, Xu Wang wrote:
> 
> If you are curious about motivation, it is because GMail treats labels
> as different folders. So when we sync back, to have a message marked
> as read in GMail, it must be marked as read in all labels (or in
> Mutt's point of view, folders).

I think something else is going wrong.  As far as I understand, Gmail
does not behave this way.  I have been using OfflineIMAP and mutt with
Gmail for several years now, I have not noticed this behaviour.

That said, there is one limitation though.  Gmail does not allow two
operations on the same sync per message file.  What I mean is, if you
change the contents, as well as the file name, only one will succeed,
usually the content change.  This happens when, say, you rethread a
message while reading it, rethreading alters the content, reading alters
the filename.  Essentially any maildir operation would change the
filename, and anything that rewrites the message file, like a
postsynchook, rethreading, will rewrite the contents.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.


Re: mark as read all messages with message ID

2015-05-11 Thread Xu Wang
On Mon, May 11, 2015 at 7:13 PM, Derek Martin  wrote:
> On Mon, May 11, 2015 at 03:19:35AM -0400, Xu Wang wrote:
>> Hello all,
>>
>> In the pager or index, I would like to mark as read every message in
>> all mail boxes with the same message ID as the email that is
>> highlighted.
>
> There's no way to do this in Mutt proper... it does not have the
> ability to perform operations across mailboxes, generally.
>
> I was going to suggest a way to do it per-mailbox, by tagging the
> messages and then marking them read, but there are only thread-level
> commands for this--and the only other way I know of to do it is to
> remove the new flag, but that command is a toggle.
>
> You might find a solution for this in GNU Mailutils, or you could
> probably whip up a script in Python using one of its standard modules
> for e-mail, but I can't really give you more details than that.

Thanks, Derek. This is all very useful information. Would it be
possible to do the following? Let's suppose that the goal is just to
make the message is read in only one other mail box, called "All
Mail".

1. parse out the message ID from the selected email
2. store that in a variable (for Mutt)
3. change mail box to All Mail
4. find the message in that mail box that has the message ID stored in
a variable in (2)
5. mark that message as read
6. switch back to the mail box I was on before (e.g. Inbox)

Is that feasible?

Kind regards,

Xu


Re: Saving a message as unread

2015-05-11 Thread Xu Wang
On Mon, May 11, 2015 at 5:10 AM, Rejo Zenger  wrote:
> ++ 10/05/15 22:49 -0400 - Xu Wang:
>>After I am in Mutt and use the macro I mentioned above, if I then use
>>my browser to go to gmail and then go to All mail, it shows up as
>>unread. However, if I start all over again and use my browser to go to
>>GMail and do the archiving using GMail's web interface, then the
>>message shows up as read in GMail. Does that make sense?
>
> Not sure whether I have a correct understanding of your problem, but
> let's suppose I have, then this may be the solution:
>
> macro index \Ca "set 
> resolve=noNO[mailbox]set
>  resolve=yes"
>
> ... where "[mailbox]" designates the destination.

Many thanks, Rejo. I believe this does do what I was asking for. This
helps me understand more of how Mutt works (especially learning about
setting the resolve).

Kind regards,

Xu


Re: mark as read all messages with message ID

2015-05-11 Thread Derek Martin
On Mon, May 11, 2015 at 03:19:35AM -0400, Xu Wang wrote:
> Hello all,
> 
> In the pager or index, I would like to mark as read every message in
> all mail boxes with the same message ID as the email that is
> highlighted. 

There's no way to do this in Mutt proper... it does not have the
ability to perform operations across mailboxes, generally.

I was going to suggest a way to do it per-mailbox, by tagging the
messages and then marking them read, but there are only thread-level
commands for this--and the only other way I know of to do it is to
remove the new flag, but that command is a toggle.

You might find a solution for this in GNU Mailutils, or you could
probably whip up a script in Python using one of its standard modules
for e-mail, but I can't really give you more details than that.

-- 
Derek D. Martinhttp://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.



pgpUwIzNfMHyB.pgp
Description: PGP signature


Re: Some desired features, do they exist?

2015-05-11 Thread Ian Zimmerman
On 2015-05-11 19:14 +0200, Heinz Diehl wrote:

Ian> 2. Mailman managed lists (and maybe others) insert the annoying
Ian> [Foo-List] tags in the Subject header.  Other MUAs allow one to
Ian> massage the Subject header (for display only) so as to hide the
 
Ian> tag, and (again) save screen space.  Is this possible with mutt?
Ian> Should it be?

Heinz> Use procmail or similar to filter your mail. Here's a
Heinz> quick'n'dirty hack to do the job (and to encourage others to make
Heinz> it different/better):

I am quite familiar with procmail, thank you :)

But rewriting messages is a no no for me.

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.



Re: Some desired features, do they exist?

2015-05-11 Thread David Champion
* On 11 May 2015, Ian Zimmerman wrote: 
> 
> > NOTE: You MUST be subscribed to a list in order to post to it. This is
> > not to make your life harder, but to reduce SPAM and/or UCE.

That's new, and not a general principle.

-- 
David Champion • d...@bikeshed.us


Re: Some desired features, do they exist?

2015-05-11 Thread Heinz Diehl
On 11.05.2015, Ian Zimmerman wrote: 

> 2. Mailman managed lists (and maybe others) insert the annoying [Foo-List]
> tags in the Subject header.  Other MUAs allow one to massage the Subject
> header (for display only) so as to hide the tag, and (again) save screen
> space.  Is this possible with mutt?  Should it be?

Use procmail or similar to filter your mail. Here's a quick'n'dirty hack to do
the job (and to encourage others to make it different/better):

#!/usr/bin/perl

while (<>) {
if (/^Subject:/) {
@test = split;
@test = grep !/\[.*\]/, @test;
$newsubject = join (" ", @test);
s/^Subject:.*/$newsubject/;
}
print STDOUT $_;
}


Just pipe the mailheader through the script.

You could also do something hackish like that within a procmail rule:

:0fh
| perl -pe 's/^Subject:\s+(.*)\[Mailinglist-tag\]\s*(.*)/Subject: $1$2/; '

The first one could also be "enhanced" to decode/encode UTF and the like, if it
should be necessary, e.g. something like that:

#!/usr/bin/perl

use Encode;

while (<>) {
if (/^Subject:/) {
if (/\s*\=\?iso-8859/i) {
$_ = decode("MIME-Header", $_);
@test = split;
@test = grep !/\[.*\]/, @test;
$subject = join (" ", @test);
$newsubject = encode("MIME-Header", $subject);
# $newsubject  = encode("iso-8859-1", $subject);
s/^Subject:.*/$newsubject/;
}
if (/\=\?UTF-8/i) {
$_ = decode("MIME-Header", $_);
@test = split;
@test = grep !/\[.*\]/, @test;
$subject = join (" ", @test);
$newsubject = encode("MIME-Header", $subject);
s/^Subject:.*/$newsubject/;
}
else {
@test = split;
@test = grep !/\[.*\]/, @test;
$newsubject = join (" ", @test);
s/^Subject:.*/$newsubject/;
}
}
print STDOUT $_;
}



Re: Some desired features, do they exist?

2015-05-11 Thread Ian Zimmerman
On 2015-05-11 01:30 -0500, David Champion wrote:

David> When using mutt, please observe
David> http://www.mutt.org/doc/manual/manual-4.html#ss4.8 to help us
David> with meeting your request.

David> Nobody knows whether you're subscribed but you. :)

Not quite:

> Mutt Mailing Lists

> This page allows you to subscribe to the Mutt mailing lists running at
> mutt.org, as well as view the list archives.

> NOTE: You MUST be subscribed to a list in order to post to it. This is
> not to make your life harder, but to reduce SPAM and/or UCE.

-- 
Please *no* private copies of mailing list or newsgroup messages.
Rule 420: All persons more than eight miles high to leave the court.



Re: Saving a message as unread

2015-05-11 Thread Rejo Zenger
++ 10/05/15 22:49 -0400 - Xu Wang:
>After I am in Mutt and use the macro I mentioned above, if I then use
>my browser to go to gmail and then go to All mail, it shows up as
>unread. However, if I start all over again and use my browser to go to
>GMail and do the archiving using GMail's web interface, then the
>message shows up as read in GMail. Does that make sense?

Not sure whether I have a correct understanding of your problem, but 
let's suppose I have, then this may be the solution:

macro index \Ca "set 
resolve=noNO[mailbox]set
 resolve=yes"

... where "[mailbox]" designates the destination. 

Kind regards,

-- 
Rejo Zenger
E r...@zenger.nl | P +31(0)639642738 | W https://rejo.zenger.nl  
T @rejozenger | J r...@zenger.nl
OpenPGP   1FBF 7B37 6537 68B1 2532  A4CB 0994 0946 21DB EFD4
XMPP OTR  271A 9186 AFBC 8124 18CF  4BE2 E000 E708 F811 5ACF
Signal0507 A41B F4D6 5DB4 937D  E8A1 29B6 AAA6 524F B68B
  93D4 4C6E 8BAB 7C9E 17C9  FB28 03


signature.asc
Description: PGP signature


mark as read all messages with message ID

2015-05-11 Thread Xu Wang
Hello all,

In the pager or index, I would like to mark as read every message in
all mail boxes with the same message ID as the email that is
highlighted. How can I do
N
to every such message?

If you are curious about motivation, it is because GMail treats labels
as different folders. So when we sync back, to have a message marked
as read in GMail, it must be marked as read in all labels (or in
Mutt's point of view, folders).

Best regards,

Xu