On Mon, Feb 16, 2015, Nux! wrote:
http://sourceforge.net/projects/imaputils/files/ ?
I guess you'll at least need to download and parse the email headers.
I do this sort of thing with Python and its 'imaplib'
Something like this will return a list of all unseen messages in the security folder where Subject contains 'Sec-Blocked'.
import imaplib conn = imaplib.IMAP4('example.com') c, d = conn.login('username', 'password') c, n = conn.select('INBOX.security') c, s = conn.uid('search', None, '(UNSEEN HEADER SUBJECT Sec-Blocked)') msgnumbers = s[0].split() unseenUIDs = set(msgnumbers) # using set for later manipulations for uid in sorted(unseenUIDs) # do something for each uid
# done
HTH Lucian
-- Sent from the Delta quadrant using Borg technology!
Nux! www.nux.ro
----- Original Message -----
From: "Tim Evans" tkevans@tkevans.com To: "CentOS mailing list" centos@centos.org Sent: Monday, 16 February, 2015 18:50:31 Subject: [CentOS] OT: Extracting Subject Lines from IMAP Mailbox
Looking for a command-line way to extract only the Subject lines from my mailbox on my ISP's IMAP server, without actually downloading/modifying the contents of the mailbox. Sort of the remote equivalent of locally doing:
$ grep ^Subject /var/spool/mail/mymailbox > subjectlistfile
Thanks.
Tim Evans | 5 Chestnut Court UNIX System Admin Consulting | Owings Mills, MD 21117 http://www.tkevans.com/ | 443-394-3864 tkevans@tkevans.com _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos