Configuring DKIM for Emails Sent From the Server

When sending letters using the php mail() function, there may be difficulties in specifying the DKIM signature. To do this, you can use the PHPMailer library or plugins for sending emails to the CMS.

In order for the messages to be sent to pass DKIM verification:

  1. Connect to the server via SSH.
  2. Generate a private key (replace mydomain.com with your domain):
    openssl genrsa -out mydomain.com.private 1024 
  3. Save the path to the generated key - the mydomain.com.private file. The file will be saved in the directory from which the command was executed.
  4. Generate a public key:
    openssl rsa -in mydomain.com.private -out mydomain.com.public -pubout
    The content of the public key file looks like this:
    -----BEGIN PUBLIC KEY-----

    key content

    -----END PUBLIC KEY-----
  5. In the domain settings, create a TXT record for the mail._mydomainkey.domain.com subdomain with the following content:
    k=rsa; p= key_from_step _4
    The key must be specified on one line, without BEGIN and END.
  6. In the settings of the PHPMailer library script or the CMS plugin used for sending emails, specify the full path to the mydomain.com.private file that was generated in step 2 (for example, /home/u/user/mydomain.com.private).

If you are using PHPMailer, you must specify the path in the DKIM_private parameter; specify mail in the DKIM_selector parameter.

If you have any questions, please create a ticket to technical support.