-   Programming (
-   -   delete mail via shell script (

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.

--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: 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 12:06 PM.