how to send Internet e-mail from script?

This is a discussion on how to send Internet e-mail from script? within the Linux Administration forums, part of the Linux Forums category; All the how-tos I've read on the subject assume that you've got a nice MTA working to ...


Go Back   Usenet Forums > Linux Forums > Linux Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-02-2006
Gary Dale
 
Posts: n/a
Default how to send Internet e-mail from script?

All the how-tos I've read on the subject assume that you've got a nice
MTA working to handle all your e-mail both locally and through the
Internet. Then it's just a matter of giving it the recipient's address
and off it goes.

Unfortunately, I don't have an MTA. I need to send an e-mail to a remote
address through an SMTP server that requires authentication (i.e. your
typical SOHO or home setup). From a GUI I can configure Thunderbird or
whatever without any problems and it works. However, I have some scripts
that need to send out Internet e-mail notices from a server without a
GUI and without user intervention.

Is there a good howto on the subject anywhere?
Reply With Quote
  #2 (permalink)  
Old 02-02-2006
Art Werschulz
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Hi.

This doesn't answer your original question, but it will allow you to send
mail. Hopefully, that's good enough.

Since you're using Linux, you should have sendmail on your computer (or you
can install it from an RPM). Should you find it necessary to reconfigure
sendmail a bit, you'll also need to install the sendmail-cf RPM.

Having done so, all you need to do is pipe your mail msg into
/usr/sbin/sendmail. In bash, something like the following will do the job:

$ /usr/sbin/sendmail -t <<EOF
To: vader@empire.org
From: luke@jedi.org

Dear Dad:

Send money.
EOF

There are also some Perl modules (Mail::whatever) that deal with email;
maybe one of them will solve the original problem.

--
Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y?
Internet: agw STRUDEL cs.columbia.edu
ATTnet: Columbia U. (212) 939-7060, Fordham U. (212) 636-6325
Reply With Quote
  #3 (permalink)  
Old 02-02-2006
Rick Moen
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Gary Dale <garydale@rogers.com> wrote:

> Unfortunately, I don't have an MTA. I need to send an e-mail to a remote
> address through an SMTP server that requires authentication (i.e. your
> typical SOHO or home setup). From a GUI I can configure Thunderbird or
> whatever without any problems and it works. However, I have some scripts
> that need to send out Internet e-mail notices from a server without a
> GUI and without user intervention.
>
> Is there a good howto on the subject anywhere?


Why don't you make it easy on yourself and pick/install a nullmailer.
See: "Nullmailers" on http://linuxmafia.com/kb/Mail/

Reply With Quote
  #4 (permalink)  
Old 02-03-2006
Gary Dale
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Art Werschulz wrote:
> Hi.
>
> This doesn't answer your original question, but it will allow you to send
> mail. Hopefully, that's good enough.
>
> Since you're using Linux, you should have sendmail on your computer (or you
> can install it from an RPM). Should you find it necessary to reconfigure
> sendmail a bit, you'll also need to install the sendmail-cf RPM.
>
> Having done so, all you need to do is pipe your mail msg into
> /usr/sbin/sendmail. In bash, something like the following will do the job:
>
> $ /usr/sbin/sendmail -t <<EOF
> To: vader@empire.org
> From: luke@jedi.org
>
> Dear Dad:
>
> Send money.
> EOF
>
> There are also some Perl modules (Mail::whatever) that deal with email;
> maybe one of them will solve the original problem.
>



Actually, I work with Debian Sarge, which is normally configured to use
Exim4 instead of SendMail. However, I have no (other) use for it in most
SOHO situations. The problem with both packages is that the
configuration is close to rocket science, even in Debian, and both are
vast overkill when all you want to do is route your outgoing e-mail to
your ISP's smtp server.
Reply With Quote
  #5 (permalink)  
Old 02-03-2006
Gary Dale
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Rick Moen wrote:
> Gary Dale <garydale@rogers.com> wrote:
>
>
>>Unfortunately, I don't have an MTA. I need to send an e-mail to a remote
>>address through an SMTP server that requires authentication (i.e. your
>>typical SOHO or home setup). From a GUI I can configure Thunderbird or
>>whatever without any problems and it works. However, I have some scripts
>>that need to send out Internet e-mail notices from a server without a
>>GUI and without user intervention.
>>
>>Is there a good howto on the subject anywhere?

>
>
> Why don't you make it easy on yourself and pick/install a nullmailer.
> See: "Nullmailers" on http://linuxmafia.com/kb/Mail/
>


Thanks Rick. There are three there that I can investigate. Hopefully I
can get one to work. :)
Reply With Quote
  #6 (permalink)  
Old 02-03-2006
Gary Dale
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Rick Moen wrote:
> Gary Dale <garydale@rogers.com> wrote:
>
>
>>Unfortunately, I don't have an MTA. I need to send an e-mail to a remote
>>address through an SMTP server that requires authentication (i.e. your
>>typical SOHO or home setup). From a GUI I can configure Thunderbird or
>>whatever without any problems and it works. However, I have some scripts
>>that need to send out Internet e-mail notices from a server without a
>>GUI and without user intervention.
>>
>>Is there a good howto on the subject anywhere?

>
>
> Why don't you make it easy on yourself and pick/install a nullmailer.
> See: "Nullmailers" on http://linuxmafia.com/kb/Mail/
>


The nullmailers all seem to lack one essential feature. They don't seem
to have a method of authenticating to the smtp server. From the limited
documentation and from playing around with two of them, they seem to
assume that your smtp server is either open or gets its authentication
information locally.

Unfortunately, I don't know anyone who doesn't authenticate outside of
the "departmental mailhub" that sSMTP talks about.

This puts me back at trying to configure Exim4 to handle the hand-off. :(
Reply With Quote
  #7 (permalink)  
Old 02-03-2006
Rick Moen
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Gary Dale <garydale@rogers.com> wrote:

> This puts me back at trying to configure Exim4 to handle the hand-off. :(


Well, Exim's the easiest to configure of the major MTAs (sendmail, Exim,
Postfix, Courier-MTA, and the proprietary qmail program), so you're
probably on a least-pain trajectory.

Reply With Quote
  #8 (permalink)  
Old 02-03-2006
Gary Dale
 
Posts: n/a
Default Re: how to send Internet e-mail from script?

Rick Moen wrote:
> Gary Dale <garydale@rogers.com> wrote:
>
>
>>This puts me back at trying to configure Exim4 to handle the hand-off. :(

>
>
> Well, Exim's the easiest to configure of the major MTAs (sendmail, Exim,
> Postfix, Courier-MTA, and the proprietary qmail program), so you're
> probably on a least-pain trajectory.
>


Maybe, but after setting up passwd.client and modifying the config file
to send username & password, I'm still not getting anywhere. The exim
log shows a 530 error connecting to the smtp server.

I'm trying to connect to a rogers server, so my passwd.client line is:

smtp.broadband.rogers.com:garydale@rogers.com:mypa ssword

THis is the same authentication information I had to provide to
Thunderbird.

I also modified conf.d/auth/30_exim4-config_examples by uncommenting the
scripts that allow smtp authentication.

Still no luck.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:20 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0