esmtp returns a string "No Error" but does nothing

asked 2018-03-16 17:22:48 -0500

Kaurin gravatar image


esmtp is a daemonless faux MTA that i've used a few years on my Debian/Ubuntu boxes where there is no need for a more complex email setup.

Here is my config that works with esmtp 1.2 on Debian/Ubuntu:
mda="/usr/bin/procmail -d %T"

I've used the exact same config on Fedora because it also has esmtp 1.2

Unfortunately, when I try to send an e-mail, mailx or directly through esmtp, I get an output that says "No Error"

I'm not a strace expert, but here are the last few lines

# echo bla | strace esmtp
lstat("/root/.esmtprc", {st_mode=S_IFREG|0600, st_size=560, ...}) = 0
geteuid()                               = 0
openat(AT_FDCWD, "/root/.esmtprc", O_RDONLY) = 3
ioctl(3, TCGETS, 0x7ffe9e2f4630)        = -1 ENOTTY (Inappropriate ioctl for device)
fstat(3, {st_mode=S_IFREG|0600, st_size=560, ...}) = 0
read(3, "# Config file for ESMTP sendmail"..., 8192) = 560
read(3, "", 4096)                       = 0
read(3, "", 8192)                       = 0
ioctl(3, TCGETS, 0x7ffe9e2f4630)        = -1 ENOTTY (Inappropriate ioctl for device)
close(3)                                = 0
getgid()                                = 0
getegid()                               = 0
setregid(0, 0)                          = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f25c895eaf0}, NULL, 8) = 0
futex(0x7f25c9470168, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(2, "No Error\n", 9No Error
)               = 9
exit_group(70)                          = ?
+++ exited with 70 +++bla | esmtp

Now, I know that the syntax used even on a Debian box will get me a malformed email, but it will get delivered, except for Fedora, which just returns "No Error". I have done it like this to reduce the strace output (using something like mailx would have been an overhead)

To me, it looks like the error happens shortly after reading the config file.

As you can see, this setup is root-specific. My /etc/esmtprc has a much more basic setup that just forces all mail to be passed through procmail, and forwarded to root:

mda="/usr/bin/procmail -d %T"

This "default" config works fine. Root's config doesnt, as per what's written above.

I've been wrecking my head for a few days now and decided to ask people who might know more.

edit retag flag offensive close merge delete


Check for SELinux notifications, just and idea.

aeperezt gravatar imageaeperezt ( 2018-03-16 22:42:27 -0500 )edit

Does it even read from stdin?

read(0, ....
villykruse gravatar imagevillykruse ( 2018-03-17 00:42:05 -0500 )edit

I think it has to do with permissions. Having better things to do I switched to ssmtp. It has fewer features than esmtp, but it works on my FC27 system.

TonyG gravatar imageTonyG ( 2018-05-29 21:44:11 -0500 )edit