One of the sites that I help manage uses WordPress along with a mailing list app called PHPList. I setup an EMail-to-post address in WordPress and subscribed that address to the appropriate mailing list – so there’s a WordPress category that acts as an archive for the mailing list messages.
The mailing list messages include a signature block, however, with various links (unsubscribe, view your preferences, etc). What I’m looking for is some automatic way to strip that text out, before the content of the EMail gets posted to WordPress.
I tried the “Postie” plugin and a few other hacked versions of wp-mail.php, but they either didn’t work – or worked, but caused other problems.
I’m thinking that the simplest solution would be to just add some php code into wp-mail.php to look for the signature delimiter (five dashes in this case, —–) and strip out all the text from that point on. But I haven’t been able to figure out how to do that so far.
Does anyone have recommendations for code that would accomplish removing the signature, and/or where the code should go in the wp-mail.php file?
- The topic ‘EMail-to-post: how to strip out signature block?’ is closed to new replies.