DSPAM with VExim and folder-based training using Courier IMAP

Spam is getting worse, so I’m trying out DSPAM. I’ve added it into my vexim set-up and although it’s early days, things are looking promising.

I run various accounts with IMAP/POP3. For the POP3 users, there are training aliases to forward incorrectly-classified mail to. For IMAP users, it would be much more convenient to have DSPAM learn from a folder instead – drag and drop is easier than click, click, type, click.

I found a bash script which does nearly the right thing (using Postfix). Here’s the tweaked version for VExim/Courier.
Continue reading DSPAM with VExim and folder-based training using Courier IMAP

Using a servlet filter for 404 error-page

The upcoming Wicket 1.3 and 2.0 versions intercept their requests using a servlet filter to provide more flexible resource mapping and nicer URLs. Your Wicket pages no longer need to live at foo.com/app/PageName and can instead be rooted properly at foo.com/PageName.

This is now working well. I did, however, come up against a small issue, which is how you serve custom error pages for your 404 or 500 responses. It’s nice to render these like any other pages, so you can use your branding and whatnot. This used to work fine with Wicket as a servlet, but switching to a filter broke things. I did some digging around before reading the servlet spec in more detail and finally realising you need a Servlet 2.4 spec container and web.xml config file, with some <dispatcher> elements in your filter mapping.
Continue reading Using a servlet filter for 404 error-page

More on boilerplate and IoC

Java has lately been seriously annoying me in this regard. Why do I have to write getters/setters for beans? Why can’t we just have a property keyword instead that does it automatically? Why does everyone insist on using getters/setters in the first place rather than public fields anyway? What’s the point? Ah, yes, we need to be able to proxy the methods through cglib for Hibernate, or via Spring’s IoC/AOP stuff, so we can write “better” code with fewer dependencies.
Continue reading More on boilerplate and IoC

Java boilerplate

I fixed a Wicket bug today for compressing whitespace in HTML. The wrinkle is that you need to avoid doing that inside <pre> tags, otherwise your code formatting goes all wrong.

You should probably just gzip your responses instead, as it’ll be much more efficient than this, but apparently, someone cares enough to raise a bug report, so I rolled up my sleeves. I mean, how hard can it be to strip out some whitespace?

Continue reading Java boilerplate

Open Source Jam @ Google London

I went to Google for their first Open Source Jam to have a natter with a bunch of other folk working on open source projects, eat some pizza, that kind of thing.

Things I noticed:

  • People think Second Life is cool, but no one knows what to do with it yet.
  • People work on open source in their spare time. It had better be fun. Most of the under 30s were working on Python or RoR-based projects; the Java coders jumped up and down a bit less and had deeper voices.;-)
  • Django is generating buzz. Either that, or they came in a big group for fear of the Rails folk eating them.
  • Quite a few people are finding AJAX UI-design hard. It’s difficult to adhere to the principle of least surprise, when you’re building stuff the like of which no-one’s seen on the web before.