SOLVED CLI mail clientmailx

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 5:46 pm

:(
Its still trying to use sendmail,

[root@Pogopig ~]# echo "hello world" | mailx -s "test subject" richard@g8jvm.info|msmtp -t
/usr/sbin/sendmail: No such file or directory
. . . message not sent.
msmtp: no recipients found
Sendmail doesn't seem to be in the package list either, just the perl module

Arch
Keywords sendmail
sort descending
Arch Repo Packagesort descending Version Description

armv5 community perl-mail-sendmail 0.79-5 Perl/CPAN Module Mail::Sendmail : Simple platform independent mailer


Thanks Rodney
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: CLI mail clientmailx

Postby rhester72 » Wed May 01, 2013 6:00 pm

Hrm...mailx is stubborn. *LOL*

OK, link sendmail:

$this->bbcode_second_pass_code('', '
ln -s /usr/bin/msmtp /usr/sbin/sendmail
')

(sorry, I don't know the path to msmtp and can't get to my box at the moment)

Then re-execute the test without the pipe to sendmail:

$this->bbcode_second_pass_code('', '
echo "hello world" | mailx -s "test subject" richard@g8jvm.info
')

Rodney
rhester72
 
Posts: 35
Joined: Tue Apr 30, 2013 4:24 pm

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 6:31 pm

Hi Rodney. I think getting closer
I added /root/.mailrc$this->bbcode_second_pass_code('', '[root@Pogopig ~]# cat .mailrc
set sendmail="/usr/bin/msmtp"
set message-sendmail-extra-arguments="-a 1and1.co.uk"
')

i now get :-
$this->bbcode_second_pass_code('', '[root@Pogopig ~]# echo "hello world" | mailx -s "test subject" richard@g8jvm.info
[root@Pogopig ~]# send-mail: authentication failed (method PLAIN)
send-mail: server message: 535 Authentication failure
send-mail: could not send mail (account default from /root/.msmtprc)

')

so I tried adapting this script I found
$this->bbcode_second_pass_code('', '#Gmail account
defaults
logfile ~/msmtp.log

account gmail
auth on
host smtp.gmail.com
from your_address@gmail.com
auth on
tls on
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt ### I used tls_trust_file /etc/ssl/certs/ca-certificates.crt
user your_address@gmail.com
password your_gmail_password
port 587

account default : gmail')

which produced
$this->bbcode_second_pass_code('', '[root@Pogopig ~]# echo "hello world" | mailx -s "test subject" richard@g8jvm.info
[root@Pogopig ~]# send-mail: cannot connect to smtp.blueyonder.co.uk, port 587: Connection timed out
send-mail: could not send mail (account default from /root/.msmtprc)
send-mail: cannot connect to smtp.blueyonder.co.uk, port 587: Connection timed out
')

Probably better off trying to get the 1and1 account working, might try port 465 on the above as well.
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: CLI mail clientmailx

Postby rhester72 » Wed May 01, 2013 7:49 pm

The gmail msmtp configuration looks pretty good visually. I have no access to a working setup from where I am at the moment, but if nobody jumps in, I'll try to reply tonight with a known-working setup.

Rodney
rhester72
 
Posts: 35
Joined: Tue Apr 30, 2013 4:24 pm

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 8:01 pm

OK thanks

the correct port for gmail ( virginmedia/ntl/blueyonder etc ) was 465, but it still didn't play.
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 8:09 pm

I just got the 1and1 account to work :), juggled the config a little.

now to see if I can get it to work from motion

Thanks Rodney
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 9:11 pm

Hi

just a syntax bit of advise please

I'm not sure if I can use brackets in a mailx CL
$this->bbcode_second_pass_code('', ']echo "Camera detection" %d-%m-%Y%H%M%S-%v |mailx -s "Movement Detected" %d-%m-%Y%H%M%S-%v richard@g8jvm.info')

That doesn't work
the second date stamp is taken as part of the address, so the mail fails
The first date stamp just prints out as written
Could I do ?

$this->bbcode_second_pass_code('', ' echo ["camera detection" %d-%m-%Y%H%M%S-%v] | mailx -s ["Movement detected" <datestamp>] richard@g8jvm.info')

I found sending mail per frame at 4Frames/sec fills the mailbox up quickly. especially at the moment pointing at the road.
So now per start of each movie file

takeing the second date stamp as
$this->bbcode_second_pass_code('', ' \ mailx -s " Movement detected <date-stamp>" richard@g8jvm.info')

sorta works

GETTING VERY CLOSE NOW :)
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: CLI mail clientmailx

Postby rhester72 » Thu May 02, 2013 1:49 am

Anything passed to mailx outside the subject is going to be considered a destination address. What are you trying to achieve with the second date?

Rodney
rhester72
 
Posts: 35
Joined: Tue Apr 30, 2013 4:24 pm

Re: CLI mail clientmailx

Postby g8jvm » Thu May 02, 2013 6:07 am

Hi Rodney

The end result should be, the subject with the time and date of intrusion, and the body of the text
a link to the avi file.
The next step will be to try an attach the video,.avi, to the mail.
I know mailx cant do this, but I think mutt can. so should the pogoplug get taken or destroyed the video of the event
will be sitting in my mail folder when I get back, or look at it next.
Thanks
Best wishes
Richard
richard@g8jvm.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ham Call: G8JVM , QRA IO82SP38 interests weak signal propagation
VHF to microwave, http://www.g8jvm.com
g8jvm
 
Posts: 93
Joined: Mon Apr 22, 2013 4:40 pm
Location: United Kingdom

Re: CLI mail clientmailx

Postby rhester72 » Thu May 02, 2013 2:02 pm

Oh, OK - just move the quotes on the command line to include the date. Anything between the quotes after -s is considered part of the subject - anything outside, not so much.

e.g. change:

echo "Camera detection" %d-%m-%Y%H%M%S-%v |mailx -s "Movement Detected" %d-%m-%Y%H%M%S-%v richard@g8jvm.info

to:

echo "Camera detection" %d-%m-%Y%H%M%S-%v |mailx -s "Movement Detected %d-%m-%Y%H%M%S-%v" richard@g8jvm.info

Rodney
rhester72
 
Posts: 35
Joined: Tue Apr 30, 2013 4:24 pm

PreviousNext

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 18 guests