build_ldif.pl accepts the name of a target folder as an argument. It then opens that folder and rummages through all the mail files in it, looking for "Reply-to:" headers (or "From:" headers, where there is no "Reply-to:"). It then prints to STDOUT a file in ldif format containing entries for all of the addresses that it finds. It also appends a message into the specified folder containing all of the addresses in both the To: field of the message header and in an LDIF-format attachment.
build_ldif.pl requires MIME::Lite.
build_ldif.pl -h
build_ldif.pl -s servername -u username -p password -f folder [ -d ]
NOTE: You can supply defaults for the above options by updating the script.
David J. Kernen
The Kernen Group, Inc.
imap@kernengroup.com
This example and Mail::IMAPClient are Copyright (c) 1999,2003 by The Kernen Group, Inc. All rights reserved.
This example is distributed with Mail::IMAPClient and subject to the same licensing requirements as Mail::IMAPClient.
imtest is a utility distributed with Cyrus IMAP server, Copyright (c) 1994-2000 Carnegie Mellon University. All rights reserved.
To install Mail::IMAPClient, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mail::IMAPClient
CPAN shell
perl -MCPAN -e shell install Mail::IMAPClient
For more information on module installation, please visit the detailed CPAN module installation guide.