Homepage | Products | OX Knowledge Base | Support | Try Now | Contact | Company
OX Logo
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2011
    Posts
    2

    Default Access to mail header field in the mail folder list

    Hi,

    I would like to get access to an arbitrary mail header when building the mail folder overview. The mails will contain an additional header denoting them to be verified ( e.g. 'contains a valid DKIM signature' ). The ajax api offers access to a limited set of headers (just the lucky ones having a number assigned). Is there a way to access the other headers without applying for a number ?

    Thanks in advance,

    Andreas
    Last edited by andreask; 08-22-2011 at 06:05 PM.

  2. #2
    Join Date
    Feb 2007
    Posts
    253

    Default

    See "Get a list of mails" in the HTTP API. It has a parameter "headers".

    If you want to add an icon to existing mail lists, then you're lucky that we've already needed to hack this before. Although it's a not supported API, you can try the following:
    Code:
    if (temporary.lists.mail) {
        temporary.lists.mail.addIcon({
            name: ["headers/X-my-header"],
            width: "16px",
            isVisible: function(mail) {
                return Boolean(mail.headers && mail.headers["X-my-header"]);
            },
            getIcon: function(mail) {
                switch (mail.headers["X-my-header"]) {
                    case "specialValue":
                        return "/plugins/com.example.myplugin/images/special.png";
                    default:
                        return "img/dummy.gif";
                }
            }
        });
    }

  3. #3
    Join Date
    Aug 2011
    Posts
    2

    Default

    Thanks Viktor,

    the headers parameter works well !

    But I'm a bit stuck with extending the js functionality. What type of event I should register for ? Got no idea which event marks the rendering of the mail list.

    And, where to put the snippet you supplied ? In mail.js ?

    Greetings

    Andreas

  4. #4
    Join Date
    Feb 2007
    Posts
    253

    Default

    It's for a plugin (using the Plugin API).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •