Commit b55df6bf 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
parent 0ed91a33
......@@ -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,
......@@ -334,10 +346,12 @@ bool MailClient::send( const KPIMIdentities::Identity &identity,
KPIMUtils::normalizeAddressesAndEncodeIdn( from ) ) );
}
qjob->addressAttribute().setTo( KPIMUtils::splitAddressList( to ) );
qjob->addressAttribute().setCc( KPIMUtils::splitAddressList( cc ) );
if( !to.isEmpty() )
qjob->addressAttribute().setTo( extractEmailAndNormalize( to ) );
if( !cc.isEmpty() )
qjob->addressAttribute().setCc( extractEmailAndNormalize( cc ) );
if ( bccMe ) {
qjob->addressAttribute().setBcc( KPIMUtils::splitAddressList( from ) );
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