-1

I've this script of transmission daemon that send the email:

#!/bin/sh

##
##  User-configurable Variables
##

# Where "nail" is installed on your system.
# We need this to actually send the mail, so make sure it's installed
NAIL=/usr/bin/nail

# REQUIRED CHANGE #1: you must set SMTP_SERVER
# http://www.host45.com/resources/ispsmtps.php has a list of ISP's smtp servers
SMTP_SERVER=smtp.gmail.com

# REQUIRED CHANGE #2: you must set your email address.
# option A: change "yourname@yourmail.com" here and remove the leading '#' to
# use a real email address
#TO_ADDR=yourname@yourmail.com
#
# option B: for an SMS message, set your phone number here and remove the
# leading '#' on the PHONENUM line and your phone provider's TO_ADDR line
#PHONENUM="1234567890"
#TO_ADDR="$PHONENUM@message.alltel.com"      # SMS: Alltel
#TO_ADDR="$PHONENUM@txt.att.net"             # SMS: AT&T (formerly Cingular)
#TO_ADDR="$PHONENUM@myboostmobile.com"       # SMS: Boost Mobile
#TO_ADDR="$PHONENUM@sms.mycricket.com"       # SMS: Cricket Wireless
#TO_ADDR="$PHONENUM@messaging.nextel.com"    # SMS: Nextel (Sprint Nextel)
#TO_ADDR="$PHONENUM@messaging.sprintpcs.com" # SMS: Sprint (Sprint Nextel)
#TO_ADDR="$PHONENUM@tmomail.net"             # SMS: T-Mobile
#TO_ADDR="$PHONENUM@vtext.com"               # SMS: Verizon
#TO_ADDR="$PHONENUM@vmobl.com"               # SMS: Virgin Mobile USA
#TO_ADDR="$PHONENUM@txt.bellmobility.ca"     # SMS: Bell Canada
#TO_ADDR="$PHONENUM@cwemail.com"             # SMS: Centennial Wireless
#TO_ADDR="$PHONENUM@csouth1.com"             # SMS: Cellular Sout
#TO_ADDR="$PHONENUM@gocbw.com"               # SMS: Cincinnati Bell
#TO_ADDR="$PHONENUM@mymetropcs.com"          # SMS: Metro PCS 1
#TO_ADDR="$PHONENUM@metropcs.sms.us"         # SMS: Metro PCS 2
#TO_ADDR="$PHONENUM@qwestmp.com"             # SMS: Quest
#TO_ADDR="$PHONENUM@pcs.rogers.com"          # SMS: Rogers
#TO_ADDR="$PHONENUM@tms.suncom.com"          # SMS: Suncom
#TO_ADDR="$PHONENUM@msg.telus.com"           # SMS: Telus
#TO_ADDR="$PHONENUM@email.uscc.net"          # SMS: U.S. Cellular

###
###  Send the mail...
###

SUBJECT="Download completato!"
FROM_ADDR="transmission@localhost.localdomain"
TMPFILE=`mktemp -t transmission.XXXXXXXXXX`
echo "Transmission ha terminato il download di \"$TR_TORRENT_NAME\" on $TR_TIME_LOCALTIME" >$TMPFILE
$NAIL -v -S from="$FROM_ADDR" -S smtp -s "$SUBJECT" -S smtp=$SMTP_SERVER "$TO_ADDR" < $TMPFILE
rm $TMPFILE

when I execute it I get:

/usr/bin/nail: not found

I tried to install apt-get install nail

but I get:

script nail has no candidate

how can I fix?

1 Answer 1

0

nail is no longer packaged by that name in Debian, but you may find s-nail can do what you need in a familiar way. (I don't know what transmission is doing with email here so I can't promise it's going to work.)

Try an apt-get install of s-nail, which is a descendent of nail. If nail is still not found in the script, just change the line in the script to read

NAIL=/usr/bin/s-nail

You can find a project home for s-nail at https://git.sdaoden.eu/cgit/s-nail.git

Good luck!


PS: Here is a transcript of me retrieving s-nail from a current (Apr 2018) install of Rasbian Stretch.

root@psychic:/mnt/keeper/backups/psychic/etc# apt-get install ssmtp s-nail
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libgnutls-openssl27
The following NEW packages will be installed:
libgnutls-openssl27 s-nail ssmtp
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
Need to get 551 kB of archives.
After this operation, 914 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://raspbian.mirror.colo-serv.net/raspbian stretch/main armhf libgnutls-openssl27 armhf 3.5.8-5+deb9u3 [182 kB]
Get:2 http://raspbian.mirror.colo-serv.net/raspbian stretch/main armhf s-nail armhf 14.8.16-1 [315 kB]
Get:3 http://raspbian.mirror.colo-serv.net/raspbian stretch/main armhf ssmtp armhf 2.64-8 [54.2 kB]
Fetched 551 kB in 1s (427 kB/s)
Preconfiguring packages ...
Selecting previously unselected package libgnutls-openssl27:armhf.
(Reading database ... 34436 files and directories currently installed.)
Preparing to unpack .../libgnutls-openssl27_3.5.8-5+deb9u3_armhf.deb ...
Unpacking libgnutls-openssl27:armhf (3.5.8-5+deb9u3) ...
Selecting previously unselected package s-nail.
Preparing to unpack .../s-nail_14.8.16-1_armhf.deb ...
Unpacking s-nail (14.8.16-1) ...
Selecting previously unselected package ssmtp.
Preparing to unpack .../ssmtp_2.64-8_armhf.deb ...
Unpacking ssmtp (2.64-8) ...
Setting up s-nail (14.8.16-1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libgnutls-openssl27:armhf (3.5.8-5+deb9u3) ...
Setting up ssmtp (2.64-8) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...

1
  • I get: cannot found the packages s-nail Jul 16, 2017 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.