--- parser3/src/classes/mail.C 2016/09/08 20:41:47 1.129 +++ parser3/src/classes/mail.C 2017/02/07 22:00:28 1.133 @@ -1,7 +1,7 @@ /** @file Parser: @b mail parser class. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -19,7 +19,7 @@ #include "smtp.h" -volatile const char * IDENT_MAIL_C="$Id: mail.C,v 1.129 2016/09/08 20:41:47 moko Exp $"; +volatile const char * IDENT_MAIL_C="$Id: mail.C,v 1.133 2017/02/07 22:00:28 moko Exp $"; // defines @@ -98,7 +98,7 @@ static void sendmail( // win32 without SMTP server configured throw Exception(PARSER_RUNTIME, 0, - "$"MAIN_CLASS_NAME":"MAIL_NAME".SMTP not defined"); + "$" MAIN_CLASS_NAME ":" MAIL_NAME ".SMTP not defined"); #else // unix // $MAIN:MAIL.sendmail["/usr/sbin/sendmail -t -i -f postmaster"] default @@ -164,8 +164,6 @@ static void sendmail( #endif ); - - String in(message_cstr); PA_exec_result exec=pa_exec( // forced_allow #ifdef PA_FORCED_SENDMAIL @@ -176,14 +174,10 @@ static void sendmail( , *file_spec, 0 /* pass env */, argv, - in); + String::C(message_cstr, strlen(message_cstr))); + if(exec.status || exec.err.length()) - throw Exception("email.send", - 0, - "'%s' reported problem: %s (%d)", - file_spec->cstr(), - exec.err.length()?exec.err.cstr():"UNKNOWN", - exec.status); + throw Exception("email.send", 0, "'%s' reported problem: %s (%d)", file_spec->cstr(), exec.err.length() ? exec.err.cstr() : "UNKNOWN", exec.status); #endif //WIN32 } @@ -219,7 +213,7 @@ static void _send(Request& r, MethodPara smtp_server_port?true:false /*send by SMTP=strip to?*/, to); if(print_debug) - r.write_pass_lang(message); + r.write(message); else sendmail(vmail_conf, smtp_server_port, message, from, to, soptions); }