{"id":1636,"date":"2019-11-19T14:42:50","date_gmt":"2019-11-19T06:42:50","guid":{"rendered":"https:\/\/www.computersolutions.cn\/blog\/?p=1636"},"modified":"2019-11-19T14:42:50","modified_gmt":"2019-11-19T06:42:50","slug":"qmail-dkim-settings","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2019\/11\/qmail-dkim-settings\/","title":{"rendered":"qmail-dkim settings"},"content":{"rendered":"<p>As I can never find this online, and man -l \/var\/qmail\/man\/man8\/qmail-dkim.8 is a pain, I&#8217;ve posted the DKIM settings below.<\/p>\n<p>&#8212;<\/p>\n<p>The complete set of letters with the corresponding return status is given below<\/p>\n<p>A &#8211; DKIM_SUCCESS                        &#8211; Function executed successfully<br \/>\nB &#8211; DKIM_FINISHED_BODY                  &#8211; process result: no more message<br \/>\nbody is needed<br \/>\nC &#8211; DKIM_PARTIAL_SUCCESS                &#8211; verify result: at least one<br \/>\nbut not all signatures verified<br \/>\nD &#8211; DKIM_NEUTRAL                        &#8211; verify result: no signatures<br \/>\nverified but message is<br \/>\nnot suspicious<br \/>\nE &#8211; DKIM_SUCCESS_BUT_EXTRA              &#8211; signature result: signature<br \/>\nverified but it did not<br \/>\ninclude all of the body<br \/>\nF &#8211; DKIM_3PS_SIGNATURE                  &#8211; 3rd-party signature<br \/>\nG &#8211; DKIM_FAIL                           &#8211; Function failed to execute<br \/>\nH &#8211; DKIM_BAD_SYNTAX                     &#8211; signature error: DKIM-Signature<br \/>\ncould not parse or has bad<br \/>\ntags\/values<br \/>\nI &#8211; DKIM_SIGNATURE_BAD                  &#8211; signature error: RSA verify<br \/>\nfailed<br \/>\nJ &#8211; DKIM_SIGNATURE_BAD_BUT_TESTING      &#8211; signature error: RSA verify<br \/>\nfailed but testing<br \/>\nK &#8211; DKIM_SIGNATURE_EXPIRED              &#8211; signature error: x= is old<br \/>\nL &#8211; DKIM_SELECTOR_INVALID               &#8211; signature error: selector doesn&#8217;t<br \/>\nparse or contains invalid values<br \/>\nM &#8211; DKIM_SELECTOR_GRANULARITY_MISMATCH  &#8211; signature error: selector<br \/>\ng= doesn&#8217;t match i=<br \/>\nN &#8211; DKIM_SELECTOR_KEY_REVOKED           &#8211; signature error: selector<br \/>\np= empty<br \/>\nO &#8211; DKIM_SELECTOR_DOMAIN_NAME_TOO_LONG  &#8211; signature error: selector domain<br \/>\nname too long to request<br \/>\nP &#8211; DKIM_SELECTOR_DNS_TEMP_FAILURE      &#8211; signature error: temporary dns<br \/>\nfailure requesting selector<br \/>\nQ &#8211; DKIM_SELECTOR_DNS_PERM_FAILURE      &#8211; signature error: permanent dns<br \/>\nfailure requesting selector<br \/>\nR &#8211; DKIM_SELECTOR_PUBLIC_KEY_INVALID    &#8211; signature error: selector<br \/>\np= value invalid or wrong format<br \/>\nS &#8211; DKIM_NO_SIGNATURES                  &#8211; no signatures<br \/>\nT &#8211; DKIM_NO_VALID_SIGNATURES            &#8211; no valid signatures<br \/>\nU &#8211; DKIM_BODY_HASH_MISMATCH             &#8211; sigature verify error: message<br \/>\nbody does not hash to bh value<br \/>\nV &#8211; DKIM_SELECTOR_ALGORITHM_MISMATCH    &#8211; signature error: selector<br \/>\nh= doesn&#8217;t match signature a=<br \/>\nW &#8211; DKIM_STAT_INCOMPAT                  &#8211; signature error: incompatible v=<br \/>\nX &#8211; DKIM_UNSIGNED_FROM                  &#8211; signature error: not all message&#8217;s<br \/>\nFrom headers in signature<\/p>\n<p>For example, if you want to permanently reject messages that have a signature that is expired, include the letter &#8216;K&#8217; in the DKIMVERIFY environment variable.  A conservative set of letters is FGHIKLMNOQR\u2010<br \/>\nTUVWjp.   Reject  permanently  3PS,  FAILURE,  SYNTAX,  SIGNATURE_BAD,  SIGNATURE_EXPIRED,  SELECTOR_INVALID, GRANULARITY_MISMATCH, SELECTOR_KEY_REVOKED, DOMAIN_NAME_TOO_LONG, SELECTOR_PUBLIC_KEY_INVALID,<br \/>\nNO_VALID_SIGNATURES and BODY_HASH_MISMATCH errors, and temporarily SIGNATURE_BAD_BUT_TESTING and DNS_TEMP_FAILURE .  Add in S if you want to reject messages that do not have a DKIM signature. You can  use<br \/>\nthe  control  files  signaturedomains  and  nosignature domains (See Below) to further fine tune the action to be taken when a mail arrives with no DKIM signature.  Note that qmail-dkim always inserts the<br \/>\nDKIM-Status header, so that messages can be rejected later at delivery time, or in the mail reader. In that case you may set DKIMVERIFY to an empty string. If you want to check all message&#8217;s  From  header<br \/>\nin  signature  set  the  UNSIGNED_FROM environment variable to an empty string. If you want to check messages without signed subject header, set UNSIGNED_SUBJECT environment variable. If you want to honor<br \/>\nbody lengh tag (l=), set HONOR_BODYLENGTHTAG environment variable.<\/p>\n<p>qmail-dkim supports signing practice which can be additonall checked when a signature verifcation fails &#8211;<\/p>\n<p>SSP &#8211; Sender Signing Practice<\/p>\n<p>and<\/p>\n<p>ADSP &#8211; Author Domain Signing Practice.<\/p>\n<p>When a signature fails to verify for a message, you can use SSP\/ADSP to determine if the message is suspicious or not.  To verify a message against SSP\/ADSP, set the DKIMPRACTICE environment  variable  to<br \/>\nthe  desired  set  of  letters  allowed for DKIMVERIFY environment variable.  SSP\/ADSP should be used only when signature verification fails. SSP\/ADSP should be invoked only when libdkim returns the error<br \/>\ncodes (F,G,H,I,J,K,L,M,N,P,Q,R,S,T,U,V,W,X) for signature verification. In case you want to test against SSP\/ADSP only for DKIM_NO_SIGNATURE and DKIM_NO_VALID_SIGNATURE set the environment variable  DKIM\u2010<br \/>\nPRACTICE=&#8221;ST&#8221;.  If you want automatic behaviour, set DKIMPRACTICE to an empty string. In this case ADSP\/SSP will be used when return code matches &#8220;FGHIJKLMNPQRSTUVWX&#8221;.  qmail-dkim uses ADSP as the default<br \/>\nsigning practice. You can override this by setting the SIGN_PRACTICE to ssp, adsp, local (lowercase).  if you set SIGN_PRACTICE to local, qmail-dkim will check the domain against the control  file  signa\u2010<br \/>\nturedomains  (See  Below).  If the domain is found listed in signaturedomains qmail-dkim will bypass ADSP\/SSP and return DKIM_FAIL if signature fails to verify. Setting SIGN_PRACTICE to anything else will<br \/>\ncause qmail-dkim to disable Signing Practice.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As I can never find this online, and man -l \/var\/qmail\/man\/man8\/qmail-dkim.8 is a pain, I&#8217;ve posted the DKIM settings below. &#8212; The complete set of letters with the corresponding return status is given below A &#8211; DKIM_SUCCESS &#8211; Function executed successfully B &#8211; DKIM_FINISHED_BODY &#8211; process result: no more message body is needed C &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1636","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=1636"}],"version-history":[{"count":3,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1636\/revisions"}],"predecessor-version":[{"id":1639,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/1636\/revisions\/1639"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=1636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=1636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=1636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}