0

I have Request Tracker 4.4 up and running. Sometimes email messages that it sends are going to spam. So I decided to use msmtp to send messages through SMTP with authentication.

I used this manual: https://rt-wiki.bestpractical.com/wiki/Msmtp

Actual result is that mail is not sent, while log says sent and also log says:

RTmailer: CALL /usr/bin/msmtp -nt -oi -t RETURNED 78

If I use msmtp_wrapper manually from command line - it works perfectly, no errors.

Access rights are OK:

-rwxr-xr-x  1 root   apache    272 May 22 16:24 msmtp_wrapper
-rw-r--r--  1 root   apache    539 May 22 13:51 msmtp_wrapper.conf

What am I doing wrong? How do I fix this?

real_sm
  • 112
  • 2
  • 14
  • Is there anything in `/var/log/msmtp.log` (assuming you're using the default log file location shown in the source article)? Are the permissions on the log file correct for the user that the RT process is running as? – Paul Haldane May 22 '17 at 15:39
  • When you tried running msmtp_wrapper by hand was this as root or as the user that RT runs as? – Paul Haldane May 22 '17 at 15:40

1 Answers1

1

Exit status of 78 (EX_CONF) implies a problem with the config file.

This could be permissions if the file contains password (or other secrets) or some other problem with the contents of the file.

Running msmtp as the RT user (www-data?) should show you what the problem is. For example this is what I see when I have overly generous permissions ...

$ src/msmtp -t -C ~/m/conf  << EOF
From: paul@example.com
To: paul@example.com

test
EOF

msmtp: /home/paul/m/conf: contains secrets and therefore must have no more than user read/write permissions
Paul Haldane
  • 4,517
  • 1
  • 21
  • 32