@@ -82,6 +82,7 @@ static constexpr static_module g_dfl_svc_plugins[] = {
8282static constexpr cfg_directive zcore_gxcfg_dflt[] = {
8383 {" backfill_transport_headers" , " 0" , CFG_BOOL},
8484 {" daemons_fd_limit" , " zcore_fd_limit" , CFG_ALIAS},
85+ {" outgoing_smtp_url" , " sendmail://localhost" },
8586 {" zcore_fd_limit" , " 0" , CFG_SIZE},
8687 CFG_TABLE_END,
8788};
@@ -101,8 +102,6 @@ static constexpr cfg_directive zcore_cfg_defaults[] = {
101102 {" notify_stub_threads_num" , " 10" , CFG_SIZE, " 1" , " 100" },
102103 {" oxcical_allday_ymd" , " 1" , CFG_BOOL},
103104 {" rpc_proxy_connection_num" , " 10" , CFG_SIZE, " 1" , " 100" },
104- {" smtp_server_ip" , " ::1" , CFG_DEPRECATED},
105- {" smtp_server_port" , " 25" , CFG_DEPRECATED},
106105 {" submit_command" , " /usr/bin/php " PKGDATADIR " /sa/submit.php" },
107106 {" user_cache_interval" , " 1h" , CFG_TIME, " 1min" , " 1day" },
108107 {" user_table_size" , " 5000" , CFG_SIZE, " 100" , " 50000" },
@@ -306,24 +305,12 @@ int main(int argc, char **argv)
306305
307306 auto str = gxconfig->get_value (" outgoing_smtp_url" );
308307 std::string smtp_url;
309- if (str != nullptr ) {
310- try {
311- smtp_url = vmime::utility::url (str);
312- } catch (const vmime::exceptions::malformed_url &e) {
313- mlog (LV_ERR, " Malformed URL: outgoing_smtp_url=\" %s\" : %s" ,
314- str, e.what ());
315- return EXIT_FAILURE;
316- }
317- } else {
318- str = pconfig->get_value (" smtp_server_ip" );
319- uint16_t port = pconfig->get_ll (" smtp_server_port" );
320- try {
321- smtp_url = vmime::utility::url (" smtp" , str, port);
322- } catch (const vmime::exceptions::malformed_url &e) {
323- mlog (LV_ERR, " Malformed outgoing SMTP: [%s]:%hu: %s" ,
324- str, port, e.what ());
325- return EXIT_FAILURE;
326- }
308+ try {
309+ smtp_url = vmime::utility::url (str);
310+ } catch (const vmime::exceptions::malformed_url &e) {
311+ mlog (LV_ERR, " Malformed URL: outgoing_smtp_url=\" %s\" : %s" ,
312+ str, e.what ());
313+ return EXIT_FAILURE;
327314 }
328315 mlog (LV_NOTICE, " system: SMTP server is %s" , smtp_url.c_str ());
329316
0 commit comments