We are in need of a PERL Script that can efficiently extract various email addresses from thousands of bounced emails in a recursive directory structure.
Ideally, the script would function in a manner similar to this:
1. Input the desired starting directory (default is the current directory)
2. Have a switch for turning recursive directory searching on or off (on by default)
3. Return the results to a file as either a comma separated or tab delimited list (comma separated by default)
4. The returned file name should be customizable (default is [url removed, login to view])
5. The location of the returned file can optionally be specified (default is the same as the starting directory above)
6. The returned file should be cleared of duplicate entries
7. The script should only return one email address per file (because of it's intended usage). HINT: We need the email addresses that FAILED, NOT the postmaster address sending the bounce notice nor email addresses that may have simply been delayed (fatal errors only)!
8. The script must work under Perl 5 in a Windows environment
I have attached a small sampling of the vairous bounce notices (a mixed bag) to help specify how our system is returning the notices.