Skip to content

DKIM #21

Open
Open

Description

@rgcarrasqueira

Hi Ian,

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

Thanks so much!

Activity

  1. icgood commented on Apr 1, 2014

    @icgood
    Member

    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.

  2. rgcarrasqueira commented on Apr 7, 2014

    @rgcarrasqueira
    ContributorAuthor

    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

  3. blackrosezy commented on Jul 15, 2014

    @blackrosezy

    hi rgcarrasqueira,

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

  4. rgcarrasqueira commented on Jul 18, 2014

    @rgcarrasqueira
    ContributorAuthor

    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).

  5. reikjarloekl commented on Apr 4, 2015

    @reikjarloekl

    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

  6. reopened this on Jun 18, 2019
  7. zombified commented on Mar 18, 2024

    @zombified

    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

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