Sunday, April 30, 2006

email the hard way

So I needed email server (MTA) capability for a feature on the personal project I'm working on.
I figured that I had a few choices:
- use sendmail (default on linux) or one of its alternatives (postfix, exim, etc)
- use a different thirdparty MTA, preferably a Java-based one
- use a "managed service" like fastmail, who I already use very happily for my inbox/IMAP

Fastmail would probably have been the easiest path, but I decided I might want to have more control and my VPS service gives me a much bigger bandwith allocation then fastmail would. Having decided o do it myself, I was very hesitant to use the notorious sendmail (its just scary to be able to write a book of hundreds pages long about an app that does a relatively simple job) or even its supposed 'simplier' alternatives like postfix, so I hunted around for a simple Java based one and found James (from apache) ZeroToaster, a cheap commercial java app and JES, pretty much the same thing, but open source.

So I of course went with JES and the initial out-of-the-box experience was excellant, 30 min & I was up and running send/receiving emails, and that included changing my DNS MX records.

Unfortunately after running it for a few hours it got into a nasty loop of repeatedly throwing an exception trying to deliver a malformed email it received (yes I had spam start coming in within minutes! of starting it up).
But this is where the power of oss does shine, being a nice simple app (the reason I avoided James like the plague) I grabbed the src-code zip, found the offeneding code and added some code to put aside malformed emails and fixed a null pointer bug in the shutdown code for good measure!

So probably for less tha a couple of hours of work I now have a working light MTA, with just enough features that I need and a resoanble confidence that I can fix other problems that might turn up. The only downside is that the sourceforge project for JES seems to have been abandoned for over a year, so for now I've just imported the code into my own subversion repo.

Still need to come up with a little wrapper to start it via rc script.
And I've found on JES's maillist that someones had success with compiling it with GCJ, with excellant results in terms of memory footprint and performance, so theres something else to look into.

[Update] Doh! Just found a patch on the sroucforge project page that fixes the problem I found with malformed emails (actually bounce mails with an empty address).

Labels:

Tuesday, April 25, 2006

D.I.Y.

So, I finally admitted that I don't have time to whip up even a quick personal blogging app, especially since I wanted to document it as I went, along the lines of the 15min blog app screencast that the rails crowd has on their website.

So I decided that if I was going to use a ready made blog app, rather than doing it myself, I'd at least try to go the whole web app route and rather than installing an app on my laptop or on my server, I'd use a web service style app and decided to try Google's Blogger, since I remembered it has the option of publishing to your web server and not just using their website.
Well so far, (its only my first post) so far, so good: all I had to do was create a directory in my public html directory on my server, plugged-in my sftp login and all done. I did have one hiccup when I changed the ftp path but didn't realise I also needed to change the 'archive' path, but apart from that its a nice looking, clean, easy to use interface.

I still plan to make my own blog app when I get a bit more spare time, but for now Blogger looks good and I can keep working on my current project (more details on that soon) and have somewhere to write my thoughts on it.

PS. Oh and just found it has a very nice spell checke, but one which ironically doesn't recognise words like 'Blogger' and 'blog' and no well to choose British over US spelling, but oh well no one can be perfect - I'm still very happy with it, well done Blogger & Google.