X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fkdm.cc;h=cf551285bb5444a476bd5b5f319b3ac556f056fd;hb=320c9b6d68d111bc0768e210cc8c7ae9d0d7c22e;hp=97e0536d1d9a40ec7c6d06b769e7781a7a0726c0;hpb=692e67b9dc1e8cd72546b3766e8f38956932ee58;p=dcpomatic.git diff --git a/src/lib/kdm.cc b/src/lib/kdm.cc index 97e0536d1..cf551285b 100644 --- a/src/lib/kdm.cc +++ b/src/lib/kdm.cc @@ -46,7 +46,7 @@ struct ScreenKDM }; static string -kdm_filename (shared_ptr film, ScreenKDM kdm) +kdm_filename (shared_ptr film, ScreenKDM kdm) { return tidy_for_filename (film->name()) + "_" + tidy_for_filename (kdm.screen->cinema->name) + "_" + tidy_for_filename (kdm.screen->name) + ".kdm.xml"; } @@ -56,7 +56,7 @@ struct CinemaKDMs shared_ptr cinema; list screen_kdms; - void make_zip_file (shared_ptr film, boost::filesystem::path zip_file) const + void make_zip_file (shared_ptr film, boost::filesystem::path zip_file) const { int error; struct zip* zip = zip_open (zip_file.string().c_str(), ZIP_CREATE | ZIP_EXCL, &error); @@ -100,7 +100,7 @@ operator== (ScreenKDM const & a, ScreenKDM const & b) static list make_screen_kdms ( - shared_ptr film, + shared_ptr film, list > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -124,7 +124,7 @@ make_screen_kdms ( static list make_cinema_kdms ( - shared_ptr film, + shared_ptr film, list > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -166,7 +166,7 @@ make_cinema_kdms ( void write_kdm_files ( - shared_ptr film, + shared_ptr film, list > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -186,7 +186,7 @@ write_kdm_files ( void write_kdm_zip_files ( - shared_ptr film, + shared_ptr film, list > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -205,7 +205,7 @@ write_kdm_zip_files ( void email_kdms ( - shared_ptr film, + shared_ptr film, list > screens, boost::filesystem::path dcp, boost::posix_time::ptime from, @@ -237,7 +237,17 @@ email_kdms ( quickmail_set_body (mail, body.c_str()); quickmail_add_attachment_file (mail, zip_file.string().c_str(), "application/zip"); - char const* error = quickmail_send (mail, Config::instance()->mail_server().c_str(), 25, "", ""); + + int const port = Config::instance()->mail_user().empty() ? 25 : 587; + + char const* error = quickmail_send ( + mail, + Config::instance()->mail_server().c_str(), + port, + Config::instance()->mail_user().c_str(), + Config::instance()->mail_password().c_str() + ); + if (error) { quickmail_destroy (mail); throw KDMError (String::compose ("Failed to send KDM email (%1)", error));