]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4847 try this
authorJeff Lenk <jeff@jefflenk.com>
Tue, 20 Nov 2012 22:54:35 +0000 (16:54 -0600)
committerJeff Lenk <jeff@jefflenk.com>
Tue, 20 Nov 2012 22:54:35 +0000 (16:54 -0600)
src/switch_utils.c

index fad8530245e368da3f6b0c59817e86853c5b2964..56a7ab06d1773f2a315ca33223b4619667f42e92 100644 (file)
@@ -876,12 +876,16 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
                }
        }
 
+       if (fd > -1) {
+               close(fd);
+               fd = -1;
+       }
 
        if (zstr(from)) {
                from = "freeswitch";
        }
 #ifdef WIN32
-       switch_snprintf(buf, B64BUFFLEN, "type \"%s\" | \"%s\" -f %s %s %s", filename, runtime.mailer_app, from, runtime.mailer_app_args, to);
+       switch_snprintf(buf, B64BUFFLEN, "\"%s\" -f %s %s %s < \"%s\"", runtime.mailer_app, from, runtime.mailer_app_args, to, filename);
 #else
        switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s -f %s %s %s", filename, runtime.mailer_app, from, runtime.mailer_app_args, to);
 #endif