]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mailer implementation for windows (FSCORE-115)
authorMichael Jerris <mike@jerris.com>
Thu, 10 Jul 2008 15:35:35 +0000 (15:35 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 10 Jul 2008 15:35:35 +0000 (15:35 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8985 d0543943-73ff-0310-b7d9-9358b9ac24b2

conf/autoload_configs/switch.conf.xml
src/switch_utils.c

index 73fa1dc7f527b92e466aa3ad0595f2b3e4ea18ae..c4ec287af3c4fdffa4fbd331d947bf37a69f4ec9 100644 (file)
     <param name="crash-protection" value="false"/>
     <!--<param name="max_dtmf_duration" value="192000"/>-->
     <!--<param name="default_dtmf_duration" value="8000"/>-->
+    <!--
+         If you want to send out voicemail notifications via Windows you'll need to change the mailer-app
+         variable to the setting below:
+     
+       <param name="mailer-app" value="msmtp"/>
+         Donot change mailer-app-args.
+         You will also need to download a sendmail clone for Windows (msmtp). This version works without issue:
+         http://msmtp.sourceforge.net/index.html. Download and copy the .exe to %winddir%\system32.
+         You'll need to create a small config file for smtp credentials (host name, authentication, tls, etc.) in
+         %USERPROFILE%\Application Data\ called "msmtprc.txt". Below is a sample copy of this file:
+         ###################################
+         # The SMTP server of the provider.
+         account provider
+         host smtp.myisp.com
+         from john@myisp.com
+         auth login
+         user johndoe
+         password mypassword
+         # Set a default account
+         account default : provider
+       ###################################
+         
+ -->    
     <param name="mailer-app" value="sendmail"/>
     <param name="mailer-app-args" value="-t"/>
     <param name="dump-cores" value="yes"/>
index 3f7d4df720a7d651af308b73528b5a0bd1e4ad21..3fbb58a2a4e8de90bb69b6eadc55b77372b98d7b 100644 (file)
@@ -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);
        }