[imp] How to automatically set the "Important" flag

Jon Parise jon@horde.org
Tue, 15 Jan 2002 11:47:43 -0500


On Tue, Jan 15, 2002 at 04:38:11PM +0100, Frederic Mangeant wrote:

> first of all let me say I'm very impressed with Horde/IMP/Turba/Kronolith/Nag 
> (running the CVS version, works beautifuly).

[snip]
 
> I'd like IMP to set the "Important" flag when a mail is sent as "Important" by 
> the user agent.
> That is, using Outlook 2002 :
>  Importance: High
>  X-Priority: 1 (Highest)
>  X-MSMail-Priority: High
> in the headers.
> 
> I've looked into horde/mailbox.php, and found this :

[snip]
 
The message header is retrieved via a call to imap_header[1],
which returns an object representing the headers and flags
(described in the imap_headerinfo documentation[2]).

That's what IMP uses to determine the message flags.  It may be
the case that Outlook is not setting them in a standard way, such
as using the headers that you detail above (well, I'm not sure if
those are standard or not, but anyway).

> I've tried adding a few lines to set $h->flagged = 1 when a mail is sent as 
> important, but $h->importance does not seem to be set.

I don't believe there is an $h->importance flag; $h->flagged is
what you want for "important" messages.

I suppose we could look for the specific message headers you list
above and set the $h->flagged flag explicitly, by the way.  If
you want to give that a shot, please send a patch our way, and it
will be considered for inclusion in the source tree assuming it's
done in a clean manner.
 
[1] http://www.php.net/manual/en/function.imap-header.php
[2] http://www.php.net/manual/en/function.imap-headerinfo.php

-- 
Jon Parise (jon@csh.rit.edu)  .  Information Technology (2001)
http://www.csh.rit.edu/~jon/  :  Computer Science House Member