You are not logged in.

#1 2015-02-24 22:45:19

dominicm
Member
Registered: 2015-01-03
Posts: 92

s-nail error no such directory /usr/bin/sendmail [SOLVED]

I am trying to get email notifications setup with smartmontools but the test email does not reach my address. s-nail is an optional dependency of smartmontools and is installed. From my understanding it should work out of the box without any configuration but it doesn't.

I attempted to send an email manually for troubleshooting purposes with this command:

sudo echo "This is the mail body" | mailx -s "This is the subject" -r sendersemail xxxxxxx@gmail.com

The mailx command produced an odd error:

/usr/bin/sendmail: No such file or directory

If I create /usr/bin/sendmail directory (and chmod it to 777) I get this error:

/usr/bin/sendmail: Permission denied
"/home/dom/dead.letter" 10/251
... message not sent.


I am lost. Does anyone have any idea what is going on here?

Last edited by dominicm (2015-10-05 11:10:17)

Offline

#2 2015-02-24 23:08:54

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

dominicm wrote:

s-nail is an optional dependency of smartmontools and is installed. From my understanding it should work out of the box without any configuration but it doesn't.

I think your understanding is wrong:

$ pacman -Qi s-nail
...
Optional Deps  : smtp-forwarder: for sending mail
....

smtp-forwarder is a virtual package provided by multiple packages; any one of those should provide a sendmail binary (not a directory hmm), but they will also need some configuration (check the wiki). You probably want something simple like ssmtp, esmtp or nullmailer.

Offline

#3 2015-02-24 23:19:14

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

In the Arch Linux S.M.A.R.T. Wiki, Email potential problems section it is clearly stated "It's enough to simply configure S-nail if you don't want anything else." In the linked snail wiki the sample email send command is the same command that produces the error. It does not mention any other dependencies. I am not sure what to think now.

There does seem to be a configuration of SMTP section in snail wiki but Quick shot section is where I got the example from and is the first section so it would be illogical to have pre-requisite sections first. Maybe there is an alternative way to read this info..?

https://wiki.archlinux.org/index.php/S. … l_problems
https://wiki.archlinux.org/index.php/S-nail

Last edited by dominicm (2015-02-24 23:25:56)

Offline

#4 2015-02-24 23:27:41

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

$ ls /usr/bin/sendmail
ls: cannot access /usr/bin/sendmail: No such file or directory

I can send e-mails with s-nail just fine.


Post your config, with you e-mail and password redacted.

Offline

#5 2015-02-24 23:32:22

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

There is no config, it's all at defaults with only s-nail package installed. Or did you mean other non-snail config? Did you use the command as per my original post exactly and was it  an external email? Did you have s-nail installed/configured before now?

I also now tried adding a .rcmail config from snail wiki linked before.

# All the examples require v15-compat!
set v15-compat

# ArchLinux-specific locations of certificates.
# Since these are subject to the ArchLinux update mechanism,
# use only those, don't try to load OpenSSL builtin ones.
# And use the TLS specific set: see "man 8 update-ca-trust"
#set ssl-ca-dir=/etc/ssl/certs
set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
set ssl-no-default-ca

# Require secure transport via protocol version TLS v1.2, exclusively.
# (Change this only [best on a per-account base, as below]
# when the remote server doesn't support this protocol!)
set ssl-method=tls1.2

# Request strict transport security checks
set ssl-verify=strict

# Essential setting: choose allowed character sets
# (Have a look at the "CHARACTER SETS" manual section)
set sendcharsets=utf-8,iso-8859-1

# When sending messages, wait until the Mail-Transfer-Agent finishs.
# Only like this you'll be able to see errors reported through the exit
# status of the MTA (including the builtin SMTP one)!
set sendwait

# To save a copy of sent messages somewhere (this will end up in your home directory)
set record=sentmail.mbox

# This may be interesting to gain some speedup when sending mail
set mimetypes-load-control

# This is optional, but you should get the big picture
# by reading the manual before you leave that off
set from="Your Name <youremail@domain>"

Still the same error. No surprise since this config doesn't add any new info that is not present in the mailx command.

Last edited by dominicm (2015-02-24 23:59:44)

Offline

#6 2015-02-25 00:16:06

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

man mailx wrote:

     smtp       [Option] Normally Mail invokes the program defined via
                sendmail to transfer messages.  Setting the smtp variable will
                instead cause `SMTP' network connections be made to the server
                specified therein in order to directly submit the message.

karol seems to be using this and it seems like a good choice if you don't want/need sendmail (but I didn't read the rest).

Offline

#7 2015-02-25 01:02:12

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

Raynman wrote:
man mailx wrote:

     smtp       [Option] Normally Mail invokes the program defined via
                sendmail to transfer messages.  Setting the smtp variable will
                instead cause `SMTP' network connections be made to the server
                specified therein in order to directly submit the message.

karol seems to be using this and it seems like a good choice if you don't want/need sendmail (but I didn't read the rest).


The link isn't really relevant as it's not the issue I am having. It looks like I need to configure SMTP. The wiki is really badly laid out but the info is there, will try it and report back.

