Priorities and attachments



Simple question: Yes, no and how else?


	prio = camel_header_raw_find(&h, "X-Priority", NULL);
	if (!prio)
		prio = camel_header_raw_find(&h, "X-MSMail-Priority", NULL);

	if (prio) 
	{ 
		if (g_strstr_len (prio, strlen (prio), "high") != NULL)
			mi->flags |= CAMEL_MESSAGE_PRIORITY;
		else if (strchr (prio, '1') != NULL || strchr (prio, '2') != NULL)
			mi->flags |= CAMEL_MESSAGE_PRIORITY;
	}

	attach = camel_header_raw_find(&h, "X-MS-Has-Attach", NULL);
	if (attach)
		if (g_strstr_len (attach, strlen (attach), "yes") != NULL)
			mi->flags |= CAMEL_MESSAGE_ATTACHMENTS;
	else {
		attach = camel_header_raw_find(&h, "Content-Type", NULL);
		if (g_strstr_len (attach, strlen (attach), "multi") != NULL)
			mi->flags |= CAMEL_MESSAGE_ATTACHMENTS;
	}


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]