Extract Message-id from Message Header Grails

I need message-id of an email from message header,What are the ways to extract message id from message Header.I am using grails mail plugin.


The message id is the first element of a mail header. So a way to achieve this is to output the e-mail content in a String and then extract the message-id using a regex (example done in Java but you can do the same using Groovy regex).

    String id;
    String mailToString; 
    Pattern p = Pattern.compile("Message-ID: <(.*)>");
    Matcher m = p.matcher(mailToString);
        id =  m.group();

@Benoit - it dit not work for me.


def inbox = store.getFolder('INBOX')
   println "Message-Id: ${email.messageID}"

did the job perfectly.

The same works also for each Part of a Multipart email.


Need Your Help

fatal error. launching activity in android

java android android-layout android-intent

I want to access Confirmation activity from login activity. i was able to launch confirmation activity when i didn't have login and registration activity. login and registration works perfect without

Razor if-statement inside jQuery append

jquery razor append

I'm trying to use a razor statement inside a jQuery append.