Gmail Calendar Documents Web Reader more »
Help | Sign in
Google Groups Home
email from command line
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bill Turner  
View profile  
 More options Mar 9, 10:15 am
From: Bill Turner <lotsacaffe...@gmail.com>
Date: Tue, 9 Mar 2010 09:15:15 -0600
Local: Tues, Mar 9 2010 10:15 am
Subject: email from command line

I have about 120 CentOS 4 servers scattered all over the country.  They are
setup in master/slave pairs running mySQL with replication.  I want the
master to send me an email message when an error occurs.

Something like this…

sendmail –s “Company X STATUS” “b...@uponthebox.com” < /tmp/status.txt

Most of my servers have static IPs…not that this should matter.

The last attempt I made at getting this to work was trying to setup sendmail
to use a remote smtp server (i.e. smptout.secureserver.net).  This is what
/var/log/maillog reports after I send a message.

Mar  8 11:57:43 localhost sendmail[4640]: o28GSWVf003070: to=<
b...@uponthebox.com>, ctladdr=<r...@localhost.localdomain> (0/0),
delay=01:29:10, xdelay=00:00:00, mailer=relay, pri=485003, relay=
smtpout.secureserver.net, dsn=4.0.0, stat=Deferred: Name server:
smtpout.secureserver.net: host name lookup failure

Yes, I can ping the smtp server all day long and DNS resolves it.

Isn’t there an easy way to send an email from a stupid command line script
that doesn’t involve all this sendmail configuration stuff?

Bill Turner


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Don Delp  
View profile  
 More options Mar 9, 10:31 am
From: Don Delp <nesma...@gmail.com>
Date: Tue, 9 Mar 2010 09:31:35 -0600
Local: Tues, Mar 9 2010 10:31 am
Subject: Re: [nlug] email from command line

It's been a while since I've messed with this, but I'm pretty sure you
don't need to find an outside smtp server.  Sendmail handles this for
you.  As long as your sending server can get out on port 25 it will
look up the correct server to pass the message off to without needing
a middleman.

I've set this up with formmail scripts in php and cgi and unless your
server is on a restricted network or has a strange setup, you should
be ok.

If you're hosing with godaddy, they may have to make changes to allow
you to send mail.  If you have shell access there, try to connect to
someone's smtp server:

donalddelp@donalddelp-cti:~$ telnet gmail-smtp-in.l.google.com. 25
Trying 209.85.211.76...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP 8si13013546ywh.11

If this works, you don't need to specify an smtp server for sendmail.
(Someone please correct me if I'm wrong)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
gm5729  
View profile  
 More options Mar 9, 10:31 am
From: gm5729 <gm5...@gmail.com>
Date: Tue, 9 Mar 2010 09:31:02 -0600
Local: Tues, Mar 9 2010 10:31 am
Subject: Re: [nlug] email from command line
This may help you. It is called mailx and is basically a oneliner that
can be very simple or as you see from the forum examples more
complicated.

http://www.unix.com/shell-programming-scripting/18370-sending-email-t...

As a side thought have you though of using curl or wgetpaste ( I'm
talking the principle here) to extract the mail by cron?

VP

--
--
If there is a question to the validity of this email please phone for
validation. Proudly presented by Mutt, GNUPG, Vi/m and GNU/Linux via
CopyLeft. GNU/Linux is about Freedom to compute as you want and need
to, and share your work unencumbered and have others do the same with
you. Key :  0xD53A8E1

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sabuj Pattanayek  
View profile  
 More options Mar 9, 10:33 am
From: Sabuj Pattanayek <sab...@gmail.com>
Date: Tue, 9 Mar 2010 09:33:17 -0600
Local: Tues, Mar 9 2010 10:33 am
Subject: Re: [nlug] email from command line
Sendmail on centos/rhel boxes are setup by default to allow users to send mail:

mail -s  “Company X STATUS” b...@uponthebox.com < /tmp/status.txt

It is also setup to receive mail from one user to another on the
machine itself, i.e. it operates only on the loopback unless you make
modifications to /etc/mail/sendmail.mc . Revert any changes you made
to that .mc file, run make, restart sendmail, and try the command
above.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bill Woody  
View profile  
 More options Mar 9, 10:39 am
From: Bill Woody <woody39...@gmail.com>
Date: Tue, 9 Mar 2010 10:39:11 -0500
Local: Tues, Mar 9 2010 10:39 am
Subject: Re: [nlug] email from command line

Is "uponthebox.com <b...@uponthebox.com>”  a server you control?

On Tue, Mar 9, 2010 at 10:15 AM, Bill Turner <lotsacaffe...@gmail.com>wrote:


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
William Turner  
View profile  
 More options Mar 9, 9:32 am
From: "William Turner" <b...@uponthebox.com>
Date: Tue, 9 Mar 2010 08:32:30 -0600
Local: Tues, Mar 9 2010 9:32 am
Subject: email from command line

I have about 120 CentOS 4 servers scattered all over the country.  They are
setup in master/slave pairs running mySQL with replication.  I want the
master to send me an email message when an error occurs.

Something like this.

sendmail -s "Company X STATUS" "b...@uponthebox.com" < /tmp/status.txt

Most of my servers have static IPs.not that this should matter.  

The last attempt I made at getting this to work was trying to setup sendmail
to use a remote smtp server (i.e. smptout.secureserver.net).  This is what
/var/log/maillog reports after I send a message.

Mar  8 11:57:43 localhost sendmail[4640]: o28GSWVf003070:
to=<b...@uponthebox.com>, ctladdr=<r...@localhost.localdomain> (0/0),
delay=01:29:10, xdelay=00:00:00, mailer=relay, pri=485003,
relay=smtpout.secureserver.net, dsn=4.0.0, stat=Deferred: Name server:
smtpout.secureserver.net: host name lookup failure

Yes, I can ping the smtp server all day long and DNS resolves it.

Isn't there an easy way to send an email from a stupid command line script
that doesn't involve all this sendmail configuration stuff?

Bill Turner


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Howard  
View profile  
 More options Mar 9, 10:51 am
From: "Howard" <hwh...@vcch.com>
Date: Tue, 09 Mar 2010 09:51:46 -0600
Local: Tues, Mar 9 2010 10:51 am
Subject: Re: [nlug] email from command line

Interesting discussion, Bill.

Don't know if we understand the underlying triggers that send these
notices to you.  Is a monitoring system such as Nagios overkill for what
you are doing??  Nagios would offer a central server to monitor those
remotes and collect data for central management.

If not Sendmail then maybe Postfix to send your mail out.  The latter is
far simpler to configure and is the default email engine on packages
such as Elastix and FreePBX.

Howard White


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bill Woody  
View profile  
 More options Mar 9, 11:02 am
From: Bill Woody <woody39...@gmail.com>
Date: Tue, 9 Mar 2010 11:02:09 -0500
Local: Tues, Mar 9 2010 11:02 am
Subject: Re: [nlug] email from command line

qmail is more secure and simple in it's configuration.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google