Offline

#8 2015-02-25 01:39:12

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

I think application-specific authorization is also required https://support.google.com/mail/answer/1173270?hl=en

Offline

#9 2015-02-25 02:22:49

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

karol wrote:

I think application-specific authorization is also required https://support.google.com/mail/answer/1173270?hl=en

I may have the same problem like you did, but I will come to that when I solve the first issue smile From the link though it seems like it should not be needed as I am only sending an email not accessing any gmail specific features.

Offline

#10 2015-02-25 05:39:25

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

Ok, I understand how this works now. I needed to install and configure SMTP. I used SSMTP in my case for it's simplicity. I really hate how it works and I really hate that I have to enter my gmail password in a plain text file. The only alternative seems to be to set up a full mail server in which case the email may be blocked by ISP, so it may be unreliable. I may just have to create a dummy gmail account for system messages only. The first time my mail command failed and I got a warning email from google asking if it was me attempting to connect, I said yes and enabled insecure apps. It now works, but is enabling insecure apps a good idea? Is there an option to make snail a secure "app", perhaps the auth that was mentioned before is exactly what's needed? I am not seeing any mention of any auth options in SSMTP config, so maybe someone can point me in the right direction?

Last edited by dominicm (2015-02-25 05:41:32)

Offline

#11 2015-03-02 12:22:23

sdaoden
Member
Registered: 2014-06-13
Posts: 30

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

Hello, i'm the maintainer of S-nail.

S-nail is a direct descendant of BSD Mail and thus represents the user-side of the traditional Unix mail system.
It thus requires the system-side, a local mail-transfer-agent (MTA), like sendmail or postfix, in order to deliver mail messages.
However, as Arch Linux compiles in the optional SMTP extension of S-nail it is also possible to configure SMTP and thus work directly with external (or local) SMTP servers, as is documented in [1].

  [1] https://wiki.archlinux.org/index.php/S- … MTP_server

P.S.: i hope S-nail will at someday also have a "minimum system-side" built in, but there are other things to do first.
For now i've updated the Arch Linux Wiki a bit to address this Forum topic.

Offline

#12 2015-03-02 12:47:37

sdaoden
Member
Registered: 2014-06-13
Posts: 30

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

And regarding this Google "secure app" thing: this has nothing to do with S-nail, if you configure SSL/TLS just as shown in the Wiki

set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
set ssl-no-default-ca
set ssl-method=tls1.2
set ssl-verify=strict

then the transport is secured to the best of the knowledge of the entire IETF crypto community.
Because of this it must be said that Google's policy has, must necessarily have that is, something to do with "incitement of the people".  That leads them over their websites, at least.

Offline

#13 2015-03-02 19:11:32

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

sdaoden wrote:

And regarding this Google "secure app" thing: this has nothing to do with S-nail, if you configure SSL/TLS just as shown in the Wiki

set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
set ssl-no-default-ca
set ssl-method=tls1.2
set ssl-verify=strict

then the transport is secured to the best of the knowledge of the entire IETF crypto community.
Because of this it must be said that Google's policy has, must necessarily have that is, something to do with "incitement of the people".  That leads them over their websites, at least.

Yes, I figured it out and indeed it has nothing to do with s-nail. Gmail requires OAuth 2.0 to work without enabling "less secure apps". I don' know enough about security to comment whether that's worth it but not sending passwords, encrypted or not doesn't sound bad. I am not sure what you mean by "incitement of the people", can you clarify?

Offline

#14 2015-10-05 11:08:06

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

I got it working in the end, here's a tutorial on how to Configure Email Notification on Arch Linux. in case someone else is having similar problems.

Offline

#15 2015-10-10 11:55:47

sdaoden
Member
Registered: 2014-06-13
Posts: 30

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

Hi Dominic.

I for one of course strongly advise against your tutorial since that uses the old configuration syntax and falsely claims that passwords must be stored in clear text.  The ArchLinux Wiki and the manual page prove you wrong.
Since that tutorial was on the first page of hits regarding S-nail for such a long time.  smile

Also note that there is not yet ANY OAUTH 2.0 for SASL, i occasionally see fly by the draft for this on the IETF announcement list.
S-nail doesn't support SASL, however.  But nonetheless, i do miss some context.

And then i hope that S-nail v14.9 (should i have named it S-mail or S-mailx from the start?  Now it is too late!) will ship some local delivery mode, i.e., implement very rudimentary MTA support.  But it is yet not existent.
Ciao.

Offline

#16 2015-10-10 12:35:20

dominicm
Member
Registered: 2015-01-03
Posts: 92

Re: s-nail error no such directory /usr/bin/sendmail [SOLVED]

I am not seeing any new configuration syntax in Arch Linux S-nail Wiki. If there is a better way of doing it please do tell. I am also not aware of another method of storing passwords but would like to know. The wiki mentions encrypted password vaguely but there is no example. Can you provide an example?

The article shows a working method, if there is a better way and it is documented in some form I will test it and edit the article. I also don't think it was ever in even the top 3 results for s-nail or arch s-nail search terms.

Offline

Board footer

Powered by FluxBB