[yocto] Sending mail from embedded device

Tim Coote tim+yoctoproject.org at coote.org
Thu Aug 8 12:54:20 PDT 2013


On 8 Aug 2013, at 12:49, Gary Thomas <gary at mlbassoc.com> wrote:

> On 2013-08-08 03:58, Tim Coote wrote:
>> 
>> On 6 Aug 2013, at 19:39, Tomas Frydrych <tf+lists.yocto at r-finger.com> wrote:
>> 
>>> On 06/08/13 18:27, Gary Thomas wrote:
>>>> On 2013-08-06 10:01, Mark Hatle wrote:
>>>>> On 8/6/13 10:00 AM, Jack Mitchell wrote:
>>>>>> On 06/08/13 15:50, Mark Hatle wrote:
>>>>>>> On 8/6/13 9:41 AM, Jack Mitchell wrote:
>>>>>>>> On 06/08/13 15:31, Gary Thomas wrote:
>>>>>>>>> My embedded device needs to send out email.
>>>>>>>>> 
>>>>>>>>> I've looked around a bit and I don't see any recipes for a
>>>>>>>>> mail sender, e.g. sendmail or postfix, for Yocto (OE-core).
>>>>>>>>> 
>>>>>>>>> Have I missed something?  Does anyone have any suggestions?
>>>>>>>>> 
>>>>>>>>> Surely my application isn't the first that wants to send email...
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> Would recipes-extended/msmtp do the job? Do you need to run the whole
>>>>>>>> mail stack or is pushing out emails to an smtp server adequate?
>>>>>>>> 
>>>>>>> 
>>>>>>> msmtp is provided specifically to be able to send email out.  It should
>>>>>>> produce a binary called "sendmail" that is capable of simply sending
>>>>>>> email (and conforming to LSB requirements.)
>>>>>>> 
>>>>>>> --Mark
>>>>>> 
>>>>>> Colour me impressed, I didn't realise it was also a drop-in for
>>>>>> sendmail.
>>>>> 
>>>>> Drop in replacement for the 'sendmail' command, but it's not a drop-in
>>>>> for 'sendmail' the software.  (It only has sending capabilities from
>>>>> what I've been told, which is all that
>>>>> is required for the LSB certification.)
>>>> 
>>>> And almost enough for my needs.  Amanda wants to use an MTA that
>>>> works like the desktop 'mail', e.g.
>>>>  mail -s "subject" TO <body
>>>> I wrote a simple wrapper to use msmtp/sendmail and it works fine.
>>> 
>>> I can confirm mstp works very well, and with all the necessary bells and
>>> whistles like TLS. If you need more complex messages (e.g.,
>>> attachments), then libgmime makes composing the email messages to pipe
>>> into mstmtp quite easy.
>>> 
>>> Tomas
>>> 
>> Am I being very obtuse if I think that an embedded device should not be able to send email as it's embedded, which means disconnected from the rest of the world?  Or have we reached the stage where the overlap between yocto and a mainstream distro is vanishingly small?
> 
> It's a bit narrow to think that an embedded device is not connected
> to anything else!  The term "embedded" is normally taken to mean
> dedicated to some [set of] purposes.  There is nothing to say that
> the embedded device does not or need not communicate with other
> systems and sending an email seems quite reasonable to me.  See
>  http://en.wikipedia.org/wiki/Embedded_computer_system
> 
> Here's an example:  I have a complex solar electric system on my
> house.  Part of this system is the system-wide controller which
> monitors the power line and also communicates  with the power
> inverters (that actually create the A/C electricity for the system).
> The system controller periodically sends a report upstream so that
> I (and others) know it's status, how much power has been produced,
> etc.  This report is sent via ethernet - it uses HTTP, but could
> just as easily be built using email messages since it's one-way
> only.  This is very much an embedded system.  It does only one
> thing (a small collection of tasks), i.e. monitor the solar generating
> system at my house and being connected and communicating to other
> entities, possibly even sending email, is very much a part of how it works.
> 
> My reason for asking this question in the first place (how to send
> email from my Yocto based device) is just as straight forward.  I
> have a specialized NASD device which I'm using as a system-wide backup.
> This is a powerful machine - P1022 PowerPC with many TB of high speed
> RAID disks, etc - but it's also "embedded" in that I don't expect it
> to do anything other than manage those disks and let me communicate
> with it.  I'm running Amanda which is a powerful automated backup
> system on the box.  It runs automatically/autonomously and sends
> reports of what happened to me at my desk, via email.
> 
> Examples are everywhere; connected systems are the future (and the
> now)!  Some circles even want your fridge and washing machine to
> be networked and I can't see calling them anything other than
> embedded...
I can fully appreciate why yocto can be a suitable tool for this scenario - especially if it's a familiar tool. I was only positing that, maybe, some of the yocto projects seem to be pulling in the types of package that could reasonably be considered for a "a general-purpose computer" (to quote the wikipedia article).  If an embedded computer is connected enough, maybe it would make sense to handle the package dependencies using the per-work done by a 'general purpose' distro, and the config management using the devops techniques (especially 'treat infrastructure as code') to decouple hardware failure from the build and configure process.

I'm interested to see how the approaches evolve.

Tim


More information about the yocto mailing list