diff --git a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua index 43da44c224..488cd5aca5 100644 --- a/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua +++ b/app/switch/resources/scripts/app/voicemail/resources/functions/send_email.lua @@ -286,13 +286,13 @@ --get the smtp from address and name smtp_from = settings:get('voicemail', 'smtp_from', 'text'); smtp_from_name = settings:get('voicemail', 'smtp_from_name', 'text'); - if (smtp_from == nil) then + if (smtp_from and string.len(smtp_from) > 2) then smtp_from = settings:get('email', 'smtp_from', 'text'); end - if (smtp_from_name == nil) then + if (smtp_from_name and string.len(smtp_from_name) > 0) then smtp_from_name = settings:get('email', 'smtp_from_name', 'text'); end - if (smtp_from_name ~= nil) then + if (smtp_from_name and string.len(smtp_from_name) > 0 and smtp_from and string.len(smtp_from) > 2) then smtp_from = smtp_from_name.."<"..smtp_from..">"; end