How to get the DKIM public key from Plesk if DNS is not installed

Follow

Comments

8 comments

  • Avatar
    Pascal Saul

    Is it possible to show the public key in the control panel under "Mail Settings" please. We're not all admins ;)

    Your example is not complete and should be:

    default._domainkey.example.com IN TXT "v=DKIM1;k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+aOU9Dw2Qedi6qOEcpbGQ3pHVI8SonKGNSBBgiImChx6k6I7s1UqeCzaHpKXKLIY4GA601gloVCnnTumZ/5TxnviBHg1a2lsatt/gCj2pl61a+uALM1oRdgPhxPYefloFpi0lau8thV6u9BYTfUgfqIF+dvFIVlu0MULsWDDJfwIDAQAB

  • Avatar
    Ivan Postnikov

    @Pascal Saul

    Thank you for the feedback.

    The feature suggestion about showing public key in Plesk UI may be created at Plesk User Voice

  • Avatar
    Prodesignerch

    Error, no such file or directory. :( 

  • Avatar
    Ivan Postnikov

    @Prodesignerch, please, could you give more details about the issue?

    When do you have this error shown? During which step of resolution?

    Also, let us know what OS and Plesk versions do you use?

  • Avatar
    Adl

    Hi, on my test system seems that script not recognize ${NEW_DOMAIN_NAME} parameter.

    I can only see this in /tmp/dkim_keys, a file called

    "dkim_key_.txt"

    And inside this file only

    "default._domainkey. IN TXT "v=DKIM1;k=rsa; p="

    Thanks a lot.

     

  • Avatar
    Harm Jakob Tolsma

    I kept getting errors when verifying DKIM. "OpenSSL wrong tag"
    After some searching I found the reason.
    The script in zip-file seems to use the private key in the output for the record when it is actually the public key that needs to be included.

    ## recreate key:
    openssl rsa -in /etc/domainkeys/$new_domain_name/default -pubout -out public.key  --> Here we create a public key

    ## crop first and last line of keyfile
    sed '1d;$d' /etc/domainkeys/$new_domain_name/default > $tmp_path/$tmp_prefix$new_domain_name$tmp_fe   --> here we trim the private key

    Everything worked as expected after I changed the last line to:
    sed '1d;$d' public.key > $tmp_path/$tmp_prefix$new_domain_name$tmp_fe

  • Avatar
    Bato Tsydenov

    Hello Harm Jakob Tolsma

    Thank you for bringing this to our attention.

    I have updated the script so that it is working correctly now.

  • Avatar
    Alexandr Shadrin

    Also, automatic script should be executed only via Tools & Settings > Event Manager, manual execution of the script via the command line will not work.

Please sign in to leave a comment.

Have more questions? Submit a request