KNOWNHOST WIKI

User Tools

Site Tools


control-panels:directadmin:enabling-dkim-with-directadmin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
control-panels:directadmin:enabling-dkim-with-directadmin [2019/11/07 14:20]
Karson N. [Enabling the Ability For the Users To Choose Whether To Enable DKIM]
control-panels:directadmin:enabling-dkim-with-directadmin [2020/06/01 11:01] (current)
Karson N.
Line 1: Line 1:
 ====== Enabling DKIM with DirectAdmin ====== ====== Enabling DKIM with DirectAdmin ======
- 
 \\ \\
  
Line 8: Line 7:
  
 \\ \\
- 
 ===== Important Considerations ===== ===== Important Considerations =====
  
Line 14: Line 12:
  
 \\ \\
- 
 ===== Enabling the Ability For the Users To Choose Whether To Enable DKIM ===== ===== Enabling the Ability For the Users To Choose Whether To Enable DKIM =====
    
 To allow the users to choose whether or not to enable DKIM, you must set dkim to the value of 2 in the directadmin.conf and the rewrite Exim's configuration files and recompile Exim for this.  Log into the server via SSH as the root user and issue the following command to do this: To allow the users to choose whether or not to enable DKIM, you must set dkim to the value of 2 in the directadmin.conf and the rewrite Exim's configuration files and recompile Exim for this.  Log into the server via SSH as the root user and issue the following command to do this:
 +<code>
   /usr/local/directadmin/directadmin set dkim 2 restart   /usr/local/directadmin/directadmin set dkim 2 restart
   cd /usr/local/directadmin/custombuild   cd /usr/local/directadmin/custombuild
Line 24: Line 21:
   ./build exim   ./build exim
   ./build eximconf   ./build eximconf
 +</code>
  
 Now, a user can enable DKIM with a click of a button in the DirectAdmin interface via **User Level -> E-Mail Accounts -> Enable DKIM** Now, a user can enable DKIM with a click of a button in the DirectAdmin interface via **User Level -> E-Mail Accounts -> Enable DKIM**
Line 31: Line 29:
  
 \\ \\
- 
 ===== Enabling DKIM Globablly By Default For All (Future and/or Existing Domains) ===== ===== Enabling DKIM Globablly By Default For All (Future and/or Existing Domains) =====
  
 +\\
 === For Future Domains === === For Future Domains ===
 If you'd prefer to have a DKIM record created by default upon domain creation, you would need to set to the dkim option in the directadmin.conf to a value of 1. To do this, run the following commands via SSH as the root user: If you'd prefer to have a DKIM record created by default upon domain creation, you would need to set to the dkim option in the directadmin.conf to a value of 1. To do this, run the following commands via SSH as the root user:
 +<code>
   /usr/local/directadmin/directadmin set dkim 1 restart   /usr/local/directadmin/directadmin set dkim 1 restart
   cd /usr/local/directadmin/custombuild   cd /usr/local/directadmin/custombuild
Line 42: Line 40:
   ./build exim   ./build exim
   ./build eximconf   ./build eximconf
 +</code>
  
 Now, all future domains will have a DKIM record created by default.  Now, all future domains will have a DKIM record created by default. 
  
 \\ \\
- 
 === For Existing Domains === === For Existing Domains ===
  
Line 52: Line 50:
  
 To enable DKIM for all existing domains after setting dkim to 1 in the directadmin.conf, you can run the following command via SSH as the root user: To enable DKIM for all existing domains after setting dkim to 1 in the directadmin.conf, you can run the following command via SSH as the root user:
 +<code>
   echo "action=rewrite&value=dkim" >> /usr/local/directadmin/data/task.queue; /usr/local/directadmin/dataskq   echo "action=rewrite&value=dkim" >> /usr/local/directadmin/data/task.queue; /usr/local/directadmin/dataskq
 +</code>
  
 To enable DKIM for only select domains one-by-one, use either the task queue or  dkim_create.sh script provided by DirectAdmin (replace DOMAIN.COM with the domain you'd like DKIM enabled for): To enable DKIM for only select domains one-by-one, use either the task queue or  dkim_create.sh script provided by DirectAdmin (replace DOMAIN.COM with the domain you'd like DKIM enabled for):
 +<code>
   cd /usr/local/directadmin/scripts/dkim_create.sh DOMAIN.COM   cd /usr/local/directadmin/scripts/dkim_create.sh DOMAIN.COM
 +</code>
  
 Or: Or:
  
 +<code>
   echo "action=rewrite&value=dkim&domain=DOMAIN.COM&dns=yes" >> /usr/local/directadmin/data/task.queue; /usr/local/directadmin/dataskq   echo "action=rewrite&value=dkim&domain=DOMAIN.COM&dns=yes" >> /usr/local/directadmin/data/task.queue; /usr/local/directadmin/dataskq
 +</code>
  
