More error checking

Use more relevant status codes and check whether recipient is in list of
permitted domains.