Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DKIM #21

Open
rgcarrasqueira opened this issue Apr 1, 2014 · 6 comments
Open

DKIM #21

rgcarrasqueira opened this issue Apr 1, 2014 · 6 comments

Comments

@rgcarrasqueira
Copy link
Contributor

Hi Ian,

Is there in the pipeline a slimta's version with DKIM support?

Thanks so much!

@icgood
Copy link
Member

icgood commented Apr 1, 2014

There should be! I haven't had need for it yet, but the dkimpy project appears to be perfect for the job. It probably won't take long to add.

@rgcarrasqueira
Copy link
Contributor Author

Hi Ian,

I've tried to use DKIM, it signs the message but I'm having problem to sign correctly the message. I've created an Edge that write and sign my email messages there but, the always appear a error about messagen content changed and the sign fails. There is correctly place (Edge, StaticRelay or other..) to put the message to sign and send it correctly?

Thanks so much!

Rogério Carrasqueira

@blackrosezy
Copy link

hi rgcarrasqueira,

Why do you close this issue? Do you manage to solve it?

@rgcarrasqueira
Copy link
Contributor Author

Yes We solved! Thanks

Rogério Carrasqueira


e-mail: rogerio.carrasqueira@gmail.com
skype: rgcarrasqueira
MSN: rcarrasqueira@hotmail.com
twitter: @Carrasqueira
Tel.: (11) 95708-0074
PMI Member ID: 2329374

2014-07-14 23:24 GMT-03:00 Mohd Rozi notifications@github.com:

hi rgcarrasqueira,

Why do you close this issue? Do you manage to solve it?


Reply to this email directly or view it on GitHub
#21 (comment).

@reikjarloekl
Copy link

hi rgcarrasqueira,

could you elaborate on how you managed to get it to work? I am looking at the same problem right now.

thanks and best regards,

Jörn

@zombified
Copy link

no relation to the original poster or other solutions, but for reference, the things that are needed to get dkim integrated in a custom deployment would be:

  1. creating a subclass of slimta.policy.RelayPolicy and writing an "apply" method that uses dkimpy to generate the signing header based on the info in the given envelop, and then appends the signature to the envelope
  2. add the policy to the relay object being used (eg slimta.relay.smtp.mx.MxSmtpRelay or some subclass of it)

it should only be ~120 lines of code at most for the specific needs of dkim, and that's pretty generous

the core of the custom policy is going to be something like this (example, non-functional):

header_data, message_data = env.flatten()
rfc822msg = "{}{}".format(header_data.decode(), message_data.decode())

# defaults for the dkimpy library
ident = None
canon = (b'relaxed', b'relaxed')
algo = b'rsa-sha256'
length = False

sig = sign(rfc822msg.encode(),
    selector.encode(),
    domain.encode(),
    privkey.encode(),
    identity=ident,
    canonicalize=canon,
    signature_algorithm=algo,
    include_headers=headers,
    length=length,
    logger=logger)
sigd = sig.decode()[16:].rstrip()
# there really should just be one dkim signing header
del env.headers['DKIM-Signature']
env.prepend_header("DKIM-Signature", sigd)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants