Msmtp: Difference between revisions

From Request Tracker Wiki
Jump to navigation Jump to search
m (→‎The executable file: fixed missing argument to msmtp wrapper)
 
(5 intermediate revisions by 4 users not shown)
Line 14: Line 14:
* Place this file in your RT etc directory, such as /opt/rt3/etc/msmtp_wrapper.conf (for RT4 use  /etc/request-tracker4/msmtp_wrapper.conf
* Place this file in your RT etc directory, such as /opt/rt3/etc/msmtp_wrapper.conf (for RT4 use  /etc/request-tracker4/msmtp_wrapper.conf


<pre>
  defaults
  defaults
  logfile /var/log/msmtp.log
  logfile /var/log/msmtp.log
Line 24: Line 25:
  password ****************
  password ****************
  auto_from on
  auto_from on
</pre>


== The executable file ==
== The executable file ==
Line 29: Line 31:
* chmod +x this file
* chmod +x this file
* chown this file to the user which runs RT (www-data in our case)
* chown this file to the user which runs RT (www-data in our case)
* Place this file in your RT etc directory, such as /opt/rt3/etc/msmtp_wrapper (for RT4 use  /etc/request-tracker4/msmtp_wrapper.conf)
* Place this file in your RT etc directory, such as /opt/rt3/etc/msmtp_wrapper (for RT4 use  /etc/request-tracker4/msmtp_wrapper , also change the config path below)


<nowiki>#!/bin/bash
<pre>
  /usr/bin/msmtp -t -C /opt/rt3/etc/msmtp_wrapper.conf
#!/bin/bash
  /usr/bin/logger -t RTmailer -p syslog.info -- CALL /usr/bin/msmtp -nt "$@" RETURNED $?
/usr/bin/msmtp -t -C /opt/rt3/etc/msmtp_wrapper.conf $@
  </nowiki>
/usr/bin/logger -t RTmailer -p syslog.info -- CALL /usr/bin/msmtp -nt "$@" RETURNED $?
</pre>


== Make RT use it ==
== Make RT use it ==

Latest revision as of 09:12, 13 December 2019

We have configured RT to send mail by using the command line program msmtp.

Install msmtp

This will vary by your distribution. In Debian, you can just

apt-get install msmtp

The configuration file

  • chown this file to the user which runs RT (www-data in our case)
  • chmod 600 this file
  • Replace the asterisks with your real SMTP password.
  • Place this file in your RT etc directory, such as /opt/rt3/etc/msmtp_wrapper.conf (for RT4 use  /etc/request-tracker4/msmtp_wrapper.conf
 defaults
 logfile /var/log/msmtp.log
 account default
 host mail.education.ucsb.edu
 port 587
 tls on
 auth on
 user help
 password ****************
 auto_from on

The executable file

  • chmod +x this file
  • chown this file to the user which runs RT (www-data in our case)
  • Place this file in your RT etc directory, such as /opt/rt3/etc/msmtp_wrapper (for RT4 use  /etc/request-tracker4/msmtp_wrapper , also change the config path below)
#!/bin/bash
/usr/bin/msmtp -t -C /opt/rt3/etc/msmtp_wrapper.conf $@
/usr/bin/logger -t RTmailer -p syslog.info -- CALL /usr/bin/msmtp -nt "$@" RETURNED $?

Make RT use it

Edit this line in your RT_SiteConfig.pm:

Set($SendmailPath , "/opt/rt3/etc/msmtp_wrapper");