Sendmail errors on OpenBSD


#1

I use RT 4.4.3 on OpenBSD 6.3. I installed RT from source, not from packages; however, most supporting Perl modules were installed from packages–only a few were installed via cpanm since OpenBSD’s packaging system doesn’t contain them.

Everything appears to be working fine–I can login to RT; RT (via fetchmail) is receiving email; etc. However, RT is unable to send email–and the errors is pretty generic (“code 1”)–such as this:

/usr/sbin/sendmail -t -v` exited with code 1 (/srv/rt/app/sbin/…/lib/RT/Interface/Email.pm:946)

immediately followed by:

Could not send mail with command /usr/sbin/sendmail -t -v: rt-4.4.3-20057-1536103753-314.1-5-0@sub.domain.tld: /usr/sbin/sendmail -t -v exited with code 1 at /srv/rt/app/sbin/…/lib/RT/Interface/Email.pm line 947.

I’ve tried quite a few things to get this working but to no avail–using sendmail instead of sendmailpipe; using mail; removing sendmail arguments (such as -oi-t seems to always be present, whether it’s a specified argument or not); and more that I’m not remembering right now…

I’ve been trying to figure out how to increase the verbosity of the error but haven’t found anything with that either–however, I did Set($LogToFile, 'debug'); in SiteConfig.pm and this provided a lot more information, but still nothing that’s helped me to identify the problem.

Please advise.


#2

Is your sendmail configured correctly? In other words, ignoring RT completely, can you send a test email using it from your server to a known working email address?
The error code is coming from sendmail rather than RT so you’re not going to be able to make RT any more versbose. Look at line 940 in lib/RT/Interfaces/Email.pm and you’ll see it comes from ($?>>8) which is the status returned from the last pipe or external command executed by the Perl interpreter. One thing you do know is that its not a signal killing the sendmail process - its blowing up on either its set up or the data its is being passed. You might want to look in the mail system logs on your machine to see if sendmail logs anything in there that might help too.


#3

Hi, thanks for the replay.

I believe I know what the problem is–however, this forum isn’t allowing me to post “more than two links”?

I’m trying to paste in some email source to illustrate what I’m seeing (and thus identifying the problem).

Can that restriction be removed? The email source has many “links” (one or two URLs, but many “sanitized” email addresses that I’m guessing are being seen as “links”).


#4

Here’s a very abridged version of the details I’m trying to post… :slightly_smiling_face:

The problem appears to be that RT is sending email in a format that OpenSMTPd doesn’t like. I enabled ‘mbox’ (via MailCommand) so that I could work without all the email errors it the tickets. I copied the source of one of the emails and tested “piping” that to sendmail with the following command:

cat test-message.txt | sendmail -t

Where ‘test-message.txt’ contained the email source from an RT ticket.

There are a number of issues with that email source (I can’t post it due to forum restrictions for new users), but here are the two lines that’re preventing the emails from going out.

The first:

From: "Enoch Root via RT" <queue@sub.domain.tld">

sendmail is seeing that errant double-quote (the one after the email address) as a syntax error and refusing to even attempt delivery (thus, nothing is logged in maillog or whatnot).

The second:

boundary="----------=_1536161180-47664-11"

This line is being seen as not RFC 2822 compliant–sendmail attempts delivery after removing the errant double-quote, but then the receiving SMTP server (also running OpenBSD with OpenSMTPd) rejects it with:

550 5.7.1 Delivery not authorized, message refused: Message is not RFC 2822 compliant

If I remove that second line from the email source, the email sends without issue.

I have a lot more details to post, but again I’m unable to due to forum restrictions. I think the above summarizes what I found fairly well though (I hope :slightly_smiling_face:).

Is my logic sound?

If so, can you offer advise on next steps please? It seems to me that if RT’s emails are attempting to be sent in the same format as the email source, then they’ll be rejected for those two reasons.


#5

Take a look in your RT_SiteConfig.pm files and see if any lines have something like:

Set($rtname, 'sub.domain.tld"');

in them. That rogue double quote may be messing up the email parsing further, so get that sorted first.


#6

I reviewed it and found two typos, one in each of the Correspond and Comment addresses. After removing that extra quote from each, outbound emails worked.

Thank you for helping to figure this out. :slightly_smiling_face: