summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2003-06-09 01:48:19 (UTC)
committer llornkcor <llornkcor>2003-06-09 01:48:19 (UTC)
commit69a1d4d6b5b16fa3c014fad0a30d5893eced6963 (patch) (unidiff)
treec63fa8f9042de2e9d5e252fbcca17b6570bbdfe9 /noncore
parent364e6e65b4c3b4ceec2b1b6688f2ca2b3dce4560 (diff)
downloadopie-69a1d4d6b5b16fa3c014fad0a30d5893eced6963.zip
opie-69a1d4d6b5b16fa3c014fad0a30d5893eced6963.tar.gz
opie-69a1d4d6b5b16fa3c014fad0a30d5893eced6963.tar.bz2
patch from wim delvaux.
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mailit/emailclient.cpp2
-rw-r--r--noncore/net/mailit/emailhandler.cpp13
-rw-r--r--noncore/unsupported/mailit/emailclient.cpp2
-rw-r--r--noncore/unsupported/mailit/emailhandler.cpp13
4 files changed, 20 insertions, 10 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
@@ -266,13 +266,13 @@ void EmailClient::enqueMail(const Email &mail)
266 qWarning("using account " + currentAccount->name); 266 qWarning("using account " + currentAccount->name);
267 } 267 }
268 268
269 Email addMail = mail; 269 Email addMail = mail;
270 addMail.from = currentAccount->name; 270 addMail.from = currentAccount->name;
271 addMail.fromMail = currentAccount->emailAddress; 271 addMail.fromMail = currentAccount->emailAddress;
272 addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n"); 272 addMail.rawMail.prepend("From: \"" + addMail.from + "\" <" + addMail.fromMail + ">\n");
273 item = new EmailListItem(outboxView, addMail, false); 273 item = new EmailListItem(outboxView, addMail, false);
274 274
275 mailboxView->setCurrentTab(1); 275 mailboxView->setCurrentTab(1);
276 276
277} 277}
278 278
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
@@ -68,13 +68,15 @@ EmailHandler::EmailHandler()
68} 68}
69 69
70void EmailHandler::sendMail(QList<Email> *mailList) 70void EmailHandler::sendMail(QList<Email> *mailList)
71{ 71{
72 Email *currentMail; 72 Email *currentMail;
73 QString temp; 73 QString temp;
74 QString userName = mailAccount.name; 74 QString userName = QString::null;
75 // not supported by ALL SMTP servers in the MAIL From field
76 // userName = "\""+mailAccount.name+"\"";
75 userName += " <" + mailAccount.emailAddress + ">"; 77 userName += " <" + mailAccount.emailAddress + ">";
76 78
77 for (currentMail = mailList->first(); currentMail != 0; 79 for (currentMail = mailList->first(); currentMail != 0;
78 currentMail = mailList->next()) { 80 currentMail = mailList->next()) {
79 81
80 if (encodeMime(currentMail) == 0) { 82 if (encodeMime(currentMail) == 0) {
@@ -439,16 +441,19 @@ int EmailHandler::parse64base(char *src, char *bufOut) {
439 441
440int EmailHandler::encodeMime(Email *mail) 442int EmailHandler::encodeMime(Email *mail)
441{ 443{
442 444
443 QString fileName, fileType, contentType, newBody, boundary; 445 QString fileName, fileType, contentType, newBody, boundary;
444 Enclosure *ePtr; 446 Enclosure *ePtr;
447 QString userName;
445 448
446 QString userName = mailAccount.name; 449 if ( ! mailAccount.name.isEmpty() ) {
447 if (userName.length()>0) //only embrace it if there is a user name 450 userName = "\"" + mailAccount.name + "\" <" + mailAccount.emailAddress + ">";
448 userName += " <" + mailAccount.emailAddress + ">"; 451 } else {
452 userName = "<" + mailAccount.emailAddress + ">";
453 }
449 454
450 //add standard headers 455 //add standard headers
451 newBody = "From: " + userName + "\r\nTo: "; 456 newBody = "From: " + userName + "\r\nTo: ";
452 for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { 457 for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) {
453 newBody += *it + " "; 458 newBody += *it + " ";
454 } 459 }
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
@@ -266,13 +266,13 @@ void EmailClient::enqueMail(const Email &mail)
266 qWarning("using account " + currentAccount->name); 266 qWarning("using account " + currentAccount->name);
267 } 267 }
268 268
269 Email addMail = mail; 269 Email addMail = mail;
270 addMail.from = currentAccount->name; 270 addMail.from = currentAccount->name;
271 addMail.fromMail = currentAccount->emailAddress; 271 addMail.fromMail = currentAccount->emailAddress;
272 addMail.rawMail.prepend("From: " + addMail.from + "<" + addMail.fromMail + ">\n"); 272 addMail.rawMail.prepend("From: \"" + addMail.from + "\" <" + addMail.fromMail + ">\n");
273 item = new EmailListItem(outboxView, addMail, false); 273 item = new EmailListItem(outboxView, addMail, false);
274 274
275 mailboxView->setCurrentTab(1); 275 mailboxView->setCurrentTab(1);
276 276
277} 277}
278 278
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
@@ -68,13 +68,15 @@ EmailHandler::EmailHandler()
68} 68}
69 69
70void EmailHandler::sendMail(QList<Email> *mailList) 70void EmailHandler::sendMail(QList<Email> *mailList)
71{ 71{
72 Email *currentMail; 72 Email *currentMail;
73 QString temp; 73 QString temp;
74 QString userName = mailAccount.name; 74 QString userName = QString::null;
75 // not supported by ALL SMTP servers in the MAIL From field
76 // userName = "\""+mailAccount.name+"\"";
75 userName += " <" + mailAccount.emailAddress + ">"; 77 userName += " <" + mailAccount.emailAddress + ">";
76 78
77 for (currentMail = mailList->first(); currentMail != 0; 79 for (currentMail = mailList->first(); currentMail != 0;
78 currentMail = mailList->next()) { 80 currentMail = mailList->next()) {
79 81
80 if (encodeMime(currentMail) == 0) { 82 if (encodeMime(currentMail) == 0) {
@@ -439,16 +441,19 @@ int EmailHandler::parse64base(char *src, char *bufOut) {
439 441
440int EmailHandler::encodeMime(Email *mail) 442int EmailHandler::encodeMime(Email *mail)
441{ 443{
442 444
443 QString fileName, fileType, contentType, newBody, boundary; 445 QString fileName, fileType, contentType, newBody, boundary;
444 Enclosure *ePtr; 446 Enclosure *ePtr;
447 QString userName;
445 448
446 QString userName = mailAccount.name; 449 if ( ! mailAccount.name.isEmpty() ) {
447 if (userName.length()>0) //only embrace it if there is a user name 450 userName = "\"" + mailAccount.name + "\" <" + mailAccount.emailAddress + ">";
448 userName += " <" + mailAccount.emailAddress + ">"; 451 } else {
452 userName = "<" + mailAccount.emailAddress + ">";
453 }
449 454
450 //add standard headers 455 //add standard headers
451 newBody = "From: " + userName + "\r\nTo: "; 456 newBody = "From: " + userName + "\r\nTo: ";
452 for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) { 457 for (QStringList::Iterator it = mail->recipients.begin(); it != mail->recipients.end(); ++it ) {
453 newBody += *it + " "; 458 newBody += *it + " ";
454 } 459 }