- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- procmailrc script challenge
Operating System - HP-UX
1821051
Members
2763
Online
109631
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
06-04-2008 05:49 AM
06-04-2008 05:49 AM
Hi everyone,
Is anyone out there in HP Forumsland really good at constructing .procmailrc recipes?
For several years now, we've used procmail to redirect "bounceback" messages to certain folks in our company. We use SAP, and when our [custom] SAP programming wants to email something, from sendmail's perspective, it's always "authored" by the SAP administrative user -- as opposed to the individual SAP user.
Therefore, it doesn't matter if Bob, Sally, or Frank send out an emailed purchase order. It all appears as if the single "sapadmin" user sent it out. If Bob, Sally, or Frank send something to "this_is_a_bad_address@nothere.com", that email will be undeliverable and thus it's sent back to the "sapadmin" user.
Our procmailrc script (in "sapadmin"'s home directory) receives the undeliverable message, and it looks at the Subject line to figure out to whom to forward the undeliverable message. If the subject line contains "Purchase Order: 12345", for example, our procmailrc script knows to forward this message back to Bob.
Whoops! What if Bob didn't send this email? Well, he's going to get it anyway.
Here's a section of our current procmailrc script:
-----------------------------------
:0 B
* ^Subject: Account Statement as of
! guy_in_credit_department@mycompany.com
:0 B
* ^Subject: Purchase Order
! lady_in_purchasing@mycompany.com
:0
! sysadms
-----------------------------------
So... after a while... Bob eventually gets ticked off that he's the recipient of one of his colleague's bad input of a customer's address. He might just ignore these forwarded undeliverable messages to him... and thus, the underlying problem is never resolved.
Here's what we'd like to occur. When our SAP programming constructs the body of the message (or maybe even in the headers of the message), we'll include the SAP user's name, such as:
X-sap-user: Sally
And then we'd like procmail, upon receiving an undeliverable message that Bob sent, to find this X-sap-user line (in either the header or body) and then cause the message to be forwarded to the X-sap-user name + "@mycompany.com". In the example above, it would be forwarded to Sally@mycompany.com.
Anybody know how to do something like that? :-)
Thanks,
~Fred
Is anyone out there in HP Forumsland really good at constructing .procmailrc recipes?
For several years now, we've used procmail to redirect "bounceback" messages to certain folks in our company. We use SAP, and when our [custom] SAP programming wants to email something, from sendmail's perspective, it's always "authored" by the SAP administrative user -- as opposed to the individual SAP user.
Therefore, it doesn't matter if Bob, Sally, or Frank send out an emailed purchase order. It all appears as if the single "sapadmin" user sent it out. If Bob, Sally, or Frank send something to "this_is_a_bad_address@nothere.com", that email will be undeliverable and thus it's sent back to the "sapadmin" user.
Our procmailrc script (in "sapadmin"'s home directory) receives the undeliverable message, and it looks at the Subject line to figure out to whom to forward the undeliverable message. If the subject line contains "Purchase Order: 12345", for example, our procmailrc script knows to forward this message back to Bob.
Whoops! What if Bob didn't send this email? Well, he's going to get it anyway.
Here's a section of our current procmailrc script:
-----------------------------------
:0 B
* ^Subject: Account Statement as of
! guy_in_credit_department@mycompany.com
:0 B
* ^Subject: Purchase Order
! lady_in_purchasing@mycompany.com
:0
! sysadms
-----------------------------------
So... after a while... Bob eventually gets ticked off that he's the recipient of one of his colleague's bad input of a customer's address. He might just ignore these forwarded undeliverable messages to him... and thus, the underlying problem is never resolved.
Here's what we'd like to occur. When our SAP programming constructs the body of the message (or maybe even in the headers of the message), we'll include the SAP user's name, such as:
X-sap-user: Sally
And then we'd like procmail, upon receiving an undeliverable message that Bob sent, to find this X-sap-user line (in either the header or body) and then cause the message to be forwarded to the X-sap-user name + "@mycompany.com". In the example above, it would be forwarded to Sally@mycompany.com.
Anybody know how to do something like that? :-)
Thanks,
~Fred
Experience gained while correcting a previous mistake is the best teacher imaginable!
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2008 09:25 AM
06-04-2008 09:25 AM
Solution
The easy way is to pipe the message to a script that extracts/replaces the appropriate fields instead of trying to do it all inside procmail.
The hard way is to use \/ and $MATCH. I think something like "* ^X-sap-user: +\/[^ ]+" for your expression would put the field's value in $MATCH, but I'd have to play with it some.
The correct way is to have your SAP program set the sender appropriately when it generates a message so that procmail doesn't have to do anything.
The hard way is to use \/ and $MATCH. I think something like "* ^X-sap-user: +\/[^ ]+" for your expression would put the field's value in $MATCH, but I'd have to play with it some.
The correct way is to have your SAP program set the sender appropriately when it generates a message so that procmail doesn't have to do anything.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP