-rw-r--r-- | noncore/net/mailit/emailhandler.cpp | 13 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.cpp | 13 |
2 files changed, 2 insertions, 24 deletions
diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp index c7b27a0..62fa64f 100644 --- a/noncore/net/mailit/emailhandler.cpp +++ b/noncore/net/mailit/emailhandler.cpp @@ -177,80 +177,69 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) TextParser p(header, lineShift); if ((pos = p.find("FROM",':', 0, TRUE)) != -1) { pos++; if (p.separatorAt(pos) == ' ') { mail->from = p.getString(&pos, '<', false); mail->from = mail->from.stripWhiteSpace(); if ( (mail->from.length() > 2) && (mail->from[0] == '"') ) { mail->from = mail->from.left(mail->from.length() - 1); mail->from = mail->from.right(mail->from.length() - 1); } pos++; mail->fromMail = p.getString(&pos, '>', false); } else { if (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; } } pos=0; //Search for To: after the FROM: attribute to prevent hitting the Delivered-To: while((pos = p.find("TO",':', pos+1, TRUE))!=-1) { QString rec; - if (p.separatorAt(pos-1)!='-') + if (p.separatorAt(pos-1)!='-') //The - separator means that this is a Delivered-To: or Reply-To: { pos++; mail->recipients.append(p.getString(&pos, '\r', TRUE)); } - /*else { - 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; - } - mail->recipients.append (p.getString(&pos, 'z', TRUE) ); - }*/ } // //if (pos==-1) mail->recipients.append (tr("undisclosed recipients") ); 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); } if ((pos = p.find("MESSAGE",'-', 0, TRUE)) != -1) { pos++; if ( (p.wordAt(pos).upper() == "ID") && (p.separatorAt(pos) == ':') ) { id = p.getString(&pos, 'z', TRUE); mail->id = id; } } diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp index c7b27a0..62fa64f 100644 --- a/noncore/unsupported/mailit/emailhandler.cpp +++ b/noncore/unsupported/mailit/emailhandler.cpp @@ -177,80 +177,69 @@ bool EmailHandler::parse(QString in, QString lineShift, Email *mail) TextParser p(header, lineShift); if ((pos = p.find("FROM",':', 0, TRUE)) != -1) { pos++; if (p.separatorAt(pos) == ' ') { mail->from = p.getString(&pos, '<', false); mail->from = mail->from.stripWhiteSpace(); if ( (mail->from.length() > 2) && (mail->from[0] == '"') ) { mail->from = mail->from.left(mail->from.length() - 1); mail->from = mail->from.right(mail->from.length() - 1); } pos++; mail->fromMail = p.getString(&pos, '>', false); } else { if (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; } } pos=0; //Search for To: after the FROM: attribute to prevent hitting the Delivered-To: while((pos = p.find("TO",':', pos+1, TRUE))!=-1) { QString rec; - if (p.separatorAt(pos-1)!='-') + if (p.separatorAt(pos-1)!='-') //The - separator means that this is a Delivered-To: or Reply-To: { pos++; mail->recipients.append(p.getString(&pos, '\r', TRUE)); } - /*else { - 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; - } - mail->recipients.append (p.getString(&pos, 'z', TRUE) ); - }*/ } // //if (pos==-1) mail->recipients.append (tr("undisclosed recipients") ); 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); } if ((pos = p.find("MESSAGE",'-', 0, TRUE)) != -1) { pos++; if ( (p.wordAt(pos).upper() == "ID") && (p.separatorAt(pos) == ':') ) { id = p.getString(&pos, 'z', TRUE); mail->id = id; } } |