procmail
[Top] [All Lists]

Re: recipe to add keywords to an imap message

2006-04-01 23:52:40
Sur 2006-03-31, Don Russell skribis:
NM Public wrote:
[snip]

I just did some experiments with this on a new system that I'm
setting up and discovered that you need to "seed" the
mbox-formatted mailbox with a message that contains the IMAP
keyword(s) that you want to use. That will ensure that the first
message in the mbox is a pseudo message that includes a header
like this:

  X-IMAP: 1143223486 0000000047 $Label5

Do NOT try to create this header by hand. Instead use a decent
IMAP client and the IMAP protocol to assign keyword(s) to any
message in the target mailbox. To set keywords with Pine, see the
instructions here:

  <http://www.ii.com/internet/messaging/pine/pc/#keywords>

Also note that this only works with UW IMAP (AFAIK).

That's very interesting, and more in line with the sort of thing I was
expecting. The replies I got from the Thunderbird people made a
distinction between "headers" and ading keywords to the imap message.
The later made me think there were some imap commands I had to use....

But... I added this recipe to my /etc/procmail file and it works very
well. Maybeby coincidence rather than by design? I do notice that when I
view the e-mail source on the client though, there are no X-Keyword:
headers. That makes me think that imap is actually reading the
X-Keyword: header and doing things, then removing the header.

#--------------------------------------------------------------------
# Thunderbird mail clients use "labels" to color-code messages.
# If a message has a "high" or "highest" x-priority setting,
# tell Thunderbird this is an "important" message.
# Client-side filters or the user may change this...
:0 fh w
* ^x-priority:[         ]*(1|2).
| formail -i "X-Keywords: \$Label1"
#--------------------------------------------------------------------


I'm using Dovecot imap server on Linux Fedora Core 5.


I don't know about Thunderbird, but Pine suppresses headers that 
contain IMAP metadata, e.g., the X-Keywords header. The metadata 
headers are still there and you can see them if you use 'less' or 
'more' to look at the raw mbox file on your IMAP server.

I'm happy to hear that this works with Dovecot IMAP and I've 
added that bit of information to the #keywords section of my 
Procmail Quick Start. Question: What mailbox format are you using 
with Dovecot? I assume mbox, but want to make sure. It would be 
very cool if the X-Keywords header also worked with 
maildir-formatted mailboxes, but I suspect it doesn't (since the 
IMAP metadata is stored in the filename and sometimes in separate 
files when maildir mailboxes are used).

Thank you,
  Nancy
   (sent via gmane.mail.procmail)

-- 
  Nancy McGough ~ <http://www.ii.com> ~ <http://deflexion.com>


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail