Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently set up an email gateway for our bug tracker, which was originally intended as a way for streamline error reporting from our server software. I told my colleagues about it, and they were also happy to have this feature, but I was horrified to discover the abuse of my poor system inflicted by entourage/outlook emails.

First, the sender's email address appears horribly mangled, like 'Name =?ISO-8859-1?B?TGp1bmdzdHL2bQ==?=" email@example.com'. The body of the email is an HTML attachment, of course with an unnecessary amount of extra code. The attachments are particularly annoying, since they appear as ticket attachments in the bug tracker and the body of the ticket is empty.

I have done a bit of googling but only found solutions suggesting huge ugly awk or perl scripts, which seems neither maintainable nor robust enough to address all possible edge cases for outlook's HTML.

What is a better solution here?

Our target platform is windows server, and I would prefer something in python, but we have a cygwin installation and can therefore use other unix utilities if need be.

share|improve this question

2 Answers 2

up vote 6 down vote accepted

If you research your question with fetchmail in mind you won't find good answers. That is because fetchmail is not the tool for your job.

As the Fetchmail FAQ says:

Repeat after me: fetchmail's job is transport, not policy.

What most people do in such cases is to use fetchmail together with procmail. Easiest thing to do would be to pipe you messages through html2txt like explained here.

If you never worked with procmail, don't be afraid. procmail is horrible, but if you keep things simple it's not too bad.

share|improve this answer

fetchmail is only for fetching mail, just like its name says.

On Unix systems, most people use procmail for email processing. You can write a recipe that checks for /<html/i and pipes the message through w3m -dump (or lynx -dump or anything you want). I'm not sure if a similar thing exists for Windows though...

(I'd also make procmail reply with a tutorial on turning off HTML.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.