On 02Aug2016 08:05, Yubin Ruan <ablacktsh...@gmail.com> wrote:
really appreciate your help.

If you want to be more precise, you can use a modifier such as:

 ~C mutt-users@mutt.org

to match messages with that in the To or CC headers.

I have tried that, but when I press that ~ key, mutt give me some "key is not
bound. Press ? for help" message.(when I say I press the ~ key, I mean I press
<shift>~ , which would give you a ~ when you do normal typing, otherwise it's
just a ` )

Ah. The string above is a pattern expression. It is only meaningful at the prompt for <tag-pattern> or <limit> or searching. So what I should have asked you to type was:

 T~C mutt-users@mutt.org

so that the "T" (<tag-pattern>) opens the prompt requesting a pattern, and only _then_ do you type the pattern "~C mutt-users@mutt.org".

You might also want to experiment with "l" (<limit>), which restricts your view of the mailbox to just the messages matching a pattern. This will give you an easy way to experiment with patterns, and is also a handy way to locate particular messages in a large mailbox. Use the pattern "." to undo a "limit": that is a regexp for "any character", and effectively matches every message.

That's weird. I have no idea why, but I guess maybe that's because of
my configuration setting, part of which I copy directly from other's blog:

   set index_format='%-20.20L %4C [%Z] %{%b %d} %-15.15F (%?l?%4l&%4c?) %s'
   color index green  default ~N         # new
   color index red default ~D            # deleted
   color index brightmagenta default ~T  # tagged
   color index brightyellow default ~F   # flagged
   set pager_index_lines=10
   bind index,pager \Ck  sidebar-prev  #previous folder in sidebar
   bind index,pager \Cj  sidebar-next  #next folder in sidebar
   bind index,pager \CO  sidebar-open  #open selected folder in sidebar
   macro index      b    '<enter-command>toggle sidebar_visible<enter><refresh>'
   macro index      \cb  '<enter-command>toggle sidebar_visible<enter><refresh>'
   bind index       d    display-message
   bind index       gg   first-entry
   bind index       G    last-entry
   bind index       h    noop
   bind index       l    noop

that's all of my conf that are related to index view. Anything wrong ?

There's nothing wrong there, but I would feel unhappy about the "d" macro above. Normally "d" is bound to <delete-message>, so if you every open someone else's mutt, or open your own but bypassing the configuration above (which sometimes one wants to do), then "d" can easily lead to accidental deletion of messages.

Normally <enter> will display a message, and i would advocate removing your "d" macro and just using <enter>. Safer all around.

>   Can anyone tell me,
>   ** How can I have that Thunderbird message filtering in mutt?(i.e., moving
>   some messages from inbox to other mailbox according to the `To` field or 
`Cc`
>   field)

The simplest way to do that would be as you imagined:

 - tag the messages you want to move, for example by typing:

     T~C mutt-users@mutt.org

 - move ("save" in mutt parlance) these messages to another folder.

The key "s" is bound to <save-message>. Normally that operates on the current message. What you want is to operate on all the tagged messages. This is done by prefixing the command with ";" which is bound to <tag-prefix>. You can do this with many operations (copy, delete, etc). So type:

 ;s

meaning <tag-prefix><save>. This will prompt you for a folder name for the messages.

>   ** Is those ~ in mutt's manual(~e, ~T, ~B, etc.) stand for the <shift>
>   key?(I guess so because I have tried both `~T` and `<shift>T`, and only 
`<shift>T`
>   have some effect.) If that is, seriously, why can't the author just place
>   something like <shift> or <S> in the manual? and what does the =, % prefix 
mean?

No, the "~" is a literal tilde character. It does _not_ mean
<shift>. The ~T, ~B etc operators are "pattern modifiers" for use in
expressions which match messages.  So:

 ~f c...@zip.com.au

would match any message from me ("c...@zip.com.au" in the From:
header). They are case insensitive: "~t" and "~T" do different
things;>

~f doesn't work either, because the ~ is not bound(as described above)

As discussed above, ~ only has meaning at a prompt asking for a pattern expression. You need to type "T" or "l" first to get such a prompt.

Normal practice for mutt users is to file messages with a separate
program as they are collected. This works best with local storage:
we collect our email from the server with POP or IMAP and store in
local folders on our computers.  We can walk you through setting up
such an arrangement if you decide you want to go this way.

If there's some common practice I would really appreciate to hear some. Figuring
it out myself is kind of hard.

The practice varies very widely.

Many people use mutt to connect directly to IMAP servers such as GMail.

Alternatively, you arrange to collect your email from such servers (or your ISP's POP service, etc) and store it locally. Then use mutt to browse the local folders. Note here that mutt tends not to do the collecting, though it has pop and imap services and you _can_ collect with mutt.

Of course, you can use mutt to connect to an IMAP service and copy messages to local folders or vice versa.

Finally, there is some middle group. Using tools like offline-imap you can mirror your IMAP service (GMail) to local folders and use mutt locally. This has some advantages:

- you have local email, which you can browse and read and reply to if you are offline, such as I am on a train with only my laptop

- you still have your IMAP service which you can access with a normal GUI mail client (TBird, Apple Mail, etc) or via the web (mail.google.com) or from your phone

Essentially mutt is a mail reader which will talk to local folders and/or remote IMAP services.

If you're using GMail and wanting to keep your messages there I
would recommend setting up filter rules in GMail itself: it is
capable of autofiling new messages for you. The rules are a little
crude, but they cover the common cases.

Does gmail really have that filter-move functionality? I have searched through
nearly all of gmail's setting, but all I can find is something that only let
you filter the inbox and get a clean view. It can't move the messages that have
been filtered out to other mailbox.
Or do I miss something?

You may not be missing anything.

When you go to Settings->Filters and Blocked Addresses you have the option to edit any existing rule. After the first pane with search conditions (hit "Continue") you have the actions pane where you can say what to do with the messages. At the bottom right there is a tickbox to "Also apply filter to matching conversations", which I believe will apply it to everything. I also think I've tried this and encountered some kind of limit - it won't process thousands of messages.

So both annoying and limited.

So on that basis, perhaps you ae better off using mutt to selct and move messages. If the source folder and target folder are both on the remote IMAP service I _believe_ it should move the matching messages without copying them down the link to you and then back up to the IMAP server. Of course, any search term in your pattern which inspects the body will involve fetching that. (Exception: I think the =B pattern sends the search term to the IMAP serve for processing, which is why it takes a fixed string and not a regular expression).

Cheers,
Cameron Simpson <c...@zip.com.au>

Reply via email to