RT4 - Email Errors generated even when sent 'successfully'

I was wondering if anyone could help me with this issue.

I have setup RT4.0.12, using a Mysql 5.6.11.0 database under Cygwin

The issue is my RT system is having a good old moan whenever an email is
sent. it is adding errors onto the RT ticket and the error log, however, all
the emails are reaching there targets. The users can reply to any emails
from RT and the replys will be added to the ticket. and the same error
messages will be added to the log and the ticket

Can i make these errors stop appearing on the RT tickets (e.g. hide them) or
could someone help me track down the root casue of these errors

All errors and relevent files have been attached with email/passwords etc
remoted

thank you in advanced

RT Error
Wed Jul 10 16:33:11 2013The RT System itself - System error
Sending the previous mail has failed. Please contact your admin, they can
find more details in the logs

Error log

[Wed Jul 10 15:33:11 2013] [error]:
rt-4.0.12-13580-1373470372-461.16282-6-0@lfm-software.com:
/opt/rt4/etc/msmtp_wrapper -oi -t -ODeliveryMode=b -OErrorMode=m -f lfm.test@aveva.com exited with code 64
(/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:486)
[Wed Jul 10 15:33:11 2013] [critical]:
rt-4.0.12-13580-1373470372-461.16282-6-0@lfm-software.com: Could not send
mail with command /opt/rt4/etc/msmtp_wrapper -oi -t -ODeliveryMode=b -OErrorMode=m -f lfm.test@aveva.com:
rt-4.0.12-13580-1373470372-461.16282-6-0@lfm-software.com:
/opt/rt4/etc/msmtp_wrapper -oi -t -ODeliveryMode=b -OErrorMode=m -f lfm.test@aveva.com exited with code 64 at
/opt/rt4/sbin/…/lib/RT/Interface/Email.pm line 487.

Stack:
[/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:487]
[/opt/rt4/sbin/…/lib/RT/Action/SendEmail.pm:292]
[/opt/rt4/sbin/…/lib/RT/Action/SendEmail.pm:114]
[/opt/rt4/sbin/…/lib/RT/ScripAction.pm:232]
[/opt/rt4/sbin/…/lib/RT/Scrip.pm:475]
[/opt/rt4/sbin/…/lib/RT/Scrips.pm:188]
[/opt/rt4/sbin/…/lib/RT/Transaction.pm:201]
[/opt/rt4/sbin/…/lib/RT/Record.pm:1504]
[/opt/rt4/sbin/…/lib/RT/Ticket.pm:2297]
[/opt/rt4/sbin/…/lib/RT/Ticket.pm:2193]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:2019]
[/opt/rt4/share/html/Ticket/Display.html:164]
[/opt/rt4/share/html/Ticket/Update.html:300]
[/opt/rt4/share/html/Ticket/autohandler:66]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:634]
[/opt/rt4/sbin/…/lib/RT/Interface/Web.pm:335]
[/opt/rt4/share/html/autohandler:53]
(/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:491

msmtp_wrapper.txt
http://requesttracker.8502.n7.nabble.com/file/n54612/msmtp_wrapper.txt
msmtp_wrapperconf.txt
http://requesttracker.8502.n7.nabble.com/file/n54612/msmtp_wrapperconf.txt
Site_Config.txt
http://requesttracker.8502.n7.nabble.com/file/n54612/Site_Config.txt

View this message in context: http://requesttracker.8502.n7.nabble.com/RT4-Email-Errors-generated-even-when-sent-successfully-tp54612.html

The issue is my RT system is having a good old moan whenever an email is
sent. it is adding errors onto the RT ticket and the error log, however, all
the emails are reaching there targets. The users can reply to any emails
from RT and the replys will be added to the ticket. and the same error
messages will be added to the log and the ticket

[Wed Jul 10 15:33:11 2013] [error]:
rt-4.0.12-13580-1373470372-461.16282-6-0@lfm-software.com:
/opt/rt4/etc/msmtp_wrapper -oi -t -ODeliveryMode=b -OErrorMode=m -f lfm.test@aveva.com exited with code 64
(/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:486)

You’re passing sendmail only arguments (As documented in the
configuration file) to msmtp

http://bestpractical.com/rt/docs/latest/RT_Config.html#SendmailArguments

Add in the usual caveat about using a real MTA, but googling msmtp
code 64 will find you documentation on how to turn up msmtp’s logging
to debug so you can get a real error. I suspect that turning off
sendmail brand sendmail arguments will fix it (until msmtp loses mail
on you, but that’s a separate problem).

-kevin

i have now resolved my issue

i have been running some tests on the msmtp_Wrapper file and found that the
error disapeared if i reduced the file down to one email address (see below)

msmtp_Wrapper - stripped down to 1 email address
#!/bin/bash
USER=user1@company.com
export USER
/usr/sbin/msmtp.exe --from=user1@company.com -t -C
/opt/rt4/etc/msmtp_wrapper.conf

Looking into the file abit further i found i was missing a line at the end
of the file (see below)

msmtp_Wrapper - Fixed
#!/bin/bash
USER=user1@company.com
export USER
/usr/sbin/msmtp.exe --from=user1@company.com -t -C
/opt/rt4/etc/msmtp_wrapper.conf

USER=user2@company.com
export USER
/usr/sbin/msmtp.exe --from=user2@company.com -t -C
/opt/rt4/etc/msmtp_wrapper.conf

/usr/bin/logger -t RTmailer -p syslog.info -- CALL /usr/bin/msmtp -nt

“$@” RETURNED $?

Once the below line was added to the file i no longer got the error messages
in RT4 or within the error.log

" /usr/bin/logger -t RTmailer -p syslog.info – CALL /usr/bin/msmtp -nt
“$@” RETURNED $? "

Thanks for all the help Kevin

View this message in context: http://requesttracker.8502.n7.nabble.com/RT4-Email-Errors-generated-even-when-sent-successfully-tp54612p54652.html