What's new

Transmission does not send an e-mail

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

gjf

Senior Member
Hi all.

Something wrong with Entware Transmission.
I have a script in /jffs/scripts:

#!/bin/sh

FROM="g***@gmail.com"
AUTH="g***@gmail.com"
PASS="***"
FROMNAME="HSH"
TO="g***@gmail.com"

torrent_name="$TR_TORRENT_NAME"
torrent_version="$TR_APP_VERSION"

logger -t "$0" "Mail sent, about "$TR_TORRENT_NAME""

echo MIME-Version: 1.0 >/tmp/tmail.html
echo Content-Type: text/html >>/tmp/tmail.html
echo "Subject: Download notification" >>/tmp/tmail.html
echo "From: \\"$FROMNAME\\"<$FROM>" >>/tmp/tmail.html
echo "Date: `date -R`" >>/tmp/tmail.html
echo "" >>/tmp/tmail.html
echo "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">" >>/tmp/tmail.html
echo "<html>" >>/tmp/tmail.html
echo "<head><title></title>" >>/tmp/tmail.html
echo "</head>" >>/tmp/tmail.html

echo "<p>Transmissionbt v"$torrent_version" finished downloading:</p>" >>/tmp/tmail.html
echo "<p><b>"$TR_TORRENT_NAME"<b></p>" >>/tmp/tmail.html
echo "<p>on `date +\%d/\%m/\%Y` at `date +\%T`</p>" >>/tmp/tmail.html
echo "" >>/tmp/tmail.html
echo "<p>Your awesome router.</p>" >>/tmp/tmail.html
echo "<a href="http://tinypic.com?ref=2zod5ja" target="_blank"><img src="http://i40.tinypic.com/2zod5ja.png" border="0" alt="Image and video hosting by TinyPic"></a>" >>/tmp/tmail.html
echo "</body>" >>/tmp/tmail.html
echo "</html>" >>/tmp/tmail.html

cat /tmp/tmail.html | sendmail -H"exec openssl s_client -quiet \
-CAfile /jffs/configs/Equifax_Secure_Certificate_Authority.pem \
-tls1 -starttls smtp -connect smtp.gmail.com:587" \
-f"$FROM" \
-au"$AUTH" -ap"$PASS" $TO \

rm /tmp/tmail.html

I have Entware Transmission installed and configured settings.json to include:
Code:
    "script-torrent-done-enabled": true,
    "script-torrent-done-filename": "/jffs/scripts/tmail.sh",

Everything was fine till a few days ago.
All script stop working!
A manual calling tmail.sh sends an e-mail but it does not work automatically!

No changes were done in system and/or configs before this happened.

Any idea what is wrong?
 
The exec permission is likely no longer set for that file:
Code:
chmod a+rx /jffs/scripts/tmail.sh

When you run it manually by entering this it works, just as you probably do, but calling it like transmission needs exec set:
sh /jffs/scripts/tmail.sh
 
No, all permissions are OK, and
Code:
sh /jffs/scripts/tmail.sh
works also OK.
But Transmission - does not.
 
Maybe transmission is no longer allowed to traverse to /jffs and run the script?
Any errors in transmission log file or the syslog?
 
Are you sure permission on that file are: rwxr-xr-x
 
If no errors in logs and permissions are properly set then I don't know.
Try to place a test script in that transmission directory containing below code and call it from terminal. see what happens:
Code:
#!/bin/sh
/jffs/scripts/tmail.sh
 
I've tried and received an e-mail.
As I told you: script is OK, something wrong with Transmission.
 
I read this as a problem with your mail script when in reality it is transmission?
Scrap the mail script part then and look at ts.
Maybe reinstall ts or reboot the router.
Is ts actually running?
 
Ts works well, the only problem - it stopped sending e-mail notifications.
Rebooting does not help.
 
Can you increase the verbosity of Transmission's logging? Debug mode maybe?
 
