Email Notification in Koha! How to configure Email Notification in Koha 20.11 with postfix?



Here is the steps to configuring Koha 20.11 & postfix for sending notices/slips through email.

1. First install postfix

            #sudo apt-get update
            #sudo apt-get install postfix
    
    Click on OK.

   Tab and select No configuration.


2. Copy the configuration file

    cp /usr/share/postfix/main.cf.debian /etc/postfix/main.cf

3. Install the other required packages.

    #apt-get install libsasl2-2
    #apt-get install libsasl2-modules
    #apt-get install ca-certificates

4. Open the following file and add few lines.

    #vim /etc/postfix/main.cf

and add the following lines at the bottom of the page and save the file.



    relayhost = [smtp.gmail.com]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = noanonymous
    smtp_tls_CAfile = /etc/postfix/cacert.pem
    smtp_use_tls = yes



5. Now create a new file to save the gmail password
   # touch /etc/postfix/sasl_passwd
   
  Add the following line with correct gmail id and password and save it
   
    [smtp.gmail.com]:587    sonam@gmail.com:yourpasswordhere


6. Change the permission of following file.
      #chmod 400 /etc/postfix/sasl_passwd    (note if you want to edit the password change                                                                          the permission to 700 and set back to 400)


7.  Next, to translate the /etc/postfix/sasl_passwd to Postfix lookup tables run the following command
   #postmap /etc/postfix/sasl_passwd

8. Now create aliases.DB run the following command
   # postalias hash:/etc/aliases


9. For certificate run the following command
    #cat /etc/ssl/certs/thawte_Primary_Root_CA.pem  >> /etc/postfix/cacert.pem

10. Restart the postfix:
    #/etc/init.d/postfix restart

11. To enable the email service in Koha run the following command;

   #koha-email-enable library   //where library is the koha instanace name

NOTE : To check if the postfix works, run the following command.

echo "Test Postfix Gmail LIBRARY" | mail -s "Postfix Gmail SMTP Relay" reciever@gmail.com

[If it doesn't work, allow less secure app setting in the senders gmail account setting]


13. For each patron category we have to enable the email notice option. For this go to

      Koha --> Administration --> Patron Categories --> Overdue Notice required  --> YES.



14. Next make necessary changes in Gobal System preferences: 
 Gobal System preferences --> Administration-->  KohaAdminEmailAddress,  provide koha admin email id from which the emails will be sent. 
 Gobal System preferences-->Patron  -->AutoEmailOpacUser --> send
 Gobal System preferences-->Patron  -->AutoEmailPrimaryAddress --> first valid
 Gobal System preferences-->Patron -->Enhancedmessagingpreferences --> Allow

15. Se the triggers to send the notice. To do this go to Koha --> Tools --> Overdue Notice/status triggers
     




16. Now to customize the notices you can go to Koha--> Tools --> Notices & Slips.

17. Now set up a cronjob to activate the scripts.
       # cd /usr/share/koha/bin/cronjobs
       #./overdue_notices.pl
       #./advance_notices.pl -c
       #./process_message_queue.pl

18. Setup a cronjob
      #crontab -e
     
     add the following line at the end of the file:

     ####run cron at 5 a.m every morning########

     0 5 * * * /etc/cron.daily/koha-common






Comments

  1. http://kohageek.blogspot.com/search/label/borrowers-force-messaging-defaults

    ReplyDelete
  2. is there a way to configure smtp using other mail server than gmail?

    ReplyDelete

Post a Comment

Popular posts from this blog

ACTION_FAILED:OU_INVALID: Solution for GoogleApps bulk user upload issue, username@domainname.com:ACTION_FAILED:OU_INVALID. This error is because you have not specified the Org Unit Path properly.

Moodle OAuth 2. This account is pending email confirmation! Solved

Enable SIP2 in Koha. How to configure SIP server in Koha 18.11??