Smtp v2

Should hopefully address all your comments about the first version (the From stuff in the last patch might still be controversial, see my reply about that in the other thread).