aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2020-05-07 14:36:09 +0200
committerCamil Staps2020-05-07 14:36:09 +0200
commit24be39cae3c551358bb8e17cef2425c20a4f2eb7 (patch)
treefb6e059c76db29cfc53b45956e287f606e0d80cc
parentFix highlighting of current events on list.php (diff)
Strip Agade footer from emails
-rw-r--r--mail.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/mail.php b/mail.php
index 1092b91..84e6a8d 100644
--- a/mail.php
+++ b/mail.php
@@ -160,6 +160,14 @@ function mail_parse_message ($body,$prefill_info=[])
$headers[count ($headers)-1]['val'].=' '.trim ($line);
}
+ $desc_begin=$i;
+ $desc_len=null;
+ for (; $i<count ($lines); $i++)
+ if (substr ($lines[$i],0,32)=='--- You are currently subscribed')
+ $desc_len=$i-$desc_begin;
+ $desc_lines=array_slice ($lines,$desc_begin,$desc_len);
+ $info['description']=trim (implode ("\n",$desc_lines));
+
foreach ($headers as $header){
$key=$header['key'];
$val=$header['val'];
@@ -184,8 +192,6 @@ function mail_parse_message ($body,$prefill_info=[])
$warnings[]='Unknown key '.$key;
}
- $info['description']=trim (implode ("\n",array_slice ($lines,$i)));
-
foreach (array_keys ($info) as $key)
if (is_null ($info[$key]))
$warnings[]='No '.$key.' found';