OK, stopped tm, changed "message-level" to 3, started tm, downloaded some stuff.
Jan 27 18:01:08 transmission-daemon[927]: Closing session
Jan 27 18:01:48 gjf: Started transmission-daemon from .
Jan 27 15:01:49 transmission-daemon[19073]: Transmission 2.92 (14714) started (session.c:742)
Jan 27 15:01:49 transmission-daemon[19073]: RPC Server Adding address to whitelist: 127.0.0.1 (rpc-server.c:903)
Jan 27 15:01:49 transmission-daemon[19073]: RPC Server Serving RPC and Web requests on port 127.0.0.1:9091/transmission/ (rpc-server.c:1110)
Jan 27 15:01:49 transmission-daemon[19073]: RPC Server Password required (rpc-server.c:1117)
Jan 27 15:01:49 transmission-daemon[19073]: Port Forwarding Stopped (port-forwarding.c:180)
Jan 27 15:01:49 transmission-daemon[19073]: UDP Failed to set receive buffer: requested 4194304, got 245760 (tr-udp.c:84)
Jan 27 15:01:49 transmission-daemon[19073]: UDP Please add the line "net.core.rmem_max = 4194304" to /etc/sysctl.conf (tr-udp.c:89)
Jan 27 15:01:49 transmission-daemon[19073]: UDP Failed to set send buffer: requested 1048576, got 245760 (tr-udp.c:95)
Jan 27 15:01:49 transmission-daemon[19073]: UDP Please add the line "net.core.wmem_max = 1048576" to /etc/sysctl.conf (tr-udp.c:100)
Jan 27 15:01:49 transmission-daemon[19073]: DHT Reusing old id (tr-dht.c:307)
Jan 27 15:01:49 transmission-daemon[19073]: DHT Bootstrapping from 166 IPv4 nodes (tr-dht.c:156)
Jan 27 15:01:49 transmission-daemon[19073]: Using settings from "/opt/etc/transmission" (daemon.c:528)
Jan 27 15:01:49 transmission-daemon[19073]: Saved "/tmp/mnt/Someware/entware/etc/transmission/settings.json" (variant.c:1266)
Jan 27 15:01:49 transmission-daemon[19073]: transmission-daemon requiring authentication (daemon.c:554)
Jan 27 15:01:49 transmission-daemon[19073]: Watching "/tmp/mnt/VERBATIM_HD/Download2/Watch" for new .torrent files (daemon.c:573)
Jan 27 15:01:54 transmission-daemon[19073]: Blocklist "blocklist.bin" contains 227830 entries (blocklist.c:100)
Jan 27 15:01:58 transmission-daemon[19073]: Searching for web interface file "/root/.local/share/transmission/web/index.html" (platform.c:430)
Jan 27 15:01:58 transmission-daemon[19073]: Searching for web interface file "/opt/share/transmission/web/index.html" (platform.c:430)
Jan 27 15:02:04 transmission-daemon[19073]: Saved "/opt/etc/transmission/torrents/rutor.info_Soft4Boost+Easy+Disc+Burner+5.1.1.517+(2017)+PC.73b868dabea28b6b.torrent" (variant.c:1266)
Jan 27 15:02:11 transmission-daemon[19073]: rutor.info_Soft4Boost+Easy+Disc+Burner+5.1.1.517+(2017)+PC Scrape error: Tracker gave HTTP response code 404 (Not Found) (announcer.c:1279)
Jan 27 15:02:11 transmission-daemon[19073]: rutor.info_Soft4Boost+Easy+Disc+Burner+5.1.1.517+(2017)+PC Retrying scrape in 20 seconds. (announcer.c:1288)
Jan 27 15:02:11 transmission-daemon[19073]: rutor.info_Soft4Boost+Easy+Disc+Burner+5.1.1.517+(2017)+PC Starting IPv4 DHT announce (poor, 16 nodes) (tr-dht.c:577)
Jan 27 15:02:13 transmission-daemon[19073]: Saved "/opt/etc/transmission/torrents/Soft4Boost Easy Disc Burner 5.1.1.517.exe.73b868dabea28b6b.torrent" (variant.c:1266)
Jan 27 15:02:14 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Pausing (torrent.c:1981)
Jan 27 15:02:14 transmission-daemon[19073]: Saved "/opt/etc/transmission/resume/Soft4Boost Easy Disc Burner 5.1.1.517.exe.73b868dabea28b6b.resume" (variant.c:1266)
Jan 27 15:02:14 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Magnet Verify (torrent.c:2004)
Jan 27 15:02:14 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Queued for verification (verify.c:269)
Jan 27 15:02:14 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Verifying torrent (verify.c:224)
Jan 27 15:02:23 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Starting IPv4 DHT announce (poor, 16 nodes) (tr-dht.c:577)
Jan 27 15:02:31 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Scrape error: Tracker gave HTTP response code 404 (Not Found) (announcer.c:1279)
Jan 27 15:02:31 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Retrying scrape in 20 seconds. (announcer.c:1288)
Jan 27 15:02:51 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Scrape error: Tracker gave HTTP response code 404 (Not Found) (announcer.c:1279)
Jan 27 15:02:51 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Retrying scrape in 337 seconds. (announcer.c:1288)
Jan 27 15:03:30 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Complete (torrent.c:2224)
Jan 27 15:03:30 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe moving "/tmp/mnt/VERBATIM_HD/Download2/InComplete/Soft4Boost Easy Disc Burner 5.1.1.517.exe" to "/tmp/mnt/VERBATIM_HD/Download2/Complete/Soft4Boost Easy Disc Burner 5.1.1.517.exe" (torrent.c:3163)
Jan 27 15:03:30 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Seed ratio reached; pausing torrent (torrent.c:498)
Jan 27 15:03:30 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Calling script "/jffs/scripts/tmail.sh" (torrent.c:890)
Jan 27 15:03:30 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Pausing (torrent.c:1981)
Jan 27 15:03:30 transmission-daemon[19073]: Saved "/tmp/mnt/Someware/entware/etc/transmission/resume/Soft4Boost Easy Disc Burner 5.1.1.517.exe.73b868dabea28b6b.resume" (variant.c:1266)
Jan 27 15:03:48 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Removing torrent (torrent.c:2043)
Jan 27 15:03:48 transmission-daemon[19073]: Soft4Boost Easy Disc Burner 5.1.1.517.exe Pausing (torrent.c:1981)
Jan 27 15:04:01 transmission-daemon[19073]: Saved "/tmp/mnt/Someware/entware/etc/transmission/settings.json" (variant.c:1266)
Jan 27 15:04:01 transmission-daemon[19073]: DHT Not saving nodes, DHT not ready (tr-dht.c:359)
Jan 27 15:04:01 transmission-daemon[19073]: Port Forwarding Stopped (port-forwarding.c:180)
Jan 27 15:04:01 transmission-daemon[19073]: Saved "/tmp/mnt/Someware/entware/etc/transmission/stats.json" (variant.c:1266)
Jan 27 15:04:01 transmission-daemon[19073]: Closing session

