Mailexp

Mailsexp is a small command line utility that exports headers of emails in selected IMAP folders into CSV (comma separated value). It has plenty of options to specify what fields should be exported and how it should formated.
If you were ever thinking about doing some analysis of your emails and wated to get emails data into spreadsheet or database, this is the right tool (of course assuming you've got email on server with IMAP access).

Help

mailexp - exports email headers into csv format file from IMAP folder
Usage: mailexp [-h] [-v] [-u user_name] [-p password] [-f folder] [-r search] 
       [-d dialect] [-e encoding] [-h] [-a] [-D fmt_string] -s server 
       [-P port] [-S] [-F field1,field2,...] output_file
       
-u    --user          IMAP user name (default current user)
-p    --password      IMAP password
-s    --server        IMAP server
-P    --port          port (default 143 or 993 if ssl is used)
-f    --folder        folder on the server (default INBOX; wildchar * can 
                      be used to select all matching folders)
-e    --encoding      encoding for output (default us-ascii)
-d    --dialect       csv dialect (excel, excel2, excel-tab ...); default is 
                      excel2
-n    --no-header     do not include header in output
-F    --fields        list of rfc822 header field names (default - 
                      From,To,Cc,Date,Subject), plus there are additional names:
                      Folder - folder, where message is stored
                      Uid - message UID (unique ID within folder)
                      Flags - message flags, separated by comma
                      Internal-date - interal message date from message store
                      Size - message size
-h    --help          prints this help
-v    --verbose       prints various messages
-a    --strip-addr    process email addresses (strips the real name outside 
                      < >, only the pure email address is left)
-D    --date-format   formats the date according to format string 
                      (time.strftime - sample %d.%m.%Y %H:%M:%S)
-S    --ssl           connection over SSL
-r    --search        search criterion for selecting headers in folder
                      (according to IMAP protocol- RFC 2060 - section 6.4.4. 
                       - default is (ALL) )

Download

Get it here: mailexp 1.0.0


Last site update on 30/08/2013