summaryrefslogtreecommitdiff
path: root/noncore/unsupported/mailit/emailhandler.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp
index 03f8a28..f6c6d60 100644
--- a/noncore/unsupported/mailit/emailhandler.cpp
+++ b/noncore/unsupported/mailit/emailhandler.cpp
@@ -197,19 +197,25 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail)
197 mail->fromMail.truncate(mail->fromMail.length() - 1); 197 mail->fromMail.truncate(mail->fromMail.length() - 1);
198 mail->from=mail->fromMail; 198 mail->from=mail->fromMail;
199 } 199 }
200 } 200 }
201 201
202 //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: 202 //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To:
203 if (pos = p.find("TO",':', pos, TRUE) != -1) 203 if ((pos = p.find("TO",':', 0, TRUE)) != -1)
204 { 204 {
205 pos++; 205 pos++;
206 mail->recipients.append (p.getString(&pos, 'z', TRUE) ); 206 mail->recipients.append (p.getString(&pos, 'z', TRUE) );
207 } 207 }
208 208
209 209 //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To:
210 if ((pos = p.find("CC",':', 0, TRUE)) != -1)
211 {
212 pos++;
213 mail->carbonCopies.append (p.getString(&pos, 'z', TRUE) );
214 }
215
210 216
211 if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { 217 if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) {
212 pos++; 218 pos++;
213 mail->subject = p.getString(&pos, 'z', TRUE); 219 mail->subject = p.getString(&pos, 'z', TRUE);
214 } 220 }
215 if ((pos = p.find("DATE",':', 0, TRUE)) != -1) { 221 if ((pos = p.find("DATE",':', 0, TRUE)) != -1) {
@@ -431,12 +437,19 @@ int EmailHandler::encodeMime(Email *mail)
431 437
432 //add standard headers 438 //add standard headers
433 newBody = "From: " + userName + "\r\nTo: "; 439 newBody = "From: " + userName + "\r\nTo: ";
434 for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { 440 for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) {
435 newBody += *it + " "; 441 newBody += *it + " ";
436 } 442 }
443
444 newBody += "\r\nCC: ";
445
446 for (QStringList::Iterator it = mail->carbonCopies.begin(); it != mail->carbonCopies.end(); ++it ) {
447 newBody += *it + " ";
448 }
449
437 newBody += "\r\nSubject: " + mail->subject + "\r\n"; 450 newBody += "\r\nSubject: " + mail->subject + "\r\n";
438 451
439 if (mail->files.count() == 0) { //just a simple mail 452 if (mail->files.count() == 0) { //just a simple mail
440 newBody += "\r\n" + mail->body; 453 newBody += "\r\n" + mail->body;
441 mail->rawMail = newBody; 454 mail->rawMail = newBody;
442 return 0; 455 return 0;