running a script through emailing #2

  • Follow


I wanted to know about some way that will enable me to run a script by
sending an email to the unix system (maybe admin).

Help appreciated.

Thanks
--
Zia




0
Reply zmulla (6) 11/3/2004 6:25:38 AM

Zia Mulla (zmulla@cisco.com) wrote:
: 
: I wanted to know about some way that will enable me to run a script by
: sending an email to the unix system (maybe admin).
: 
: Help appreciated.
: 
: Thanks
: --
: Zia
: 

You could use a command-line mailer like cwsmail, whose arguments are:

  1. smtp-host
  2. email address of sender; e.g. from-user@host
  3. email address of recipient; e.g. to-user@host
  4. file (optional)

The source and a Win32 executable are available:

  ftp://cleo.rice.edu/pub/cwsmail.c
  ftp://cleo.rice.edu/pub/cwsmail.exe

Here's how to compile it on Windows, along with a sample execution,
with the line wrapped for readability:

  c:\> cl -DWIN32 cwsmail.c wsock32.lib
  c:\> cwsmail moe.rice.edu sandmann@cleo.rice.edu leslie@cleo.rice.edu
        message.txt

It also works on unix and OpenVMS (with the SMTP service enabled in 
one of the three VMS TCP/IP stacks). 

--Jerry Leslie
  Note: leslie@jrlvax.houston.rr.com is invalid for email
0
Reply LESLIE 11/3/2004 6:37:36 AM


in article Q0%hd.54084$186.6410@fe1.texas.rr.com, leslie at
LESLIE@JRLVAX.HOUSTON.RR.COM wrote on 11/2/04 10:37 PM:

> Zia Mulla (zmulla@cisco.com) wrote:
> : 
> : I wanted to know about some way that will enable me to run a script by
> : sending an email to the unix system (maybe admin).
> : 
> : Help appreciated.
> : 
> : Thanks
> : --
> : Zia
> : 
> 
> You could use a command-line mailer like cwsmail, whose arguments are:
> 
>   1. smtp-host
>   2. email address of sender; e.g. from-user@host
>   3. email address of recipient; e.g. to-user@host
>   4. file (optional)
> 
> The source and a Win32 executable are available:
> 
>   ftp://cleo.rice.edu/pub/cwsmail.c
>   ftp://cleo.rice.edu/pub/cwsmail.exe
> 
> Here's how to compile it on Windows, along with a sample execution,
> with the line wrapped for readability:
> 
>   c:\> cl -DWIN32 cwsmail.c wsock32.lib
>   c:\> cwsmail moe.rice.edu sandmann@cleo.rice.edu leslie@cleo.rice.edu
>         message.txt
> 
> It also works on unix and OpenVMS (with the SMTP service enabled in
> one of the three VMS TCP/IP stacks).
> 
> --Jerry Leslie
>   Note: leslie@jrlvax.houston.rr.com is invalid for email

None of this is relevant to the OP's question, which is how to trigger the
execution of a script with an e-mail.

See http://www.procmail.org/ 

0
Reply ps 11/3/2004 7:05:08 AM

Hello Zia,

ps wrote:
>>Zia Mulla (zmulla@cisco.com) wrote:
>>: 
>>: I wanted to know about some way that will enable me to run a script by
>>: sending an email to the unix system (maybe admin).
>>: 
>>: Help appreciated.
>>: 
>>: Thanks
>>: --
>>: Zia
>>: 
<SNIP>

> None of this is relevant to the OP's question, which is how to trigger the
> execution of a script with an e-mail.
> 
> See http://www.procmail.org/ 
> 

Additionally you could also set-up an E-mail alias which is piped to a 
shell script. See [0] for a sendmail-specific description of this process.

However, just a word of warning: You should be very careful with this, 
having an alias execute a script simply on receipt of an E-mail bypasses 
  the User Authorisation usually associated with running a script. Just 
something to be aware of.

I hope this helps.

Kind Regards,

Nathan Dietsch

[0]http://www.unix.org.ua/orelly/networking/sendmail/ch24_02.htm

0
Reply Nathan 11/3/2004 8:49:21 AM

3 Replies
219 Views

(page loaded in 8.179 seconds)

Similiar Articles:













7/15/2012 9:38:36 PM


Reply: