Commit c865c3bc authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

When dkim is invalid don't show all info

parent d511acc2
......@@ -144,7 +144,7 @@ void DKIMCheckFullJob::slotCheckAuthenticationStatusResult(const MessageViewer::
converter.setStatusInfo(info);
//TODO Convert to CheckSignatureAuthenticationResult + add this list to CheckSignatureResult directly
const QVector<DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult> lst = converter.convert();
qDebug() << " lst " << lst;
//qDebug() << " lst " << lst;
//TODO use it.
//TODO check info ! if auth is ok not necessary to checkSignature
......@@ -168,6 +168,7 @@ void DKIMCheckFullJob::storeResult(const DKIMCheckSignatureJob::CheckSignatureRe
}
if (mCheckPolicy.autogenerateRule()) {
if (mCheckPolicy.autogenerateRuleOnlyIfSenderInSDID()) {
//TODO
//Check value SDID !
if (checkResult.status == DKIMCheckSignatureJob::DKIMStatus::Valid) {
DKIMGenerateRuleJob *job = new DKIMGenerateRuleJob(this);
......
......@@ -216,60 +216,62 @@ void DKIMWidgetInfo::updateToolTip()
break;
}
for (const DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult &result : qAsConst(mResult.listSignatureAuthenticationResult)) {
switch (result.status) {
case DKIMCheckSignatureJob::DKIMStatus::Unknown:
case DKIMCheckSignatureJob::DKIMStatus::Invalid:
case DKIMCheckSignatureJob::DKIMStatus::NeedToBeSigned:
break;
case DKIMCheckSignatureJob::DKIMStatus::EmailNotSigned:
switch(result.method) {
case DKIMCheckSignatureJob::AuthenticationMethod::Unknown: {
if (mResult.status != DKIMCheckSignatureJob::DKIMStatus::Invalid) {
for (const DKIMCheckSignatureJob::DKIMCheckSignatureAuthenticationResult &result : qAsConst(mResult.listSignatureAuthenticationResult)) {
switch (result.status) {
case DKIMCheckSignatureJob::DKIMStatus::Unknown:
case DKIMCheckSignatureJob::DKIMStatus::Invalid:
case DKIMCheckSignatureJob::DKIMStatus::NeedToBeSigned:
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Spf:
case DKIMCheckSignatureJob::AuthenticationMethod::Dkim:
case DKIMCheckSignatureJob::AuthenticationMethod::Dmarc:
case DKIMCheckSignatureJob::AuthenticationMethod::Dkimatps: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: None", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
case DKIMCheckSignatureJob::DKIMStatus::EmailNotSigned:
switch(result.method) {
case DKIMCheckSignatureJob::AuthenticationMethod::Unknown: {
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Spf:
case DKIMCheckSignatureJob::AuthenticationMethod::Dkim:
case DKIMCheckSignatureJob::AuthenticationMethod::Dmarc:
case DKIMCheckSignatureJob::AuthenticationMethod::Dkimatps: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: None", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
break;
}
}
break;
}
}
break;
case DKIMCheckSignatureJob::DKIMStatus::Valid:
switch(result.method) {
case DKIMCheckSignatureJob::AuthenticationMethod::Unknown: {
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Dkim: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid (Signed by %2)", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method),
result.sdid);
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Spf: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
case DKIMCheckSignatureJob::DKIMStatus::Valid:
switch(result.method) {
case DKIMCheckSignatureJob::AuthenticationMethod::Unknown: {
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Dkim: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid (Signed by %2)", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method),
result.sdid);
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Spf: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Dmarc: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Dkimatps: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
break;
}
}
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Dmarc: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
break;
}
case DKIMCheckSignatureJob::AuthenticationMethod::Dkimatps: {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("%1: Valid", MessageViewer::DKIMUtil::convertAuthenticationMethodEnumToString(result.method));
break;
}
}
break;
}
}
if (mResult.listSignatureAuthenticationResult.isEmpty()) {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("Not Signed");
if (mResult.listSignatureAuthenticationResult.isEmpty()) {
tooltip += (tooltip.isEmpty() ? QChar() : QLatin1Char('\n'))
+ i18n("Not Signed");
}
}
//TODO remove duplicate info.
qCDebug(MESSAGEVIEWER_DKIMCHECKER_LOG) << "mResult.authentication " << mResult.listSignatureAuthenticationResult;
......
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