in reply to How do i get the messagID - IMAP

If you mean the Message-Id header, you should be able to retrieve it like any other header. I use MAIL::IMAPClient in one of my scripts. Here's an example, taken from my code:
# ($imap is a MAIL::IMAPClient object already connected to the server) $imap->Uid(0); $imap->select('INBOX'); $totalMessages = $imap->message_count(); for my $messageSequenceNumber (1 .. $totalMessages) { my @headerList = ('Message-ID', 'From', 'Subject', 'To', 'Date'); my $headers = $imap->parse_headers($readMessage, @headerList); print "Message-Id is --> $$headers{'Message-ID'}[0])"; }
However, if you're already using other modules I'm sure you can get the value using them. Search the docs to see how to retrieve a specific header's value.