I cannot see anything strange.
 
Does it work if you remove the quotes from around the call to the script filename:
Code:
 "script-torrent-done-enabled": true,
  "script-torrent-done-filename": /jffs/scripts/tmail.sh,
 
Does it work if you remove the quotes from around the call to the script filename:
Code:
 "script-torrent-done-enabled": true,
  "script-torrent-done-filename": /jffs/scripts/tmail.sh,
Why it should work if it's out of syntax?
 
The Transmission daemon probably doesn't have permissions to execute the script under /jffs/scripts/ - could try moving that script to the same directory of the transmission daemon.
 
I'm using Asuswrt-Merlin 380.65-beta3 with Transmission 2.92 from the latest Entware-ng repo . Mine is executing the "torrent done" script without issue.

Try this. Some apps are picky about file ownership.
Code:
/bin/chown -R admin:root /opt/etc/transmission

If that doesn't work, try to get Transmission to execute any test script.
Code:
"script-torrent-done-filename": "/jffs/scripts/torrentdone.sh",

/jffs/scripts/torrentdone.sh
Code:
#!/bin/sh
set>/tmp/torrentdone.txt  # dump the script variables to a file

Make the script rx and set ownership to the root user:
Code:
/bin/chmod a+rx /jffs/scripts/torrentdone.sh
/bin/chown admin:root /jffs/scripts/torrentdone.sh
 
The Transmission daemon probably doesn't have permissions to execute the script under /jffs/scripts/ - could try moving that script to the same directory of the transmission daemon.
Please read above: it worked. Moving to somewhere won't change anything.
/QUOTE]
1. Tm does not execute any script, but calls them succesfully according logs (see above).
2. There is no admin user, I have renamed it in settings. Anyway the owner and the group are OK as well as permissions (see above also).

Once again: everything worked in past, but stopped working due to absolutely unknown reason.
 
@gjf

Since you don't know why it no longer works, how about being more receptive to trying the ideas people offer?

What could it hurt?
 

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top