Email software

Post Reply
lawrencew
Posts: 12
Joined: Mon Sep 24, 2012 8:20 am

Email software

Post by lawrencew » Wed Sep 26, 2012 10:47 pm

The drive has the built-in functionality of sending an email when there's a problem. Do we know what software it uses to do that? Is there a way of piggy-backing on this?

I'd like to periodically email myself my IP address, because my IP is dynamic and it is frustrating to go away for some time, only to find that the ISP reset the IP...

Thanks.

seidler2547
Posts: 110
Joined: Fri Jul 13, 2012 8:12 am

Re: Email software

Post by seidler2547 » Thu Sep 27, 2012 9:37 am

You can try the mailmail command line program, like this:

Code: Select all

echo 'From: sohostorage@myremotenas.com
To: yourmail@example.com
Subject: Test-Email

This is the content
' | mailmail yourmail@example.com
but I think it doesn't work.

Other option would be to directly talk to the mail server, data from here:

Code: Select all

cat /usr/local/cfg/Email.xml
<?xml version="1.0" encoding="utf-8"?><Email Default_Password="Hkv482N9G" Default_RelayServer="alerts.myremotenas.com:587" Default_Sender="sohostorage@myremotenas.com" Default_User="lifelinesohostorage" _Fixed_="1">
Stefan

lawrencew
Posts: 12
Joined: Mon Sep 24, 2012 8:20 am

Re: Email software

Post by lawrencew » Thu Sep 27, 2012 2:58 pm

I will try some things I've seen online and report back if I'm successful... I can think of a few instances where having the device mail me as a part of a bash script would be somewhat useful...

lawrencew
Posts: 12
Joined: Mon Sep 24, 2012 8:20 am

Re: Email software

Post by lawrencew » Tue Oct 02, 2012 11:27 pm

I think I have nearly managed to get somewhere by installing Mutt, but I need to do some more configuration before it will connect to my SMTP server.

jez
Posts: 18
Joined: Wed Jul 10, 2013 3:18 pm

Re: Email software

Post by jez » Thu Jan 22, 2015 4:14 am

lawrencew wrote:The drive has the built-in functionality of sending an email when there's a problem. Do we know what software it uses to do that? Is there a way of piggy-backing on this?

I'd like to periodically email myself my IP address, because my IP is dynamic and it is frustrating to go away for some time, only to find that the ISP reset the IP...

Thanks.
On my Lenovo EZ there's a python script /usr/sbin/smtpsend that my system uses to send emails. Run "head -30 /usr/sbin/smtpsend" for parameters and their meanings.

When I send a test email from the GUI, and simultaneously run "ps" from CLI, I find that it runs like so:

Code: Select all

/usr/bin/python /usr/sbin/smtpsend --host nasalerts.lenovoemc.com --port 587 --from alertnotification@lenovoemc.com -x -M <MAC-VENDOR-NUMBER> --username wynnlife --passwd <SOME-PASSWORD> -a --subject "Notification message from 'LenovoEZ' device (1)" --msg "This is a test message to validate that notification address '<MY-EMAIL-ADDRESS' is reachable.  Device Information: <IP-ADDRESS>, <FIRMWARE-VERSION>, Lenovo EZ, <ID??>" --rcpt <MY-EMAIL-ADDRESS>
The bits in <ANGLE-BRACKETS> are redacted. The password might be unique for each device, I don't know. The password is stored in the file /usr/local/cfg/Email.xml.

jez
Posts: 18
Joined: Wed Jul 10, 2013 3:18 pm

Re: Email software

Post by jez » Thu Jan 22, 2015 6:50 am

jez wrote:On my Lenovo EZ there's a python script /usr/sbin/smtpsend that my system uses to send emails.
It turns out most of those parameters are not required if you're prepared to use the EMC-provided mail relay (specifying "--df"). This is all you require:

Code: Select all

printf "testing\n" | /usr/sbin/smtpsend --df --subject "Subject" --rcpt recipient@example.com
Also, I made a wrapper that uses smtpsend but works like the traditional "mail" program.

Post Reply