Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: gavinmc42 on October 21, 2014, 12:43:31 AM
-
Hi Guys,
Anyone know know how to send emails in TC?
Normally Busybox has sendmail built-in, but not in the 1.22.1 RPi version!
Been using Python but that means I need to install it and all it's dependencies.
There is Claws-mail and Fetchmail but these are clients?
It is for an embedded application and I want to send emails twice a day and also if an alarm condition occurs.
Was thinking it could be a simple cron job calling bash scripts.
-
Anyone know know how to send emails in TC?
On the x86 platform, I wrote a little console mail utility script ('mx", the "mail experiment") that uses something like the following:
mailx -n -v -r <senderemail@domain.com> -s "<mail subject>" -S smtp-auth-user=<senderemail@domain.com> -S <senderssmtppassword> -S smtp=<smtp.domain.com:587> <recipient@domain.net>
It requires mailx.tcz and, I think, msmtp.tcz
Sending was an afterthought as my script was mainly for reading mail from a pop3 server, so the sending capability isn't all that polished. It takes the message body from stdin, so you'd have to use redirection to use it in a script... or read up on the mailx command line options - I'm sure there's one to take the message body from a file. At some point I'll look into it further as sending mail from a script is on my todo list, but it won't be this week, and probably not any time really soon.
-
At the moment no MTP in the repo. I will add one, msmtp and/or nullmailer in the next days.
-
msmtp.tcz added to repo
-
msmtp.tcz added to repo
Thanks bmarkus :D
$ msmtp --help
msmtp: error while loading shared libraries: libgsasl.so.7: cannot open shared object file: No such file or directory
Is there a dependency missing? I'm using piCorePlayer if that matters.
regards
Greg
-
Hi Greg Erskine
Is there a libgsasl.tcz in the repository?
-
Hi Greg Erskine
Is there a libgsasl.tcz in the repository?
Yes it is there. Somehow the msmtp.tcz.dep file is missing, I will fix it. Load libgsasl.tcz manuall from the repo.
-
Yes it is there. Somehow the msmtp.tcz.dep file is missing, I will fix it. Load libgsasl.tcz manuall from the repo.
Thanks. That fixed it.
-
Must be doing something wrong.
Copied msmtp + libgsasl + libidn files into the tce/optional directory.
Added a msmtp.tcz.dep file to include libgsasl
Put msmtp.tcz into onboot
msmtp still says "error while loading libgsasl.so.7: ....
Used 7-zip to check the tcz files in Windows to find out where their go in TC. /usr/local/bin etc
Seem to be were they are supposed to be.
libidn.tcz does not seem to be an archive, 7-zip tells me?
-
Used 7-zip to check the tcz files in Windows to find out where their go in TC. /usr/local/bin etc
Seem to be were they are supposed to be.
libidn.tcz does not seem to be an archive, 7-zip tells me?
.tcz files are squash files, 7zip do not knows them. Use linux to uncompress, looopmount them or better to use TC app browsers, like 'tce' in a terminal window to get list of their content.
Please read the Core book http://distro.ibiblio.org/tinycorelinux/corebook.pdf
-
Hi bmarkus,
My TC RPi's are on a device network behind a firewall.
So I'm doing everything via ssh and sftp.
Only use Windows 7-Zip to check *.tcz files on my Tinycore folder.
Command line mail out I thought would be easy as sys admins have been doing it since year dot.
I think they use sendmail now?
google example
echo "$line" | mail -s subject "$email"
http://theos.in/shell-scripting/send-mail-bash-script/
http://superuser.com/questions/384499/how-is-mail-actually-sent-when-i-use-the-linux-mail-command
The trick with RPi TC is to find what is already in the tcz mirror that can do what I want.
-
Busybox has a utility ssmtp
http://www.busybox.net/tinyutils.html
Got the armhf.deb and tried the binary but got bitten by missing library.
Think I need to figure out how to make tcz from armhf.debs for the RPi.
-
Busybox has a utility ssmtp
http://www.busybox.net/tinyutils.html
Got the armhf.deb and tried the binary but got bitten by missing library.
Think I need to figure out how to make tcz from armhf.debs for the RPi.
Better to build it on piCore instead of playing with 3rd-party imported packages. Also, msmtp is in the repo and it works. Try.
-
I did try msmtp but I had to manually install it, didn't work
Will try normal tce-load once I get past the firewall.
-
OK internet connected
using ozzie mirror tinycore.mirror.uber.com.au
msmtp.tcz , libgsasl, libidn installed
tried sending emails,
got message need libiconv.tcz - ouch 1.2MB
Expanded partition to 20MB
tried tce-load -wi libiconv.tcz and got checksum did not match
now what?
learning lots:)
-
Found this method, so old is has spiderwebs
http://www.geekride.com/tech-tip-sending-email-from-command-line/
telnet and nc are in busy box, cool
-
You can use Python also to make your own sending apps.