Re: [newbie] Sending email from a script

2004-07-27 Thread Ron Hunter-Duvar
On July 22, 2004 07:47, Bryan Phinney wrote:
 On Wednesday 21 July 2004 05:54 pm, Ron Hunter-Duvar wrote:
  I don't want to run my own mail server (not at the moment). I rely on my
  isp for sending and receiving email.
 
  Is there a simple way to do this? Can I somehow tell kmail to do it for
  me? If not, can someone point me to some good instructions for
  configuring postfix to do what I need without interfering with email
  to/from my isp, and without opening up security holes in my system (e.g.
  an open relay).

 Look for and install a package called esmtp, that mirrors sendmail
 functionality but doesn't actually work as an MTA itself, it simply relays
 messages to your MTA of choice.  In essence, it provides you with full
 sendmail compatibility for scripts but it only relays messages just as your
 mail client would.

 There are a couple of other packages that do the same thing as well but
 esmtp is very simply to setup and configure for what you want it to do. 
 The only drawback is that it won't route local messages to your machine,
 you have to send to fully qualified email addresses because you are are
 relaying through an external server.  IOW, you can't send message to
 [EMAIL PROTECTED], etc.

Thanks, esmtp is exactly what I needed.

It would have been nice if Mandrake installed this by default. I was trying to 
use the mail command, but it just dies with an error that /usr/sbin/sendmail 
is missing. But I suppose it wouldn't work anyway without a suitable config 
file.

-- 
Ron Hunter-Duvar
ronhd at users dot sourceforge dot net

Opinions expressed here are all mine. Rights to use
these opinions are granted under the GNU GPL.


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] Sending email from a script

2004-07-27 Thread Bryan Phinney
On Tuesday 27 July 2004 02:20 pm, Ron Hunter-Duvar wrote:

 Thanks, esmtp is exactly what I needed.

 It would have been nice if Mandrake installed this by default. I was trying
 to use the mail command, but it just dies with an error that
 /usr/sbin/sendmail is missing. But I suppose it wouldn't work anyway
 without a suitable config file.

Correct.  Also, Mandrake installs Postfix by default if you tell it you want 
to operate a mail server.  esmtp won't coexist with Postfix since they both 
offer compatibility with sendmail.
-- 
Bryan Phinney



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] Sending email from a script

2004-07-22 Thread Job Evers
On Wed, 21 Jul 2004, Ron Hunter-Duvar wrote:

 Anyone out there ever written a script to send email messages?

 I want to write a script that will send a message to a certain email address
 when called. I thought I could just use the mail program, but it relies
 on /usr/sbin/sendmail to actually send the message. I believe that means I
 have to install and configure either sendmail or postfix. Sounds like a lot
 of work for a simple script.

 I don't want to run my own mail server (not at the moment). I rely on my isp
 for sending and receiving email.

 Is there a simple way to do this? Can I somehow tell kmail to do it for me? If
 not, can someone point me to some good instructions for configuring postfix
 to do what I need without interfering with email to/from my isp, and without
 opening up security holes in my system (e.g. an open relay).


Might want to look at smtp-source?  Not sure if it is what you are looking
for - but the MAN page looked slightly promising.

Also, If you are using perl check out
http://search.cpan.org/~gbarr/libnet-1.19/Net/SMTP.pm which says:

This example sends a small message to the postmaster at the SMTP server
known as mailhost:

#!/usr/local/bin/perl -w

use Net::SMTP;

$smtp = Net::SMTP-new('mailhost');

$smtp-mail($ENV{USER});
$smtp-to('postmaster');

$smtp-data();
$smtp-datasend(To: postmaster\n);
$smtp-datasend(\n);
$smtp-datasend(A simple test message\n);
$smtp-dataend();

$smtp-quit;

Hope that helps.

Job


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] Sending email from a script

2004-07-22 Thread Paul Smith
Job Evers wrote:
I don't want to run my own mail server (not at the moment). I rely on my isp
for sending and receiving email.
You may find interesting the discussion at the address below:
http://groups.google.com/groups?hl=enlr=ie=UTF-8th=e24b7f1413649e06rnum=5
Paul


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] Sending email from a script

2004-07-22 Thread Bryan Phinney
On Wednesday 21 July 2004 05:54 pm, Ron Hunter-Duvar wrote:

 I don't want to run my own mail server (not at the moment). I rely on my
 isp for sending and receiving email.

 Is there a simple way to do this? Can I somehow tell kmail to do it for me?
 If not, can someone point me to some good instructions for configuring
 postfix to do what I need without interfering with email to/from my isp,
 and without opening up security holes in my system (e.g. an open relay).

Look for and install a package called esmtp, that mirrors sendmail 
functionality but doesn't actually work as an MTA itself, it simply relays 
messages to your MTA of choice.  In essence, it provides you with full 
sendmail compatibility for scripts but it only relays messages just as your 
mail client would.

There are a couple of other packages that do the same thing as well but esmtp 
is very simply to setup and configure for what you want it to do.  The only 
drawback is that it won't route local messages to your machine, you have to 
send to fully qualified email addresses because you are are relaying through 
an external server.  IOW, you can't send message to [EMAIL PROTECTED], etc.
-- 
Bryan Phinney



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



[newbie] Sending email from a script

2004-07-21 Thread Ron Hunter-Duvar
Anyone out there ever written a script to send email messages?

I want to write a script that will send a message to a certain email address 
when called. I thought I could just use the mail program, but it relies 
on /usr/sbin/sendmail to actually send the message. I believe that means I 
have to install and configure either sendmail or postfix. Sounds like a lot 
of work for a simple script. 

I don't want to run my own mail server (not at the moment). I rely on my isp 
for sending and receiving email.

Is there a simple way to do this? Can I somehow tell kmail to do it for me? If 
not, can someone point me to some good instructions for configuring postfix 
to do what I need without interfering with email to/from my isp, and without 
opening up security holes in my system (e.g. an open relay). 

Thanks,

-- 
Ron Hunter-Duvar
ronhd at users dot sourceforge dot net

Opinions expressed here are all mine. Rights to use
these opinions are granted under the GNU GPL.


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com



Re: [newbie] Sending email from a script

2004-07-21 Thread Paul
Op Wed, 21 Jul 2004 15:54:27 -0600 schreef Ron Hunter-Duvar:

Anyone out there ever written a script to send email messages?

Is there a simple way to do this? Can I somehow tell kmail to do it for
me? If not, can someone point me to some good instructions for
configuring postfix to do what I need without interfering with email
to/from my isp, and without opening up security holes in my system
(e.g. an open relay). 

Postfix is easy, you can find all info on
www.postfix.org/documentation.html.

The script-way to send mail is through 'mail'. 'mail' is a program. I
think it is always installed with Mandrake, I never had to look for it.

E.g.

cat textfile_with_message | mail
[EMAIL PROTECTED],[EMAIL PROTECTED] -s Here is the
subject

(all in one line)

Another option is the here-document way, if the contents of the mail is
always the same:

mail [EMAIL PROTECTED] -s Subject  @end
This is it.
@end

Everything between the @end directives will be in the body of the
e-mail.

It really is easy as that...

Paul

-- 
Beware of computerized fortune-tellers!

http://www.nlpagan.net/linux.htm
Have you visited http://twiki.mdklinuxfaq.org yet?


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com