Revision
15182
Author
anthm
Date
2009-10-20 13:07:24 -0500 (Tue, 20 Oct 2009)

Log Message

add -f from to email

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_utils.c (15181 => 15182)


--- freeswitch/trunk/src/switch_utils.c	2009-10-20 17:03:03 UTC (rev 15181)
+++ freeswitch/trunk/src/switch_utils.c	2009-10-20 18:07:24 UTC (rev 15182)
@@ -579,10 +579,15 @@
 	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);