-Note that both commands work the same way with the exception that you can have the DKIM written immediately with the dataskq verses within one minute with the dkim_create.sh script.+**Note:** that both commands work the same way with the exception that you can have the DKIM written immediately with the dataskq verses within one minute with the dkim_create.sh script.
  
 \\ \\
- 
 ===== Disabling DKIM on a Per User Basis When Enabled or Permitted Globally ===== ===== Disabling DKIM on a Per User Basis When Enabled or Permitted Globally =====
  
Line 76: Line 77:
  
 To remove the records from the default domain,  remove the x._domainkey TXT record from /var/named/DOMAIN.TLD.db and then remove the keys: To remove the records from the default domain,  remove the x._domainkey TXT record from /var/named/DOMAIN.TLD.db and then remove the keys:
 +<code>
   rm /etc/virtual/DOMAIN.COM/dkim.public.key   rm /etc/virtual/DOMAIN.COM/dkim.public.key
   rm /etc/virtual/DOMAIN.COM/dkim.private.key   rm /etc/virtual/DOMAIN.COM/dkim.private.key
 +</code>
  
 Now, edit the user.conf so that no subsequent domains created under the user have DKIM records enabled by setting dkim=0. The user.conf can be edited via SSH as the root user and the file is located here (where USERNAME represents the username of the user you are editing): Now, edit the user.conf so that no subsequent domains created under the user have DKIM records enabled by setting dkim=0. The user.conf can be edited via SSH as the root user and the file is located here (where USERNAME represents the username of the user you are editing):
- +<code> 
-/usr/local/directadmin/data/users/USERNAME/user.conf+  /usr/local/directadmin/data/users/USERNAME/user.conf 
 +</code>
  
 This allows that particular user's dkim setting to override the globally enabled dkim setting set in the directadmin.conf and thus prevents any DKIM records from being created for that user's domains moving forward.  This allows that particular user's dkim setting to override the globally enabled dkim setting set in the directadmin.conf and thus prevents any DKIM records from being created for that user's domains moving forward. 
  
 Restart DirectAdmin after making the changes: Restart DirectAdmin after making the changes:
 +<code>
   service directadmin restart   service directadmin restart
 +</code>
  
 \\ \\
- 
 ===== Disabling DKIM on a Per Domain Basis ===== ===== Disabling DKIM on a Per Domain Basis =====
  
Line 99: Line 102:
  
 Restart DirectAdmin after making changes to the DOMAIN.TLD.conf file: Restart DirectAdmin after making changes to the DOMAIN.TLD.conf file:
 +<code>
   service directadmin restart   service directadmin restart
 +</code>
  
 \\ \\
- 
 ===== Changing the Default Selector ===== ===== Changing the Default Selector =====
  
 DirectAdmin uses //x// as the default selector. To change the selector, you will need to update the directadmin.conf with the desired selector. The following examples change the selector to //default//: DirectAdmin uses //x// as the default selector. To change the selector, you will need to update the directadmin.conf with the desired selector. The following examples change the selector to //default//:
 +<code>
   /usr/local/directadmin/directadmin set dkim_selector default restart   /usr/local/directadmin/directadmin set dkim_selector default restart
 +</code>
  
 CustomBuild 2.0 rev 1824 will automatically swap the selector in the /etc/exim.dkim.conf. You will need to rebuild the Exim configuration like so: CustomBuild 2.0 rev 1824 will automatically swap the selector in the /etc/exim.dkim.conf. You will need to rebuild the Exim configuration like so:
-  +<code>
   /usr/local/directadmin/custombuild/build exim_conf   /usr/local/directadmin/custombuild/build exim_conf
 +</code>
  
 Confirm the selector was swapped in the /etc/exim.dkim.conf file: Confirm the selector was swapped in the /etc/exim.dkim.conf file:
 +<code>
   [root@host ~]# grep -i selector /etc/exim.dkim.conf    [root@host ~]# grep -i selector /etc/exim.dkim.conf 
     dkim_selector = default     dkim_selector = default
   [root@host ~]#    [root@host ~]# 
 +</code>
  
 Now, any newly created DKIM records will use your specified selector. Do note that you will need to remove and recreate the old DKIM records that use the old selector if you want them to use the new selector.  Now, any newly created DKIM records will use your specified selector. Do note that you will need to remove and recreate the old DKIM records that use the old selector if you want them to use the new selector. 
  
 If you need any help, don't hesitate to open a support request with your KnownHost support team! We're happy to help. :) If you need any help, don't hesitate to open a support request with your KnownHost support team! We're happy to help. :)
- 
- 
control-panels/directadmin/enabling-dkim-with-directadmin.txt · Last modified: 2020/06/01 11:01 by Karson N.