1

Topic: [FAQ] How to dump disclaimer text from LDAP/MySQL automaticly.

Note

Signing disclaimer on outgoing mails is available in iRedMail/iRedOS-0.5.0 and later, users upgrade from 0.4.0 or even older versions can add this feature manually with steps explained in our Upgrade Tutorial (0.4.0 -> 0.5.0).
============

Note

============

iRedAdmin-v1.1.0+ ships python script used to dump disclaimer text from OpenLDAP server. Below is steps to use it:

  • Find script in iRedAdmin installation directory, default is /var/www/iredadmin/tools/dump_disclaimer.py

  • Open it and edit below variables

# -------------------------- Settings ------------------------------
# Directory used to store disclaimer files.
# Default directory is /etc/postfix/disclaimer/.
# Default disclaimer file name is [domain_name].txt
DISCLAIMER_DIR='/etc/postfix/disclaimer'    # NOT need to end with slash ('/').
DISCLAIMER_FILE_EXT='.txt'

# Debug: True, False
# WARNING:
#   * If set to True, cron daemon will send output message to root user.
DEBUG = False

# Backend used to store disclaimer: ldap, mysql. 
BACKEND='ldap'

############################################################
# LDAP Settings. Required if you use LDAP backend.
#
# LDAP server address.
LDAP_URI = 'ldap://127.0.0.1:389'

# LDAP base dn.
LDAP_BASEDN = 'o=domains,dc=iredmail,dc=org'

# LDAP bind dn & password.
# WARNING:
#   * Only READ permission is requied for dumping disclaimer text.
#   * Use 'cn=vmailadmin' or 'cn=Manager' is *NOT* recommended.
#   * 'cn=vmail' IS recommended.
# TIP:
#   You can find password for 'cn=vmail' in /etc/postfix/ldap_*.cf.
LDAP_BINDDN = 'cn=vmail,dc=iredmail,dc=org'
LDAP_BINDPW = 'WEx7NAeBV9WrAPbGpehyN2pwymvTe5'
  • Add one more crontab job for root user.

# crontab -e -u root
*/1   *   *   *   *   python /var/www/iredadmin/tools/dump_disclaimer.py

Note: Here we make it dump disclaimer every minute (*/1), you can change it to other interval you like, such as every 5 minutes (*/5), 30 minutes (*/30).