Online booksellers can’t be sued over alleged defamatory content on their websites if it’s created by an outside party, a judge has ruled, in the case of a self-published author who made sex and drug claims about President Obama.