-rw-r--r-- | noncore/net/mailit/emailclient.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mailit/emailhandler.cpp | 15 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emailclient.cpp | 2 | ||||
-rw-r--r-- | noncore/unsupported/mailit/emailhandler.cpp | 15 |
4 files changed, 22 insertions, 12 deletions
diff --git a/noncore/net/mailit/emailclient.cpp b/noncore/net/mailit/emailclient.cpp index 749a4e9..90664bb 100644 --- a/noncore/net/mailit/emailclient.cpp +++ b/noncore/net/mailit/emailclient.cpp @@ -260,25 +260,25 @@ void EmailClient::enqueMail(const Email &mail) tr("No account selected"), tr("You must create an account"), "OK\n"); return; } if (accountList.count() > 0) { currentAccount = accountList.first(); qWarning("using account " + currentAccount->name); } Email addMail = mail; addMail.from = currentAccount->name; addMail.fromMail = currentAccount->emailAddress; - addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n"); + addMail.rawMail.prepend("From: \"" + addMail.from + "\" <" + addMail.fromMail + ">\n"); item = new EmailListItem(outboxView, addMail, false); mailboxView->setCurrentTab(1); } void EmailClient::sendQuedMail() { int count = 0; if (accountList.count() == 0) { QMessageBox::warning(qApp->activeWindow(), "No account selected", "You must create an account", "OK\n"); diff --git a/noncore/net/mailit/emailhandler.cpp b/noncore/net/mailit/emailhandler.cpp index 5b8bda1..06e978d 100644 --- a/noncore/net/mailit/emailhandler.cpp +++ b/noncore/net/mailit/emailhandler.cpp @@ -62,26 +62,28 @@ EmailHandler::EmailHandler() //relaying size information connect(popClient, SIGNAL(currentMailSize(int)), this, SIGNAL(currentMailSize(int)) ); connect(popClient, SIGNAL(downloadedSize(int)), this, SIGNAL(downloadedSize(int)) ); } void EmailHandler::sendMail(QList<Email> *mailList) { Email *currentMail; QString temp; - QString userName = mailAccount.name; - userName += " <" + mailAccount.emailAddress + ">"; + QString userName = QString::null; + // not supported by ALL SMTP servers in the MAIL From field + // userName = "\""+mailAccount.name+"\""; + userName += "<" + mailAccount.emailAddress + ">"; for (currentMail = mailList->first(); currentMail != 0; currentMail = mailList->next()) { if (encodeMime(currentMail) == 0) { smtpClient->addMail(userName, currentMail->subject, currentMail->recipients, currentMail->rawMail); } else { //error temp = tr("Could not locate all files in \nmail with subject: ") + currentMail->subject; temp += tr("\nMail has NOT been sent"); QMessageBox::warning(qApp->activeWindow(), tr("Attachment error"), temp, tr("OK\n")); @@ -433,28 +435,31 @@ int EmailHandler::parse64base(char *src, char *bufOut) { bufOut[2] = bufOut[2] | z; //third byte retrieved processed++; } } return processed; } int EmailHandler::encodeMime(Email *mail) { QString fileName, fileType, contentType, newBody, boundary; Enclosure *ePtr; + QString userName; - QString userName = mailAccount.name; - if (userName.length()>0) //only embrace it if there is a user name - userName += " <" + mailAccount.emailAddress + ">"; + if ( ! mailAccount.name.isEmpty() ) { + userName = "\"" + mailAccount.name + "\" <" + mailAccount.emailAddress + ">"; + } else { + 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 + " "; } diff --git a/noncore/unsupported/mailit/emailclient.cpp b/noncore/unsupported/mailit/emailclient.cpp index 749a4e9..90664bb 100644 --- a/noncore/unsupported/mailit/emailclient.cpp +++ b/noncore/unsupported/mailit/emailclient.cpp @@ -260,25 +260,25 @@ void EmailClient::enqueMail(const Email &mail) tr("No account selected"), tr("You must create an account"), "OK\n"); return; } if (accountList.count() > 0) { currentAccount = accountList.first(); qWarning("using account " + currentAccount->name); } Email addMail = mail; addMail.from = currentAccount->name; addMail.fromMail = currentAccount->emailAddress; - addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n"); + addMail.rawMail.prepend("From: \"" + addMail.from + "\" <" + addMail.fromMail + ">\n"); item = new EmailListItem(outboxView, addMail, false); mailboxView->setCurrentTab(1); } void EmailClient::sendQuedMail() { int count = 0; if (accountList.count() == 0) { QMessageBox::warning(qApp->activeWindow(), "No account selected", "You must create an account", "OK\n"); diff --git a/noncore/unsupported/mailit/emailhandler.cpp b/noncore/unsupported/mailit/emailhandler.cpp index 5b8bda1..06e978d 100644 --- a/noncore/unsupported/mailit/emailhandler.cpp +++ b/noncore/unsupported/mailit/emailhandler.cpp @@ -62,26 +62,28 @@ EmailHandler::EmailHandler() //relaying size information connect(popClient, SIGNAL(currentMailSize(int)), this, SIGNAL(currentMailSize(int)) ); connect(popClient, SIGNAL(downloadedSize(int)), this, SIGNAL(downloadedSize(int)) ); } void EmailHandler::sendMail(QList<Email> *mailList) { Email *currentMail; QString temp; - QString userName = mailAccount.name; - userName += " <" + mailAccount.emailAddress + ">"; + QString userName = QString::null; + // not supported by ALL SMTP servers in the MAIL From field + // userName = "\""+mailAccount.name+"\""; + userName += "<" + mailAccount.emailAddress + ">"; for (currentMail = mailList->first(); currentMail != 0; currentMail = mailList->next()) { if (encodeMime(currentMail) == 0) { smtpClient->addMail(userName, currentMail->subject, currentMail->recipients, currentMail->rawMail); } else { //error temp = tr("Could not locate all files in \nmail with subject: ") + currentMail->subject; temp += tr("\nMail has NOT been sent"); QMessageBox::warning(qApp->activeWindow(), tr("Attachment error"), temp, tr("OK\n")); @@ -433,28 +435,31 @@ int EmailHandler::parse64base(char *src, char *bufOut) { bufOut[2] = bufOut[2] | z; //third byte retrieved processed++; } } return processed; } int EmailHandler::encodeMime(Email *mail) { QString fileName, fileType, contentType, newBody, boundary; Enclosure *ePtr; + QString userName; - QString userName = mailAccount.name; - if (userName.length()>0) //only embrace it if there is a user name - userName += " <" + mailAccount.emailAddress + ">"; + if ( ! mailAccount.name.isEmpty() ) { + userName = "\"" + mailAccount.name + "\" <" + mailAccount.emailAddress + ">"; + } else { + 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 + " "; } |