Diffstat (limited to 'noncore/unsupported/mailit/emailhandler.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.cpp | 17 |
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 @@ -191,31 +191,37 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) if ((p.separatorAt(pos) == '<') || (p.separatorAt(pos) == ' ')) //No name.. nasty pos++; pos++; mail->fromMail = p.getString(&pos, 'z', TRUE); if (mail->fromMail.at(mail->fromMail.length()-1) == '>') mail->fromMail.truncate(mail->fromMail.length() - 1); mail->from=mail->fromMail; } } //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: - if (pos = p.find("TO",':', pos, TRUE) != -1) + if ((pos = p.find("TO",':', 0, TRUE)) != -1) { pos++; mail->recipients.append (p.getString(&pos, 'z', TRUE) ); } - + //@@@ToDo: Rewrite the parser as To: stops at the first occurence- which is Delivered-To: + if ((pos = p.find("CC",':', 0, TRUE)) != -1) + { + pos++; + mail->carbonCopies.append (p.getString(&pos, 'z', TRUE) ); + } + if ((pos = p.find("SUBJECT",':', 0, TRUE)) != -1) { pos++; mail->subject = p.getString(&pos, 'z', TRUE); } if ((pos = p.find("DATE",':', 0, TRUE)) != -1) { pos++; mail->date = p.getString(&pos, 'z', true); } @@ -425,24 +431,31 @@ int EmailHandler::encodeMime(Email *mail) QString fileName, fileType, contentType, newBody, boundary; Enclosure *ePtr; QString userName = mailAccount.name; if (userName.length()>0) //only embrace it if there is a user name userName += " <" + mailAccount.emailAddress + ">"; //add standard headers newBody = "From: " + userName + "\r\nTo: "; for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { newBody += *it + " "; } + + newBody += "\r\nCC: "; + + for (QStringList::Iterator it = mail->carbonCopies.begin(); it != mail->carbonCopies.end(); ++it ) { + newBody += *it + " "; + } + newBody += "\r\nSubject: " + mail->subject + "\r\n"; if (mail->files.count() == 0) { //just a simple mail newBody += "\r\n" + mail->body; mail->rawMail = newBody; return 0; } //Build mime encoded mail boundary = "-----4345=next_bound=0495----"; newBody += "Mime-Version: 1.0\r\n"; |