How to send mail from BeagleBone Black running Angstrom?

I have a BeagleBone Black running the default Angstrom distribution.

I need the device to send emails periodically reporting its status from inside a bash script. For example

cat "afile" | ssmtp -s "subject" someone@dest_email.com

On the Raspberry Pi there are a few options including:

  • msmtp
  • ssmtp
  • exim4
  • postfix
    I have tried but I cannot find any of these packages available for the BeagleBone Black version of Angstrom. I have tried all the opkg list | grep “xxxxx” combinations and it always returns NULL.

I have found reference to msmtp in the Angstrom Feed Browser here: http://www.angstrom-distribution.org/repo/?pkgname=msmtp-dev
I have also found reference to a postfix package.

However, I cannot get it through the package manager on the BeagleBone.

Here are my questions:

  • This version of msmtp is applicable for the Ångström 2011.03 glibc armv7a base feed . Is this the correct one for the BeagleBoard Black?
  • If the msmtp package is compatible with the BeagleBone Black how can I point opkg to look in the right place?
  • If I cannot get it through the opkg install msmtp functionality, can I copy the .ipk file and install it manually?
  • If I can do neither of the above, can I compile the source on the BeagleBone Black and install it manually? If so, how would I go about this?

I believe that the person that can answer this will solve quite a big problem for many people. I have seen a number of references to other people struggling with the same thing.

Thanks for your help.

IMHO it's an overkill to install an entire Mailserver on your poor BBB
But you can use your own or your ISP's SMTP server.... with a bit
scripting, see eg:
http://stackoverflow.com/questions/64505/sending-mail-from-python-using-smtp
http://stackoverflow.com/questions/9998710/can-it-possible-to-send-mails-by-bash-script-via-smtp

Or, you can install Java and the mail.jar, and use their mail classes.

For me, in a script, I invoke java QuickMail “The subject” “Some text”.
Works great.

The code QuickMail.java is about 200 lines.

~/java/mail > java QuickMail “A subject” “A body”

**** About to send ******
Mail was sent successfully.

Thanks for the ideas.

In the end I found that there were packages for the msmtp for arm7a in the Angstrom respositories but that they were not visible to the opkg command.

This is what I did and it worked perfectly:

  1. Download the msmtp package from angstrom feed browser http://www.angstrom-distribution.org/feeds/2011.03/ipk/glibc/armv7a/base/msmtp_1.4.19-r0.5_armv7a.ipk
  2. Download the old version (1.18) of the libidn from the feed http://www.angstrom-distribution.org/feeds/next/ipk/eglibc/armv7a/base/libidn_1.18-r0.9_armv7a.ipk
  3. Install these (first the libidn) by running opkg install from the same folder as the downloads above
  4. Configure the /etc/msmtprc file as per many tutorials out there.
    Don’t be fooled into downloading the newer libidn - it breaks msmtp.

Very easy when I figured it all out. Thanks to everyone who posts their ideas and helps other people.

I would install “mutt”, which can send email by talking to remote relay instead of using local “sendmail”. That’s what I do on my laptop.

Yes, I highly recommend mutt. It’s available in Angstrom, and I use it all the time in scripts to send logs, etc. from BeagleBone white/black and Raspberry Pi to Gmail. Has its own MTA, doesn’t need SMTP server on the board, which is a real plus.

Jerry

Hi, please could you explain me how to install mutt in beaglebone.

i think i did it right, but when i tried to send a an email with mutt i have some errors.

`
root@dhcppc0:~# mutt -s “Test from mutt” myemail@gmail.com < msg.txt
Error in /home/root/.muttrc, line 5: smtp_url: unknown variable
Error in /home/root/.muttrc, line 6: smtp_pass: unknown variable
SSL is unavailable.
SSL is unavailable.
SSL is unavailable.
Error in /home/root/.muttrc, line 16: certificate_file: unknown variable
source: errors in /home/root/.muttrc
Error sending message, child exited 127 (Exec error.).
Could not send the message.
root@dhcppc0:~#

`

Adding to my post im trying to make an script that send my public ip to my email address when it change.

could someone help me?