0

I've been tasked to look into having an email function that we have in place which sends emails using uuencoding to something else more widely accepted. I guess there have been issues which recipients are not receiving attachments (.csv) files because it is uuencoded.

I'm guessing that we'd want to switch this to MIME encoding?

I wanted to get some suggestions, and perhaps some good starting places to look for something like this.

kyle_13
  • 1,173
  • 6
  • 25
  • 47

1 Answers1

1

Yes, you'll want to switch to MIME. You should know, though, that MIME is not an encoding in the same way that UUEncode is an encoding. MIME is essentially an extension to the rfc822 message format.

You don't specify which language you plan to use, but I'd recommend looking at 1 of the 2 MIME libraries I've written as they are among the (if not the) fastest and most rfc-compliant libraries out there.

If you plan to use C or C++, take a look at GMime.

If you plan to use C#, take a look at MimeKit.

The only other decent MIME libraries I can recommend are libetpan (a very low-level C API) and vmime (an all-in-one C++ library which does MIME, IMAP, SMTP, POP3, etc).

The only "advantage" that libetpan has over GMime is that it implements its own data structures library that it uses internally instead of doing what I did with GMime, which is to re-use a widely available library called GLib. GLib is available on every platform, though, so it seemed pointless for me to reinvent the wheel - plus GLib offers a ref-counted object system which I made heavy use of. For some reason I can't figure out, people get hung up on depending on GLib, complaining "omg, a dependency!" as if they weren't already adding a dependency on a MIME library...

Oh... I guess if you are using Java, you should probably look at using JavaMail.

Beyond that, there are no other acceptable MIME libraries that I have ever seen. Seriously, 99% of them suffer from the same design and implementation flaws that I ranted about on a recent blog post. While the blog post is specifically about C# MIME parsers, the same holds true for all of the JavaScript, C, C++, Go, Python, Eiffel, etc implementations I've seen (and I've seen a lot of them).

For example, I was asked to look at a popular JavaScript MIME parser recently. The very first thing it did was to use strsplit() on the entire MIME message input string to split it by "\r\n". It then iterated through each of the lines strsplit()'ing again by ':', then it strsplit() address headers by ',', and so on... it literally screamed amateur hour. It was so bad that I could have cried (but I didn't, because I'm manly like that).

jstedfast
  • 35,744
  • 5
  • 97
  • 110