LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   delete mail via shell script (http://www.linuxquestions.org/questions/programming-9/delete-mail-via-shell-script-391007/)

kevin_obtiva 12-09-2005 03:28 PM

delete mail via shell script
 
I have a cron job on a Solaris box that uses mailx to list the mail headers and checks for a specific email header. Then, it is supposed to delete that email. Does anyone know a way to delete an email via a shell script? I would prefer to avoid parsing the mail file in /var/spool and would prefer to use mailx or another email client to script this.

TIA.
--Kevin Taylor

taylor_venable 12-10-2005 09:24 AM

The Power of TCL
 
If you're familiar at all with TCL, Expect would be a good idea: http://expect.nist.gov/ From the webpage, "Expect is a tool for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial." I believe some languages, like Python, may also provide wrappers around Expect methods.


All times are GMT -5. The time now is 06:08 AM.