RT 5.0.7 following wiki guide, can't send email out - program unexpectedly closed pipe

Hi all,

My smarthost is configured correctly (exim4) and this works:

cat <<EOF | sendmail -oi -t
In-Reply-To: <rt-5.0.7-924-1734634540-1100.3-5-0@xxx.uk>
X-RT-Ticket: Blah Blah #3
X-RT-Originator: root@xxx.uk
Subject: [Reservations #3] Working?
X-Managed-BY: RT 5.0.7 (http://www.bestpractical.com/rt/)
Message-ID: <rt-5.0.7-3456-1734643031-381.3-5-0@xxx.uk>
X-RT-Loop-Prevention: Blah Blah
Content-Type: multipart/alternative; boundary="----------=_1734643031-3456-3"
Reply-To: reservations@xxx.uk
From: "RT Admin via RT" <reservations@xxx.uk>
To: ghenry@external.com
References: <RT-Ticket-3@xxx.uk>
 <rt-5.0.7-924-1734634540-1100.3-5-0@xxx.uk> 

This is a test message
EOF

and via mail -s etc.

but via the web UI I always get:

<rt-5.0.7-3338-1734642775-821.3-5-0@xxx.uk>: Could not send mail with command `/usr/sbin/sendmail -oi -v -t`: program unexpectedly closed pipe at /opt/rt5/sbin/../lib/RT/Interface/Email.pm line 944.#012#012Stack:#012  [/opt/rt5/sbin/../lib/RT/Interface/Email.pm:944]#012  [/opt/rt5/local/lib/perl5/Log/Dispatch.pm:170]#012  [/opt/rt5/local/lib/perl5/Log/Dispatch.pm:25]#012  [/opt/rt5/sbin/../lib/RT/Interface/Email.pm:960]#012  [/opt/rt5/sbin/../lib/RT/Action/SendEmail.pm:300]#012  [/opt/rt5/sbin/../lib/RT/Action/SendEmail.pm:115]#012  [/opt/rt5/sbin/../lib/RT/ScripAction.pm:248]#012  [/opt/rt5/sbin/../lib/RT/Scrip.pm:675]#012  [/opt/rt5/sbin/../lib/RT/Scrips.pm:297]#012  [/opt/rt5/sbin/../lib/RT/Transaction.pm:213]#012  [/opt/rt5/sbin/../lib/RT/Record.pm:1685]#012  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1759]#012  [/opt/rt5/sbin/../lib/RT/Ticket.pm:1638]#012  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:2661]#012  [/opt/rt5/share/html/Ticket/Display.html:195]#012  [/opt/rt5/share/html/Ticket/Display.html:208]#012  [/opt/rt5/share/html/Ticket/Update.html:469]#012  [/opt/rt5/share/html/Ticket/autohandler:66]#012  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:760]#012  [/opt/rt5/sbin/../lib/RT/Interface/Web.pm:437]#012  [/opt/rt5/share/html/autohandler:53]

Followed ManualInstallation - Request Tracker Wiki like normal with nginx as the web server on Debian 12.

Any ideas where do debug. debug RT logs don’t show much. I’m not seeing anything in /var/log/exim4/mainlog, so it’s not reaching there. Adding -v on to the sendmail command in config isn’t showing why the error.

Thanks.

Do you have some security system running that prevents httpd from using sendmail? For example I have to use:

setsebool -P httpd_can_sendmail 1

to tell SELinux to allow the Apache httpd process to access sendmail.

1 Like

Possibly. I’m using nginx though. I might switch to Apache and check if it’s an nginx socket/FCGI perm thing.

No selinux on this box.

Can you try su’ing to the user that the you’re running RT as (either the web server or FCGI daemon or whatever) and try running sendmail?

1 Like

Yep, logging in as RT (sudo su - rt) and running /usr/sbin/sendmail like so works:

$ /usr/sbin/sendmail -f correct_email@blah.com ghenry@blahblah.com
Subject: Hi there

Testing?
CTRL-D
$ 

as it hits my Inbox.

Thanks.

I switched to Apache2 and it’s noticed the perms weren’t right for it, so chmod -R www-data:www-data /opt/rt5 and email is attempting to go out. Some issue to sort out with the smarthost.

I’ll stick with Apache2 then I think.