procmail
[Top] [All Lists]

Re: Sending command output via mail

1995-11-08 14:01:06
sendlist: "|ls /etc | /usr/local/bin/procmail -f automailer -d"
This will send the output of the ls command when I mail it, but I 
cannot 
see any header information (i.e., the to, from and subject lines are
 blank) 
in my Windows based e-mail program (Pronto/IP).  I can, however, view 
the
 
to and from fields in mailx.  
 
I think the problem is that you are piping the incoming mail into "ls
/etc" which is throwing away the mail, giving a directory listing to
procmail which has no idea what to do with it, since procmail expects a
mail message.  If you want to just send back a mail with the contents of
/etc to the originator you'll need to put the "ls /etc" in the
procmailrc (that is, automailer). 

Have I misunderstood what you want to do?


Ultimately, what I wish to do is to set up a number of aliases in my 
sendmail aliases file that perform commands.  Some examples:

1) If someone from the outside world sends a message to 
info(_at_)appgeo(_dot_)com, I 
would like to have sendmail/procmail automatically send the person who 
mailed us a "canned" message.

2) If one of our employees in Mexico want to know what the weather is like 
here in Boston, they would send an e-mail message to 
weather(_at_)appgeo(_dot_)com and 
sendmail/procmail would send the output of our weather command to them 
without any human interaction.

3) I would like to set up various system administrative aliases that will 
mail me the output of commands (without me having to start up my X-window 
emulator).


        I think my main problem is that I don't fully understand what 
procmail does.  If these commands are listed in a procmailrc file, then 
where should the file reside?  Is this file applicable to anyone 
in the world e-mailing these commands (e.g. "weather(_at_)appgeo(_dot_)com")?  
Also, 
why is it that the output of the previously mentioned "ls" command get's 
mailed, but TO:, FROM:, and SUBJ: fields are blank in all mail readers 
except for "mailx"?


Tech info:  I'm running a DEC Alpha 3000/400 under OSF/1 3.0 (Digital 
Unix).


Thank you for responding and I greatly appreciate your patience with my 
ignorance of "procmail".



Phil Johnson                    (V): 617-367-8626
Systems Administrator           (F): 617-367-8581
Applied Geographics             e-mail: pj(_at_)appgeo(_dot_)com
33 Broad St. Boston, MA 02109   http://www.appgeo.com/~agi1/agitop.htm

<Prev in Thread] Current Thread [Next in Thread>