]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add -f from to email
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 20 Oct 2009 18:07:24 +0000 (18:07 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 20 Oct 2009 18:07:24 +0000 (18:07 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15182 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_utils.c

index fa94ced56620b19c671106ff5b800716f9d64018..4ba48464afdcc78b69bf1ab646e680533fa1cd6a 100644 (file)
@@ -579,10 +579,15 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
        if (ifd) {
                close(ifd);
        }
+
+       if (switch_strlen_zero(from)) {
+               from = "freeswitch";
+       }
+
 #ifdef WIN32
-       switch_snprintf(buf, B64BUFFLEN, "type %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
+       switch_snprintf(buf, B64BUFFLEN, "type %s | %s %s -f %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, from, to);
 #else
-       switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, to);
+       switch_snprintf(buf, B64BUFFLEN, "/bin/cat %s | %s %s -f %s %s", filename, runtime.mailer_app, runtime.mailer_app_args, from, to);
 #endif
        if (switch_system(buf, SWITCH_TRUE) < 0) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unable to execute command: %s\n", buf);