I have made something for Ubuntu at http://bazaar.launchpad.net/~dpniel/dekko/trunk-1/view/head:/src/Ubuntu/backend/MailConfig/MailConfigUtils.cpp.
It is not following the interface mentioned here, I just found out this thread today. SRV(DNS lookup) is only setup on gmail. Few email host adopt it. So it is not included here. Hi Matt Richardson, hopefully, it can be helpful to you or we can work on auto-configuration together.