mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
merge MODAPP-88: Fix Email with no Attachement; Allow Email & Local VM Storage; Add Notify Only Email; Extra, note about missing prompts.
Added param "vm-email-only" to make voicemail sent by email only (previously default behavior Added param "vm-mailto-notify" to allow sending an second email to an mobile or other device for notification only git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8655 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -373,11 +373,10 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr
|
||||
if ((ifd = open(file, O_RDONLY)) < 1) {
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
|
||||
switch_snprintf(buf, B64BUFFLEN, "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"%s\"\n", bound);
|
||||
if (!write_buf(fd, buf)) {
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
}
|
||||
switch_snprintf(buf, B64BUFFLEN, "MIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"%s\"\n", bound);
|
||||
if (!write_buf(fd, buf)) {
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
|
||||
if (headers && !write_buf(fd, headers))
|
||||
@@ -386,15 +385,13 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr
|
||||
if (!write_buf(fd, "\n\n"))
|
||||
return SWITCH_FALSE;
|
||||
|
||||
if (file) {
|
||||
if (body && switch_stristr("content-type", body)) {
|
||||
switch_snprintf(buf, B64BUFFLEN, "--%s\n", bound);
|
||||
} else {
|
||||
switch_snprintf(buf, B64BUFFLEN, "--%s\nContent-Type: text/plain\n\n", bound);
|
||||
}
|
||||
if (!write_buf(fd, buf))
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
if (body && switch_stristr("content-type", body)) {
|
||||
switch_snprintf(buf, B64BUFFLEN, "--%s\n", bound);
|
||||
} else {
|
||||
switch_snprintf(buf, B64BUFFLEN, "--%s\nContent-Type: text/plain\n\n", bound);
|
||||
}
|
||||
if (!write_buf(fd, buf))
|
||||
return SWITCH_FALSE;
|
||||
|
||||
if (body) {
|
||||
if (!write_buf(fd, body)) {
|
||||
@@ -456,11 +453,9 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr
|
||||
|
||||
}
|
||||
|
||||
if (file) {
|
||||
switch_snprintf(buf, B64BUFFLEN, "\n\n--%s--\n.\n", bound);
|
||||
if (!write_buf(fd, buf))
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
switch_snprintf(buf, B64BUFFLEN, "\n\n--%s--\n.\n", bound);
|
||||
if (!write_buf(fd, buf))
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
|
||||
if (fd) {
|
||||
@@ -478,7 +473,6 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, const char *fr
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "failed to delete file [%s]\n", filename);
|
||||
}
|
||||
|
||||
|
||||
if (file) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Emailed file [%s] to [%s]\n", filename, to);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user