Fix mailings attachments from stored mailings; fixes #823
Check DB connection test; fixes #817