Commit 10a7a626 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix Bug 284685 - korganizer-generated mails cannot be sent

FIXED-IN: 4.8.1
BUG: 284685
(cherry picked from commit b55df6bf)

Conflicts:

	calendarsupport/mailclient.cpp
parent 5b300a02
......@@ -182,6 +182,18 @@ bool MailClient::mailTo( const KCalCore::IncidenceBase::Ptr &incidence,
bccMe, attachment, mailTransport );
}
QStringList extractEmailAndNormalize( const QString& email )
{
const QStringList splittedEmail = KPIMUtils::splitAddressList( email );
QStringList normalizedEmail;
Q_FOREACH( const QString& email, splittedEmail )
{
const QString str = KPIMUtils::extractEmailAddress( KPIMUtils::normalizeAddressesAndEncodeIdn( email ) );
normalizedEmail << str;
}
return normalizedEmail;
}
bool MailClient::send( const KPIMIdentities::Identity &identity,
const QString &from, const QString &_to,
const QString &cc, const QString &subject,
......@@ -326,10 +338,12 @@ bool MailClient::send( const KPIMIdentities::Identity &identity,
else
qjob->addressAttribute().setFrom( KPIMUtils::extractEmailAddress( KPIMUtils::normalizeAddressesAndEncodeIdn( from ) ) );
qjob->addressAttribute().setTo( KPIMUtils::splitAddressList( to ) );
qjob->addressAttribute().setCc( KPIMUtils::splitAddressList( cc ) );
if( bccMe ) {
qjob->addressAttribute().setBcc( KPIMUtils::splitAddressList( from ) );
if( !to.isEmpty() )
qjob->addressAttribute().setTo( extractEmailAndNormalize( to ) );
if( !cc.isEmpty() )
qjob->addressAttribute().setCc( extractEmailAndNormalize( cc ) );
if ( bccMe ) {
qjob->addressAttribute().setBcc( extractEmailAndNormalize( from ) );
}
qjob->setMessage( message );
if( ! qjob->exec() ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment