- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to parse mail
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2001 11:02 AM
10-27-2001 11:02 AM
Script to parse mail
I am working on a shell script that I would add to my .forward file:
\rui, "|~/bin/mail_parser.sh"
For each incoming mail, it would search for a given pattern (eg. subject). Upon detection of a given pattern, it would perform a given action (eg. send a mail,...).
Any help or suggestion is welcome.
TIA,
Kind Regards,
Rui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2001 11:25 AM
10-27-2001 11:25 AM
Re: Script to parse mail
man procmail
man procmailex
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2001 11:28 AM
10-27-2001 11:28 AM
Re: Script to parse mail
Found it:
http://hpux.tn.tudelft.nl/hppd/hpux/Networking/Mail/procmail-3.21/
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2001 11:33 AM
10-27-2001 11:33 AM
Re: Script to parse mail
Hrm, I should get the good habit to research first and answer after. No more 3 replies in a row then :)
Anyway, this is how it goes with procmail (on my linux at least, but should work the same on HPUX):
I have a .procmailrc file on my homedir. Any email that I get gets filtered by it. An example for subject parsing is (lines from .procmailrc):
:0:
* ^Subject:. pattern
mail/folder_for_pattern
This will save the mail with a certain pattern in their subject in the folder mail/... on my home dir.
You can run certain programs as well in the event that a match occurs (ie send an email, send a SMS, etc).
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 12:18 AM
10-29-2001 12:18 AM
Re: Script to parse mail
I put the following in aliases:
parse: "|/usr/local/bin/parse_mail.sh"
Where /usr/local/bin/parse_mail.sh contains:
=========================================
#!/bin/ksh
while read line ; do
echo $line | grep -i subject && echo "The subject is $line" > /tmp/parse.out
done
==========================================
Sending to "parse" on this machine updated the /tmp/parse.out file.
Rgds, Robin.