| Summary: | html e-mail conversion to plain text | ||
|---|---|---|---|
| Product: | [Unmaintained] kmail | Reporter: | Eric Wilhelm <ewilhelm> |
| Component: | general | Assignee: | kdepim bugs <pim-bugs-null> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | wishlist | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.5 | ||
| Target Milestone: | --- | ||
| Platform: | RedHat Enterprise Linux | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Version: 1.5 (using KDE 3.1-1) Installed from: Red Hat Linux 7.3 Compiler: gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113.0) OS: Linux (i686) release 2.4.18-3smp I would like kmail to have an option to always convert html mail to plain text (removing the html tags). The original html message could be stored in a separate folder with a link to that file listed in the converted plain-text e-mail. Example: "This message was originally sent in html format. The original is located at file:~/Mail/html/message_name.html" Kmail currently does not render "file:/" links in plain-text mail. But this seems like a simple extension of the current behavior of rendering www and http links. Here is a perl script that might work as a start. I am not a professional regex author, so it could use some improvement, but it does a decent job of conveying what I mean by this wishlist item. ------start script---------- #!/usr/bin/perl $homedir = $ENV{HOME}; $infile = $ARGV[0]; open(FILE, "$infile"); $message = join("", <FILE>); $message =~ s/<.*?img.*?src="(.*?)".*?>/\n\tattached image: $1\n/isg; $message =~ s/<a\s*href="(.*?)".*?>/ ($1) /ig; $message =~ s/ / /ig; $message =~ s/&/&/ig; $message =~ s/=\n+/\n/gs; $message =~ s/<.*?>/ /sg; $message =~s/\n\s*\n+/\n\n/g; print "This message converted from html format to plain text\n"; print "To view the original, see file:/$homedir/Mail/html/$infile\n"; print "$message\n"; ------end script---------- I'm sure this could be greatly improved by utilizing an html-parsing perl module. I think this functionality would be good for security and the stifling of the html mail fad (one of my e-mail accounts has recently "upgraded" to an ms server which converts plain-text mail to html, and no amount of riding the admins seems to lead to the problem being fixed). Thanks, Eric Wilhelm