- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- using .forward file to process 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
04-03-2002 06:18 AM
04-03-2002 06:18 AM
Does someone have something already created that would cut off the header info and then uudecode the attachment and save it?
Any ideas would be appreciated.
Thanks !
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2002 09:14 AM
04-03-2002 09:14 AM
SolutionI don't have it installed on my HP server as we do this kind of processing on our Linux box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2002 09:17 AM
04-03-2002 09:17 AM
Re: using .forward file to process mail
You can use procmail to easily do this job for you. You can get it from the HP-UX porting center.
http://hpux.cs.utah.edu/hppd/hpux/Networking/Mail/procmail-3.21/
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2002 11:23 AM
04-03-2002 11:23 AM
Re: using .forward file to process mail
vi /etc/mail/aliases
(add an entry for the new mail address--note: the address is not subject to the 8 character username limit in /etc/passwd)
mynewmailaddess: "| /full/path/to/Script"
If your script needs some options or perhaps additional filters:
mynewmailaddess: "| /usr/bin/tee -a /var/tmp/mymail.log | /full/path/to/Script /my/special/file"
and so on...
Now, most important: these commands *AND* the files and directories they need to access *MUST* be owned by daemon, not root. That's because rmail is normally used to deliver the mail (the Mlocal directive in sendmail.cf) and run as the daemon user.
Once aliases is finished, run the command:
newaliases
(which is identical to sendmail -bi)
and now you can test your setup by sending an email to: mynewmailaddress@mymachine.com
Now, as far as the script goes, the header will always start with From as the first word on the first line. Then header lines (widely varied number and order), followed by one blank line which then defines the beginning of the body of the message.
At this point you will see the beauty of a plain ASCII message (easy to parse, easy to read) and/or the infamous MIME attachments and the wide variety of message types, languages, file types, encoding techniques, etc. To see a plain ASCII message come through:
mailx -sTestMessage mynewmailaddress@mymachine.com < /etc/issue
To see the other side of email, send the message from a PC-based messaging system...
NOTE: There is no way to control who will send email to this address so your script must include validity processing. And unlike cron or shell scripts run at the command line, error messages will have to logged someplace...my preference is to use logger and send the errors to syslog.log (not the errant message, just a note about the sender).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2002 01:56 PM
04-04-2002 01:56 PM
Re: using .forward file to process mail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2005 04:52 AM
07-21-2005 04:52 AM