download cert for SMTP if missing

includes refactor of common code for download of certificates
and config files.