Skip to content

Module dkim_signing: wrong getting domain name from 'header' (MIME From) #1808

@alexxkn

Description

@alexxkn

Classification (Please choose one option):

  • Crash/Hang/Data loss
  • WebUI/Usability
  • Serious bug
  • Other bug
  • Feature
  • Enhancement

Reproducibility (Please choose one option):

  • Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try
  • Not applicable

Rspamd version:

1.6.3

Operation system, CPU, memory and environment:

CentOS 7, kernel 4.12.6, vcpu 4, ram 8Gb

Description (Please provide a descriptive summary of the issue):

Hello. I tried to configure module dkim_signing for signing different domains with different dkim keys.
I have some third-level domains. I sent mail from my postfix with one of them, but rspamd didn't properly select the domain name. I tried to use different setting, but my result always the same - wrong.
Please, tell me, what am I doing wrong? =)

Steps to reproduce:

telnet first.mydomain.com 25
HELO itsme.localhost
MAIL FROM:[email protected]
rcpt to: [email protected]
DATA
FROM: [email protected]
TO: [email protected]
SUBJECT: DKIM test
DKIM test
.

Expected results:

DKIM: PASS

Actual results:

2017-08-24 09:58:52 #11(normal) <f35cef>; task; lua_dkim_sign_handler: cannot load dkim key /var/lib/rspamd/arc/mydomain.com.arc.key: cannot stat private key /var/lib/rspamd/arc/mydomain.com.arc.key: No such file or directory
2017-08-24 09:58:52 #11(normal) <f35cef>; task; lua_dkim_sign_handler: cannot load dkim key /var/lib/rspamd/dkim/mydomain.com.dkim.key: cannot stat private key /var/lib/rspamd/dkim/mydomain.com.dkim.key: No such file or directory

Configuration:

postfix/main.conf
...
smtpd_milters = inet:first.mydomain.com:11332
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_default_action = accept
milter_protocol = 6
...

rspamd/rspamd.conf
...
dkim_signing {
allow_envfrom_empty = true;
allow_hdrfrom_mismatch = false;
allow_hdrfrom_multiple = false;
allow_username_mismatch = false;
auth_only = true;
sign_local = true;
symbol = "DKIM_SIGNED";
try_fallback = true;
use_domain = "header";
use_domain_sign_local = "header";
use_esld = true;
use_redis = false;

domain {
first.mydomain.com {
path = "/var/lib/rspamd/dkim/first.mydomain.com.key";
selector = "mail";}
}
}

Additional information:

If I set default path and default selector I see in the original text of the letter:
DKIM: | UNKNOWN, domain nul
dkim=temperror (no key for signature) [email protected] header.s=mail header.b=...;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions