https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43568

--- Comment #2 from Kyle M Hall (khall) <[email protected]> ---
Created attachment 206314
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206314&action=edit
Bug 43568: Use EmailSMSSendDriverSMTPServer when sending SMS messages by email

Currently, when SMSSendDriver is set to Email, the SMS message is sent as an
email using the SMTP server belonging to the patron's home library, or the
default SMTP server if that library doesn't have one. The server is chosen in
C4::Letters::_send_message_by_email, which doesn't look at the message
transport type, so the patron's branch is the only thing that decides which
server sends an Email to SMS message.

Some libraries have a dedicated SMS to Email gateway, or possibly would like
to keep SMS traffic off the server that sends their regular notices so it can
be rate limited on its own. Right now the only way to do that is to route by
sender or recipient domain in the MTA that Koha relays through.

This patch adds a new system preference, EmailSMSSendDriverSMTPServer. When it
holds the id of an SMTP server, messages with a transport type of sms are sent
using that server instead of the patron's library's server. If the preference
is empty, or points at a server that no longer exists, nothing changes.

Test Plan:
1) Apply these patches
2) Run updatedatabase.pl
3) Restart all the things!
4) Browse to Administration > SMTP servers, add a server pointing at your
   working SMTP host, set it as the default
5) Add a second server named "SMS gateway" using the same host but a port
   nothing is listening on, note its id
6) Set SMSSendDriver to Email, give a patron an smsalertnumber and an SMS
   provider, and enable an SMS notice for that patron
7) Leave EmailSMSSendDriverSMTPServer empty, trigger an SMS notice and run
   misc/cronjobs/process_message_queue.pl, note the message is sent!
8) Set EmailSMSSendDriverSMTPServer to the "SMS gateway" id, trigger another
   SMS notice and run process_message_queue.pl, note the message fails
   because that server is unreachable
9) Trigger a regular email notice for the same patron, run
   process_message_queue.pl, note it is still sent, only SMS moved!
10) Edit "SMS gateway" to use the working port, trigger another SMS notice and
    run process_message_queue.pl, note the message is sent!
11) Set EmailSMSSendDriverSMTPServer to an id no server has, trigger an SMS
    notice and run process_message_queue.pl, note the message is still sent
    using the patron's library's server, and a warning is logged

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to