Hallo pekka,
vielen Dank für Deine Hilfe.
Diese Funktion habe ich irgendwie übersehen.
Anbei eine einfache Funktion um die Priorität einer E-Mail zu bestimmen.
Evtl. müssen bei Bedarf weitere Header-Daten geprüft werden. Das sind
aber erst mal die ersten drei, die ich gefunden habe.
PHP-Code:
function getMailPriority($mbox, $mailNo) {
$completeHeader = imap_fetchheader($mbox, $mailNo);
if (preg_match('/X-Priority:.*(\d).*/i', $completeHeader, $matches) != 0) {
if ($matches[1] == 3) {
return "normal";
}
else if ($matches[1] < 3) {
return "high";
}
else if ($matches[1] > 3) {
return "low";
}
}
else if (preg_match('/X-MSMail-Priority:.*(Low|High).*/i', $completeHeader, $matches) != 0) {
if (strtolower($matches[1]) == "low") {
return "low";
}
else if (strtolower($matches[1]) == "high") {
return "high";
}
else {
return "normal";
}
}
else if (preg_match('/Importance:.*(Low|High).*/i', $completeHeader, $matches) != 0) {
if (strtolower($matches[1]) == "low") {
return "low";
}
else if (strtolower($matches[1]) == "high") {
return "high";
}
else {
return "normal";
}
}
else {
return "normal";
}
}
Vielen Dank
urkman
EDIT:
[php]-tags sponsored