28 Oct 2011 02:58
Querying a DB to determine destination mailbox for an email using Procmail
Komal Tagdiwala (ktagdiwa <ktagdiwa <at> cisco.com>
2011-10-28 00:58:13 GMT
2011-10-28 00:58:13 GMT
Requirement: I need to devise a solution where a procmail script can dynamically determine the final destination mailbox by querying a database for a particular keyword to get the corresponding mailbox. Approach I have in mind: Based on my knowledge of procmail so far, I envision the following steps but wanted some expert opinion on finding the right approach. 1. Use a database to maintain a key/value pair type information for a keyword and a corresponding mailbox name. This information may be maintained manually or using a custom application (outside of procmail). 2. Write a Perl script which takes an input parameter from procmail (I have not done this before but I believe procmail can call a Perl script and just pass an argument in the call). 3. The Perl script performs the actual query to database for a given keyword to find the corresponding mailbox name. 4. The script then returns the mailbox name to the procmail script/recipe that invoked the Perl script. 5. The procmail recipe then directs that email (which had the keyword) to its intended mailbox (which was dynamically determined using the query executed by the PERL script). Is the above approach an appropriate way to implement the requirement outlined at the beginning of this email? If yes, are there any conditions that I missed in my approach that I need to be mindful of before beginning research and development for this solution using this approach? If no, can you suggest an alternate way of achieving this requirement? Thanks and regards, Komal ------------------------------------------------------------------------------------------------------------------------------------------------------------------ Komal Tagdiwala | IT Engineer | Cisco Systems, Inc.| Contact Center Applications & Technologies 400 E Tasman Dr | SJC 12/3 | San Jose, CA 95134 | ktagdiwa <at> cisco.com | Office: (408)527-2163 ------------------------------------------------------------------------------------------------------------------------------------------------------------------(Continue reading)
RSS Feed