|
|
| version 1.72, 2002/07/31 14:58:00 | version 1.78, 2002/08/13 15:55:41 |
|---|---|
| Line 3 | Line 3 |
| Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| $Id$ | |
| */ | */ |
| static const char* IDENT_MAIL_C="$Date$"; | |
| #include "pa_config_includes.h" | #include "pa_config_includes.h" |
| #include "pa_common.h" | #include "pa_common.h" |
| Line 249 static const String& message_hash_to_str | Line 249 static const String& message_hash_to_str |
| "\n"; // header|body separator | "\n"; // header|body separator |
| const String& body=body_element->as_string(); | const String& body=body_element->as_string(); |
| const void *body_ptr=body.cstr(); // body | const char *body_ptr=body.cstr(String::UL_UNSPECIFIED); // body |
| size_t body_size=body.size(); // body | size_t body_size=strlen(body_ptr); // body |
| const void *mail_ptr; | const void *mail_ptr; |
| size_t mail_size; | size_t mail_size; |
| Charset::transcode(pool, | Charset::transcode(pool, |
| Line 271 static void sendmail(Request& r, const S | Line 271 static void sendmail(Request& r, const S |
| const String *from, const String *to) { | const String *from, const String *to) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| char *message_cstr=message.cstr(); | char *message_cstr=message.cstr(String::UL_UNSPECIFIED); |
| Hash *mail_conf=static_cast<Hash *>(r.classes_conf.get(mail_base_class->name())); | Hash *mail_conf=static_cast<Hash *>(r.classes_conf.get(mail_base_class->name())); |
| const char *exception_type="email.format"; | |
| if(!from) | if(!from) |
| throw Exception("parser.runtime", | throw Exception(exception_type, |
| &method_name, | &method_name, |
| "parameter does not specify 'from' header field"); | "parameter does not specify 'from' header field"); |
| if(!to) | if(!to) |
| throw Exception("parser.runtime", | throw Exception(exception_type, |
| &method_name, | &method_name, |
| "parameter does not specify 'to' header field"); | "parameter does not specify 'to' header field"); |
| #ifdef _MSC_VER | #ifdef _MSC_VER |
| Line 349 static void sendmail(Request& r, const S | Line 350 static void sendmail(Request& r, const S |
| } | } |
| if(!file_executable(*file_spec)) | if(!file_executable(*file_spec)) |
| throw Exception(0, | throw Exception("email.send", |
| file_spec, | file_spec, |
| "is not executable." | "is not executable." |
| #ifdef PA_FORCED_SENDMAIL | #ifdef PA_FORCED_SENDMAIL |
| Line 374 static void sendmail(Request& r, const S | Line 375 static void sendmail(Request& r, const S |
| &argv, | &argv, |
| in, out, err); | in, out, err); |
| if(exit_status || err.size()) | if(exit_status || err.size()) |
| throw Exception(0, | throw Exception("email.send", |
| &method_name, | &method_name, |
| "'%s' reported problem: %s (%d)", | "'%s' reported problem: %s (%d)", |
| file_spec->cstr(), | file_spec->cstr(), |
| Line 418 void MMail::configure_user(Request& r) { | Line 419 void MMail::configure_user(Request& r) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| // $MAIN:MAIL[$SMTP[mail.design.ru]] | // $MAIN:MAIL[$SMTP[mail.design.ru]] |
| if(Value *mail_element=r.main_class->get_element(mail_name)) | if(Value *mail_element=r.main_class->get_element(mail_name, r.main_class, false)) |
| if(Hash *mail_conf=mail_element->get_hash(0)) | if(Hash *mail_conf=mail_element->get_hash(0)) |
| r.classes_conf.put(name(), mail_conf); | r.classes_conf.put(name(), mail_conf); |
| else | else |