Skip to content
Snippets Groups Projects
Commit 6693334b authored by Bob Mottram's avatar Bob Mottram
Browse files

Only attempt to parse the html sections of emails using lynx

parent 83c06168
No related branches found
No related tags found
No related merge requests found
......@@ -1982,6 +1982,9 @@ function email_remove_html {
if [ ! -f "${html_remove_script}" ]; then
update_email_remove_script=1
fi
if ! grep -q 'email_body_html' "${email_headers_script}"; then
update_email_remove_script=1
fi
if [ $update_email_remove_script ]; then
if [ -f "${email_headers_script}" ]; then
......@@ -2006,10 +2009,12 @@ function email_remove_html {
echo "headers=\$(echo \"\$email\" | $email_headers_script)";
echo "headers_lines=\$(echo \"\$headers\" | wc -l)";
echo "email_body=\$(echo \"\$email\" | tail -n +\${headers_lines})";
echo "email_body_plain=\$(echo \"\$email_body\" | sed '/<html>/,/<\\/html>/d')";
echo "email_body_html=\$(echo \"\$email_body\" | sed -n '/<html>/,/<\\/html>/p')";
echo "echo \"\$headers\"";
echo '';
echo "echo \"\$email_body\" | lynx -dump -display_charset UTF-8 -stdin | sed '/=0A/d'"; } > "${html_remove_script}"
echo "echo \"\$email_body_plain\"";
echo "echo \"\$email_body_html\" | lynx -dump -display_charset UTF-8 -stdin | sed '/=0A/d'"; } > "${html_remove_script}"
chmod +x "${html_remove_script}"
fi
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment