From d2e4dee2bb8a6c2c267aa3b523a60d13be2bf084 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 10 Jul 2008 15:35:35 +0000 Subject: [PATCH] mailer implementation for windows (FSCORE-115) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8985 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- conf/autoload_configs/switch.conf.xml | 26 ++++++++++++++++++++++++++ src/switch_utils.c | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/conf/autoload_configs/switch.conf.xml b/conf/autoload_configs/switch.conf.xml index 73fa1dc7f5..c4ec287af3 100644 --- a/conf/autoload_configs/switch.conf.xml +++ b/conf/autoload_configs/switch.conf.xml @@ -26,6 +26,32 @@ + diff --git a/src/switch_utils.c b/src/switch_utils.c index 3f7d4df720..3fbb58a2a4 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -463,7 +463,11 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr if (ifd) { close(ifd); } +#ifdef WIN32 + switch_snprintf(buf, B64BUFFLEN, "type %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to); +#else switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to); +#endif if (system(buf)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf); }