- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Call a script whenever I receive an email
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
Discussions
Discussions
Forums
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
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-22-2009 05:38 AM
тАО10-22-2009 05:38 AM
I am assuming that I would need to modify my /etc/mail/aliases file.
Currently, it looks like this:
brewsted : brewsted@uspsy14ts
I've tried:
brewsted : brewsted@uspsy14ts, /users/brewsted/bin/myscript.ksh
But it doesn't seem to call the script, but I do get an email.
I've also tried:
brewsted : brewsted@uspsy14ts | /users/brewsted/bin/myscript.ksh
But that too yielded the same results.
I am on HP-UX 11.11
Thanks for your help,
Dave
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 05:48 AM
тАО10-22-2009 05:48 AM
Re: Call a script whenever I receive an email
A classic way to handle this is to have a '.forward' file in your ${HOME} directory. The file can look like:
brewsted, |/users/brewsted/bin/myscript.ksh
In this case when you receive a mail the script will be run too.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 06:01 AM
тАО10-22-2009 06:01 AM
Re: Call a script whenever I receive an email
While I work on getting that going...
What I want to do the same kind of thing for a user that is not a user on our mail server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 07:23 AM
тАО10-22-2009 07:23 AM
Re: Call a script whenever I receive an email
Any trick too to only watch for certain SUBJECT strings and SENDER/SOURCE to trigger a script?
Thanks.
David... apologies for hi-jacking this thread.
Favourite Toy:
AMD Athlon II X6 1090T 6-core, 16GB RAM, 12TB ZFS RAIDZ-2 Storage. Linux Centos 5.6 running KVM Hypervisor. Virtual Machines: Ubuntu, Mint, Solaris 10, Windows 7 Professional, Windows XP Pro, Windows Server 2008R2, DOS 6.22, OpenFiler
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 08:32 AM
тАО10-22-2009 08:32 AM
Re: Call a script whenever I receive an email
good email utility script, does attachments.
http://www.hpux.ws/?p=7
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 08:54 AM
тАО10-22-2009 08:54 AM
Solution> What I want to do the same kind of thing for a user that is not a user on our mail server?
I assume by this that you want to also forward email to another server. You could define the 'DS' (smart relay) macro in '/etc/mail/sendmail.cf' like:
DSmymailserver.mycompany.com
Then, in your '.forward' file you might have:
# cat /home/brewsted/.forward
\brewsted,brewsted@youraddress.com,"|/users/brewsted/bin/myscript.ksh"
Notice that a backslash is used if you include your own account as a mail recipient. Notice too that the script to run is enclosed in double quotes. I failed to do that in my first post :-(
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 09:23 AM
тАО10-22-2009 09:23 AM
Re: Call a script whenever I receive an email
I have the following in my /etc/mail/aliases file:
brewsted : brewsted@uspsy14ts, "| /users/tech/jobs/systems/mail_test.ksh"
Works just as I need it to.
I tried a lot of combinations on my own, but the double quotes seem to have been the key.
Thanks for your help!
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2009 09:23 AM
тАО10-22-2009 09:23 AM