Changeset 99057e4d73dbb905f06f5ccc4ea49708b8aaa0a8
- Timestamp:
- 09/19/10 20:59:45 (20 months ago)
- Children:
- 11cf105fe323361072281747558cb61752f33fa8
- Parents:
- 81c6e32180ba6f1018c28ae75b7281fd38121812
- git-committer:
- Antti-Juhani Kaijanaho <antti-juhani@…> (09/19/10 20:59:45)
- Files:
-
- 3 added
- 1 removed
- 22 modified
-
db/db.cc (modified) (1 diff)
-
db/group.cc (modified) (1 diff)
-
http/article_entry.cc (modified) (1 diff)
-
http/article_entry.hh (modified) (1 diff)
-
http/compose.cc (modified) (2 diffs)
-
http/feed_resource.cc (modified) (2 diffs)
-
http/feed_resource.hh (modified) (2 diffs)
-
local/connection.cc (modified) (2 diffs)
-
msg/content_type.hh (modified) (2 diffs)
-
msg/entity.cc (modified) (5 diffs)
-
msg/entity.hh (modified) (2 diffs)
-
msg/entity_header.cc (added)
-
msg/entity_header.hh (added)
-
msg/message_entity.cc (modified) (2 diffs)
-
msg/message_entity.hh (modified) (1 diff)
-
msg/mime_entity.hh (deleted)
-
msg/multipart.cc (modified) (5 diffs)
-
msg/multipart.hh (modified) (1 diff)
-
msg/raw_entity.hh (added)
-
msg/text_plain.cc (modified) (2 diffs)
-
msg/text_plain.hh (modified) (5 diffs)
-
msg/util.cc (modified) (1 diff)
-
nntp/post.cc (modified) (1 diff)
-
smtp_client/smtp_client.cc (modified) (1 diff)
-
tlate/date_value.cc (modified) (1 diff)
-
tlate/msg_value.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
db/db.cc
r1a970cd r99057e4 225 225 226 226 // commit 227 ::msg::entity::ptr entity (new ::msg::entity(msgstr));227 ::msg::entity::ptr entity = ::msg::entity::mk(msgstr, false); 228 228 msg::ptr message(new msg::msg(msgid,entity)); 229 229 for (std::map<std::string, group::number>::const_iterator it = -
db/group.cc
r1a970cd r99057e4 69 69 if (recv.empty()) return rv; 70 70 71 ::msg::entity::ptr nm (new ::msg::entity(*m->get_entity()));71 ::msg::entity::ptr nm = m->get_entity()->clone(); 72 72 { 73 73 std::string subject = nm->get_field("subject", false); -
http/article_entry.cc
r1a970cd r99057e4 65 65 } 66 66 67 boost::shared_ptr<const msg:: mime_entity>67 boost::shared_ptr<const msg::entity> 68 68 article_entry::get_content() const 69 69 { 70 70 db::msg::const_ptr m = tn->get_article(); 71 return m->get_entity() ->get_mime_entity();71 return m->get_entity(); 72 72 } 73 73 -
http/article_entry.hh
r4c1c17d r99057e4 42 42 std::string get_title() const; 43 43 std::string get_author() const; 44 boost::shared_ptr<const msg:: mime_entity> get_content() const;44 boost::shared_ptr<const msg::entity> get_content() const; 45 45 std::string get_link() const; 46 46 boost::posix_time::ptime get_date() const; -
http/compose.cc
r1a970cd r99057e4 228 228 try 229 229 { 230 msg::entity::ptr e (new msg::entity(os.str()));230 msg::entity::ptr e = msg::entity::mk(os.str(), false); 231 231 msg::complete_mime(e); 232 232 m = cb.dbase().file(e, req->get_peer(), usr, cb); … … 382 382 body << from << " wrote: \n\n"; 383 383 384 msg::text_plain tp( *precursor->get_entity());384 msg::text_plain tp(precursor->get_entity()); 385 385 386 386 for (size_t i = 0; i < tp.num_paras(); i++) -
http/feed_resource.cc
r4c1c17d r99057e4 27 27 #include "../logger/logline.hh" 28 28 #include "../html/util.hh" 29 #include "../msg/ mime_entity.hh"29 #include "../msg/entity.hh" 30 30 31 31 namespace … … 100 100 it != entries.end(); it++) 101 101 { 102 msg:: mime_entity::const_ptr me = (*it)->get_content();102 msg::entity::const_ptr me = (*it)->get_content(); 103 103 tlate::value::ptr tv = me->get_tlate_value(true); 104 104 tlate::data_model::ptr am(new tlate::data_model); -
http/feed_resource.hh
r4c1c17d r99057e4 29 29 #include <list> 30 30 31 namespace msg { class mime_entity; }31 namespace msg { class entity; } 32 32 33 33 namespace http … … 61 61 virtual std::string get_title() const = 0; 62 62 virtual std::string get_author() const = 0; 63 virtual boost::shared_ptr<const msg:: mime_entity>63 virtual boost::shared_ptr<const msg::entity> 64 64 get_content() const = 0; 65 65 virtual std::string get_link() const = 0; -
local/connection.cc
r1a970cd r99057e4 99 99 util::streambuf_to_string(*sbp, n); 100 100 if (s.length() > n) s.resize(n); 101 ent .reset(new msg::entity(s));101 ent = msg::entity::mk(s, false); 102 102 } 103 103 catch (msg::format_violation &fv) … … 113 113 } 114 114 115 msg::entity::ptr m( new msg::entity(ms));115 msg::entity::ptr m(msg::entity::mk(ms, false)); 116 116 117 117 // identify action -
msg/content_type.hh
r868b365 r99057e4 1 1 /* This file is part of Alue, the multiprotocol Internet discussion daemon 2 2 3 Copyright © 2009 Antti-Juhani Kaijanaho3 Copyright © 2009, 2010 Antti-Juhani Kaijanaho 4 4 5 5 Alue is free software: you can redistribute it and/or modify it … … 51 51 return it->second; 52 52 } 53 void set_param(std::string name, std::string value) { 54 params[name] = value; 55 } 53 56 54 57 std::string to_string() const; -
msg/entity.cc
r1a970cd r99057e4 24 24 #include "text_plain.hh" 25 25 #include "util.hh" 26 #include "raw_entity.hh" 26 27 27 28 #include "../util.hh" … … 32 33 #include "../assert.hh" 33 34 34 namespace35 {36 // RFC 5322 ftext37 inline bool is_ftext(char c)38 {39 return (33 <= c && c <= 57) ||40 (59 <= c && c <= 126);41 }42 43 // RFC 5234 VCHAR44 inline bool is_vchar(char c)45 {46 return 0x21 <= c && c <= 0x7e;47 }48 49 // RFC 5234 WSP50 inline bool is_wsp(char c)51 {52 return c == ' ' || c == '\t';53 }54 55 }56 57 35 namespace msg 58 36 { 59 entity::entity(const entity &ent)60 : default_ct(ent.default_ct)61 , field_content(ent.field_content)62 , body(ent.body)63 , the_date(boost::posix_time::not_a_date_time)64 {65 for (std::list<std::string>::iterator it=field_content.begin();66 it != field_content.end(); it++)67 {68 std::string fc = *it;69 size_t colon = fc.find(':');70 assert(colon != std::string::npos);71 std::string fn = util::to_lower(fc.substr(0, colon));72 fields[fn] = it;73 }74 }75 76 entity::entity(std::string msgstr,77 std::string default_ct)78 : default_ct(default_ct)79 , the_date(boost::posix_time::not_a_date_time)80 {81 parse_headers(msgstr);82 }83 84 void entity::parse_headers(std::string msgstr)85 {86 size_t inx = 0;87 size_t name_start = 0;88 size_t body_start = 0;89 std::string field_name;90 91 FIELD_NAME:92 if (inx >= msgstr.length())93 {94 errors +=95 "message ends in the middle of a header name\n";96 goto HEADER_END;97 }98 99 if (is_ftext(msgstr[inx]))100 {101 inx++;102 goto FIELD_NAME;103 }104 if (msgstr[inx] != ':')105 {106 errors += boost::str(boost::format107 ("invalid character (0x%02x) "108 "in header field name\n")109 % (unsigned)msgstr[inx]);110 }111 field_name = msgstr.substr(name_start, inx - name_start);112 inx++;113 if (inx >= msgstr.length() || msgstr[inx] != ' ')114 {115 errors += "header field '" + field_name + "' "116 "is missing the mandatory space after colon\n";117 }118 inx++;119 body_start = inx;120 goto FIELD_BODY;121 122 FIELD_BODY:123 if (inx >= msgstr.length())124 {125 errors += "header field '" + field_name + "' "126 "terminates abruptly\n";127 goto HEADER_END;128 }129 if (is_vchar(msgstr[inx]) || is_wsp(msgstr[inx]))130 {131 inx++;132 goto FIELD_BODY;133 }134 if (msgstr[inx] != '\r')135 {136 errors += "header field '" + field_name + "' "137 "contains a character that is not allowed\n";138 }139 inx++;140 if (inx >= msgstr.length() || msgstr[inx] != '\n')141 {142 errors += "header field '" + field_name + "' "143 "contains a stray CR\n";144 }145 assert(inx < msgstr.length());146 inx++;147 if (inx < msgstr.length() && is_wsp(msgstr[inx]))148 {149 // folded header field150 goto FIELD_BODY;151 }152 // header field ends153 field_content.push_back(msgstr.substr(name_start,154 inx - name_start));155 boost::to_lower(field_name);156 fields[field_name] = boost::prior(field_content.end());157 if (inx + 1 < msgstr.length() &&158 msgstr[inx+0] == '\r' && msgstr[inx+1] == '\n')159 {160 inx += 2;161 goto HEADER_END;162 }163 name_start = inx;164 goto FIELD_NAME;165 166 HEADER_END:167 body = msgstr.substr(inx);168 }169 170 boost::posix_time::ptime entity::parsed_date() const171 {172 if (the_date == boost::posix_time::not_a_date_time)173 the_date = parse_date(get_field("Date", false));174 return the_date;175 }176 177 std::string entity::get_header() const178 {179 std::string rv;180 for (field_iterator it = fields_begin();181 it != fields_end(); it++)182 {183 rv += *it;184 }185 return rv;186 }187 188 std::string entity::get_field(std::string name, bool full) const189 {190 boost::to_lower(name);191 192 std::map<std::string, std::list<std::string>::iterator>193 ::const_iterator it = fields.find(name);194 if (it == fields.end()) return "";195 196 const std::string content = *it->second;197 if (full) {198 return content;199 } else {200 return content.substr(name.length() + 2);201 }202 }203 204 37 size_t entity::get_size() const 205 38 { 39 std::string body = get_body(); 206 40 size_t n = 0; 207 41 for (field_iterator it = fields_begin(); … … 217 51 size_t entity::get_body_lines() const 218 52 { 53 std::string body = get_body(); 219 54 unsigned long lines = -1; 220 55 size_t inx = std::string::npos; … … 228 63 } 229 64 230 void entity::replace_field(std::string name, std::string body)65 entity::ptr entity::mk(std::string ms, bool validate, std::string dct) 231 66 { 232 std::string fld = name + ": " + body + "\r\n"; 233 fld.reserve(fld.length()); 234 // fold it 235 const size_t line_maxlen = 998; 236 size_t lb = 0; 237 for (size_t i = line_maxlen; i < fld.length(); i += line_maxlen) 238 { 239 while (i > lb && fld[i] != ' ' && fld[i] != '\t') i--; 240 if (i == lb) break; 241 fld.insert(i, "\r\n"); 242 i += 2; 243 } 244 boost::to_lower(name); 245 std::map<std::string, std::list<std::string>::iterator> 246 ::iterator it = fields.find(name); 247 if (it == fields.end()) { 248 field_content.push_front(fld); 249 fields[name] = field_content.begin(); 250 } else { 251 *it->second = fld; 252 } 253 if (name == "date") 254 the_date = boost::posix_time::not_a_date_time; 255 } 67 entity_header::ptr hdr(new entity_header(ms, validate, dct)); 256 68 257 content_type entity::get_content_type() const 258 { 259 return content_type(has_field("content-type") 260 ? get_field("content-type", false) 261 : default_ct); 262 } 263 264 boost::shared_ptr<mime_entity> entity::get_mime_entity() const 265 { 266 boost::shared_ptr<mime_entity> rv; 267 content_type ct = get_content_type(); 69 entity::ptr rv; 70 content_type ct = hdr->get_content_type(); 268 71 switch (ct.get_type()) 269 72 { 270 73 case content_type::MESSAGE: 271 rv.reset(new message_entity( *this));74 rv.reset(new message_entity(hdr, ms)); 272 75 break; 273 76 case content_type::MULTIPART: 274 rv.reset(new multipart( *this));77 rv.reset(new multipart(hdr, ms)); 275 78 break; 276 case content_type::TEXT: default: 277 rv.reset(new text_plain(*this)); 79 case content_type::TEXT: 80 rv.reset(new text_plain(hdr, ms)); 81 break; 82 default: 83 rv.reset(new raw_entity(hdr, ms)); 278 84 break; 279 85 } … … 281 87 } 282 88 283 std::string entity::get_decoded_body() const284 {285 /* This here would decode content-transfer-encoding,286 but lacking realistic test cases I'm leaving this287 for later. */288 return get_body();289 }290 89 } -
msg/entity.hh
r1a970cd r99057e4 21 21 #define GUARD_MSG_ENTITY_HH 22 22 23 #include "format_violation.hh" 24 #include <boost/algorithm/string/case_conv.hpp> 25 #include <boost/date_time/posix_time/posix_time.hpp> 26 #include <boost/shared_ptr.hpp> 27 #include <list> 28 #include <map> 29 #include <string> 23 #include "entity_header.hh" 24 25 #define DEFAULT_CT "text/plain; charset=\"US-ASCII\"" 26 27 namespace tlate { class value; } 30 28 31 29 namespace msg … … 36 34 class entity 37 35 { 38 std::string errors;39 40 36 public: 41 37 typedef boost::shared_ptr<entity> ptr; 42 38 typedef boost::shared_ptr<const entity> const_ptr; 43 typedef std::list<std::string>::const_iterator field_iterator;39 typedef entity_header::field_iterator field_iterator; 44 40 45 explicit entity(std::string msgstr, 46 std::string default_ct = 47 "text/plain; charset=\"US-ASCII\""); 48 explicit entity(const entity &); 41 static ptr mk(std::string msgstr, 42 bool validate, 43 std::string default_ct = DEFAULT_CT); 49 44 50 45 virtual ~entity() {} 51 46 52 boost::posix_time::ptime parsed_date() const;47 virtual ptr clone() const = 0; 53 48 54 void validate_format() const { 55 if (!errors.empty()) throw format_violation(errors); 49 virtual boost::shared_ptr<tlate::value> 50 get_tlate_value(bool hide_addreses) const = 0; 51 52 boost::posix_time::ptime parsed_date() const { 53 return hdr->parsed_date(); 56 54 } 57 55 58 56 field_iterator fields_begin() const { 59 return field_content.begin();57 return hdr->fields_begin(); 60 58 } 61 59 62 field_iterator fields_end() const { 63 return field_content.end(); 60 field_iterator fields_end() const { return hdr->fields_end(); } 61 62 std::string get_header() const { return hdr->get_header(); } 63 virtual std::string get_body() const = 0; 64 virtual std::string get_decoded_body() const { 65 return get_body(); 64 66 } 65 66 std::string get_header() const;67 std::string get_body() const { return body; }68 std::string get_decoded_body() const;69 67 std::string get_entity() const { 70 68 return get_header() + "\r\n" + get_body(); 71 69 } 72 70 73 74 bool has_field(std::string s) const{ 75 boost::to_lower(s); 76 return fields.find(s) != fields.end(); 77 } 71 bool has_field(std::string s) const{ return hdr->has_field(s); } 78 72 79 73 // returns the field unprocessed 80 std::string get_field(std::string s, bool full) const; 74 std::string get_field(std::string s, bool full) const { 75 return hdr->get_field(s, full); 76 } 81 77 82 78 size_t get_size() const; 83 79 size_t get_body_lines() const; 84 80 85 virtual void replace_field(std::string name, std::string body); 81 void replace_field(std::string name, std::string body) { 82 return hdr->replace_field(name, body); 83 } 86 84 87 void replace_body(std::string s) { body = s; } 85 content_type get_content_type() const { 86 return hdr->get_content_type(); 87 } 88 88 89 content_type get_content_type() const; 90 91 boost::shared_ptr<mime_entity> get_mime_entity() const; 89 protected: 90 entity(entity_header::ptr hdr) 91 : hdr(hdr) 92 {} 93 entity(const entity &ent) 94 : hdr(new entity_header(*ent.hdr)) 95 {} 92 96 93 97 private: 94 std::string default_ct; 95 // this split is to both provide a fast name lookup 96 // and to preserve the field ordering 97 std::list<std::string> field_content; // includes the names 98 std::map<std::string, std::list<std::string>::iterator> fields; 99 std::string body; 100 mutable boost::posix_time::ptime the_date; 101 102 void parse_headers(std::string); 98 entity_header::ptr hdr; 103 99 104 100 entity &operator=(const entity &); // DISABLED -
msg/message_entity.cc
r1a970cd r99057e4 28 28 namespace msg 29 29 { 30 message_entity::message_entity(const entity & ent)31 : mime_entity(ent)32 , m(new entity(get_body()))33 {34 }35 30 36 31 boost::shared_ptr<tlate::value> … … 56 51 new tlate::date_value 57 52 (parse_date(m->get_field("Date", false)))); 58 mime_entity::const_ptr bme = m->get_mime_entity(); 59 am->insert("body", bme->get_tlate_value(munge)); 53 am->insert("body", m->get_tlate_value(munge)); 60 54 return am; 61 55 } -
msg/message_entity.hh
re7bbf3c r99057e4 21 21 #define GUARD_MSG_MESSAGE_ENTITY_HH 22 22 23 #include " mime_entity.hh"23 #include "entity.hh" 24 24 25 25 namespace msg 26 26 { 27 class message_entity : public mime_entity27 class message_entity : public entity 28 28 { 29 29 entity::ptr m; 30 30 31 public: 31 explicit message_entity(const entity &); 32 message_entity(entity_header::ptr hdr, std::string body) 33 : entity(hdr) 34 , m(entity::mk(body, false)) 35 {} 36 37 entity::ptr clone() const { 38 entity::ptr rv(new message_entity(*this)); 39 return rv; 40 } 41 42 std::string get_body() const { return m->get_entity(); } 32 43 33 44 boost::shared_ptr<tlate::value> get_tlate_value(bool) const; -
msg/multipart.cc
rc504199 r99057e4 25 25 namespace msg 26 26 { 27 multipart::multipart( const entity &ent)28 : mime_entity(ent)27 multipart::multipart(entity_header::ptr hdr, std::string str) 28 : entity(hdr) 29 29 { 30 30 content_type ct = get_content_type(); … … 32 32 throw std::logic_error("not multipart"); 33 33 std::string boundary = ct.get_param("boundary"); 34 std::string str = get_body();35 34 size_t bs = str.find("\r\n--"+boundary); 35 preamble = str.substr(0,bs); 36 36 std::string default_ct = ct.get_subtype() == "digest" 37 37 ? "message/rfc822" … … 39 39 while (bs != std::string::npos) 40 40 { 41 if (str.substr(bs + 4 + boundary.length(), 2) == "--")42 break;43 41 size_t be = str.find("\r\n", bs+2); 44 42 if (be == std::string::npos) be = str.length() - 2; 43 if (str.substr(bs + 4 + boundary.length(), 2) == "--") 44 { 45 trailer = be + 2 < str.length() 46 ? str.substr(be+2) 47 : ""; 48 break; 49 } 45 50 size_t ns = str.find("\r\n--"+boundary, be); 46 51 std::string sub = str.substr(be+2, ns - be); 47 entity::ptr sen( new entity(sub, default_ct));52 entity::ptr sen(entity::mk(sub, false, default_ct)); 48 53 parts.push_back(sen); 49 54 bs = ns; … … 57 62 for (size_t i = 0; i < parts.size(); i++) 58 63 { 59 mime_entity::ptr men = parts[i]->get_mime_entity();60 li->push_back( men->get_tlate_value(hide_addresses));64 entity::ptr en = parts[i]; 65 li->push_back(en->get_tlate_value(hide_addresses)); 61 66 } 62 67 tlate::data_model::ptr am(new tlate::data_model); … … 64 69 return am; 65 70 } 71 72 std::string multipart::get_body() const 73 { 74 content_type ct = get_content_type(); 75 std::string boundary = ct.get_param("boundary"); 76 std::ostringstream os; 77 os << preamble; 78 for (size_t i = 0; i < parts.size(); i++) 79 { 80 os << "\r\n--" << boundary << "\r\n"; 81 os << parts[i]->get_entity(); 82 } 83 os << "\r\n--" << boundary << "--\r\n"; 84 os << trailer; 85 return os.str(); 86 } 66 87 } -
msg/multipart.hh
rc504199 r99057e4 21 21 #define GUARD_MSG_MULTIPART_HH 22 22 23 #include " mime_entity.hh"23 #include "entity.hh" 24 24 #include <vector> 25 25 26 26 namespace msg 27 27 { 28 class multipart : public mime_entity28 class multipart : public entity 29 29 { 30 30 std::vector<entity::ptr> parts; 31 std::string preamble, trailer; 31 32 public: 32 explicit multipart(const entity &); 33 multipart(entity_header::ptr hdr, std::string body); 34 35 entity::ptr clone() const { 36 entity::ptr rv(new multipart(*this)); 37 return rv; 38 } 39 40 std::string get_body() const; 33 41 34 42 boost::shared_ptr<tlate::value> get_tlate_value(bool) const; -
msg/text_plain.cc
r62231ec r99057e4 19 19 20 20 #include "content_type.hh" 21 #include "entity_header.hh" 21 22 #include "text_plain.hh" 22 23 … … 26 27 #include "../util.hh" 27 28 29 namespace 30 { 31 msg::entity_header::ptr ct_hdr(msg::content_type ct) 32 { 33 std::string str = 34 std::string("Content-Type: ") + 35 ct.to_string() + "\r\n" + 36 "Content-Transfer-Encoding: 8bit\r\n" + 37 "\r\n"; 38 msg::entity_header::ptr rv(new msg::entity_header(str, 39 false, 40 ct.to_string() 41 ) 42 ); 43 return rv; 44 } 45 } 46 28 47 namespace msg 29 48 { 30 text_plain::text_plain(const entity &ent) 31 : mime_entity(ent) 32 { 33 init(); 34 } 35 36 text_plain::text_plain(std::string text, content_type ct) 37 : mime_entity(std::string("Content-Type: ") + 38 ct.to_string() + "\r\n" + 39 "Content-Transfer-Encoding: 8bit\r\n" + 40 "\r\n" + 41 text) 42 { 43 init(); 44 } 45 46 void text_plain::init() 47 { 48 std::string text = get_decoded_body(); 49 text_plain::text_plain(entity_header::ptr hdr, std::string body) 50 : entity(hdr) 51 { 52 init(body); 53 } 54 55 text_plain::text_plain(std::string body, content_type ct) 56 : entity(ct_hdr(ct)) 57 { 58 init(body); 59 } 60 61 text_plain::text_plain(entity::const_ptr e) 62 : entity(*e) 63 { 64 init(e->get_body()); 65 } 66 67 void text_plain::init(std::string text) 68 { 69 raw_body = text; 49 70 content_type ct = get_content_type(); 50 71 if (ct.get_type() != msg::content_type::TEXT || -
msg/text_plain.hh
r868b365 r99057e4 1 1 /* This file is part of Alue, the multiprotocol Internet discussion daemon 2 2 3 Copyright © 2009 Antti-Juhani Kaijanaho3 Copyright © 2009, 2010 Antti-Juhani Kaijanaho 4 4 5 5 Alue is free software: you can redistribute it and/or modify it … … 22 22 23 23 #include "content_type.hh" 24 #include " mime_entity.hh"24 #include "entity.hh" 25 25 26 26 #include <string> … … 29 29 namespace msg 30 30 { 31 class text_plain : public mime_entity31 class text_plain : public entity 32 32 { 33 33 public: … … 47 47 48 48 explicit text_plain(std::string body, content_type); 49 explicit text_plain(const entity &); 49 explicit text_plain(entity_header::ptr hdr, std::string body); 50 explicit text_plain(entity::const_ptr e); 50 51 51 52 size_t num_paras() const { return paras.size(); } … … 54 55 boost::shared_ptr<tlate::value> 55 56 get_tlate_value(bool hide_addreses) const; 57 58 std::string get_body() const { return raw_body; } 59 60 entity::ptr clone() const { 61 entity::ptr rv(new text_plain(*this)); 62 return rv; 63 } 56 64 private: 65 std::string raw_body; 57 66 std::vector<para> paras; 58 67 59 void init( );68 void init(std::string body); 60 69 }; 61 70 } -
msg/util.cc
r1a970cd r99057e4 256 256 void validate_imf(entity::const_ptr e) 257 257 { 258 e->validate_format();259 258 check_present(e, "From"); 260 259 check_present(e, "Date"); -
nntp/post.cc
r1a970cd r99057e4 42 42 try { 43 43 msg::entity::ptr e 44 ( new msg::entity(msg::dot_destuff(data)));44 (msg::entity::mk(msg::dot_destuff(data), true)); 45 45 m = c.dbase().file(e, c.peer(), c.identity(), 46 46 c.srv_cb()); -
smtp_client/smtp_client.cc
r1a970cd r99057e4 40 40 message = msg::crlf_canonize(message); 41 41 msg::entity::ptr msg 42 ( new msg::entity(msg::dot_destuff(message)));42 (msg::entity::mk(msg::dot_destuff(message), true)); 43 43 msg::complete_imf(msg); 44 44 msg::complete_mime(msg); -
tlate/date_value.cc
r1a970cd r99057e4 29 29 #include "../http/compose.hh" 30 30 #include "../msg/lexutils.hh" 31 #include "../msg/mime_entity.hh"32 31 #include "../uri.hh" 33 32 -
tlate/msg_value.cc
r1a970cd r99057e4 33 33 #include "../msg/entity.hh" 34 34 #include "../msg/lexutils.hh" 35 #include "../msg/mime_entity.hh"36 35 #include "../uri.hh" 37 36 … … 174 173 rv.reset(new header_value(e,!u)); 175 174 else if (rauthz && m && var == "body") 176 { 177 msg::mime_entity::const_ptr me = e->get_mime_entity(); 178 rv = me->get_tlate_value(authn); 179 } 175 rv = e->get_tlate_value(authn); 180 176 else if (rauthz && m && var == "xref") 181 177 rv.reset(new xref_seq(m, u));
