You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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:
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
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)
Activity
icgood commentedon 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 commentedon Apr 7, 2014
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 commentedon Jul 15, 2014
hi rgcarrasqueira,
Why do you close this issue? Do you manage to solve it?
rgcarrasqueira commentedon Jul 18, 2014
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:
reikjarloekl commentedon Apr 4, 2015
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 commentedon Mar 18, 2024
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:
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):