SOLVED CLI mail clientmailx

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

SOLVED CLI mail clientmailx

Postby g8jvm » Tue Apr 30, 2013 5:17 pm

Hi All
Is there any further info on using mailx, the man page is not very clear, wikis blogs etc ( easy to understand )
Thanks
Last edited by g8jvm on Thu May 02, 2013 6:48 pm, edited 1 time in total.
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 » Tue Apr 30, 2013 9:06 pm

It's the ages-old standard mail client.

What exactly are you trying to accomplish?

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

Re: CLI mail clientmailx

Postby g8jvm » Tue Apr 30, 2013 10:06 pm

Hi
something very simple, send me an e-mail when motion gets triggered, so as simple as possible from CLI
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 » Tue Apr 30, 2013 11:13 pm

$this->bbcode_second_pass_code('', '
echo "hello world" | mail -s "test subject" you@youraddress.com
')

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

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 7:54 am

Thats what I like something nice and simple,
Does the remote smtp server need setting up ? is that with sendmail ?
many 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 » Wed May 01, 2013 1:24 pm

If you have mailx, I'm assuming you have a local MTA of some sort (properly configured to relay to your real upstream SMTP server), yes. You can't very well mail without one (well, you *can*, but then you're talking about something more like msmtp and direct-relay).

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

Re: CLI mail clientmailx

Postby g8jvm » Wed May 01, 2013 1:35 pm

Hi Rodney
I haven't got an MTA installed yet., there is only the perl sendmail , sendmail isn't on the package list.
It only needs to be a simple MTA as it shouldn't get used, apart from testing, or If my son holds a party while I'm away.
What would you recommend ?
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 » Wed May 01, 2013 2:47 pm

You'll need some sort of mta - msmtp is probably the lightest weight solution (assuming you're relaying upstream to something like Gmail or an ISP mail provider).

msmtp/sendmail is the MTA component, mailx is the userspace component that does all the formatting and such for you. You need both working for this to function properly.

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

Re: CLI mail clientmailx

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

Ok
msmtp loaded and I think I have it configured for my ISP, I hope it will accept on port 25, I normally use starttls on port 587.
It accepts a telnet connection so may be.
looking for a config file for mail on the system, all I can find is /etc/mailrc
In that file I can see nowhere for it to use send mail, but
it wants to use sendmail


I tried this :-
[root@Pogopig ~]# echo "hello world" | mailx -s "test subject" richard@g8jvm.info|msmtp
msmtp: no recipients found
[root@Pogopig ~]# /usr/sbin/sendmail: No such file or directory
. . . message not sent.
I also tried mail -s as well, same results

/root/.msmtprc :-

root@Pogopig ~]# cat .msmtprc
# Example for a user configuration file

# Set default values for all following accounts.
defaults
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile ~/.msmtp.log

# A 1and1 service
account 1and1.co.uk
host auth.smtp.1and1.co.uk
from richard@g8jvm.info
auth on
user richard@g8jvm.info
password xxxxxxxxxxxx

# Set a default account
account default : 1and1.co.uk



Strange?
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 5:35 pm

Try:

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

If that works, you can just link sendmail to the msmtp binary and mailx should "automagically" use it without needing to include msmtp in the pipe.

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

Next

Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 11 guests