From 69a1d4d6b5b16fa3c014fad0a30d5893eced6963 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Mon, 09 Jun 2003 01:48:19 +0000 Subject: patch from wim delvaux. --- (limited to 'noncore') 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 @@ -269,7 +269,7 @@ void EmailClient::enqueMail(const Email &mail) 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); 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 @@ -71,8 +71,10 @@ void EmailHandler::sendMail(QList *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()) { @@ -442,10 +444,13 @@ 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: "; 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 @@ -269,7 +269,7 @@ void EmailClient::enqueMail(const Email &mail) 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); 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 @@ -71,8 +71,10 @@ void EmailHandler::sendMail(QList *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()) { @@ -442,10 +444,13 @@ 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: "; -- cgit v0.9.0.2