We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 1f8040ce authored by Evan Prodromou's avatar Evan Prodromou

better type logic

darcs-hash:20080718202052-84dde-cf788df7bcf76f971229d18041823a9483a164cc.gz
parent 91cac649
...@@ -123,10 +123,10 @@ class MailerDaemon { ...@@ -123,10 +123,10 @@ class MailerDaemon {
} }
$from = $parsed->headers['from']; $from = $parsed->headers['from'];
$to = $parsed->headers['to']; $to = $parsed->headers['to'];
$type = $parsed->ctype_primary . '/' . $parsed->ctype_secondary;
switch ($parsed->ctype_primary) { if ($parsed->ctype_primary == 'multitype') {
case 'multitype':
# try and find a text/plain in the mix
foreach ($parsed->parts as $part) { foreach ($parsed->parts as $part) {
if ($part->ctype_primary == 'text' && if ($part->ctype_primary == 'text' &&
$part->ctype_secondary == 'plain') { $part->ctype_secondary == 'plain') {
...@@ -134,16 +134,9 @@ class MailerDaemon { ...@@ -134,16 +134,9 @@ class MailerDaemon {
break; break;
} }
} }
break; } else if ($type == 'text/plain') {
case 'text': $msg = $parsed->body;
switch ($parsed->ctype_secondary) { } else {
case 'plain':
$msg = $parsed->body;
break;
default:
$this->unsupported_type($parsed);
}
default:
$this->unsupported_type($parsed); $this->unsupported_type($parsed);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment