JoshuaJeong / nhin-d

Automatically exported from code.google.com/p/nhin-d
0 stars 0 forks source link

RecipientIsNotXd returning wrong value #119

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
-----Original Message-----
From: Jason Weinstein [mailto:jason.weinstein@oracle.com] 
Sent: Friday, March 25, 2011 8:35 PM
To: Meyer,Greg
Cc: Grantham, Beau
Subject: RecipientIsNotXd returning wrong value

I think i remember seeing a correction on another one of these matchers, 
but same issue below. One would expect recipients to be returned, not 
mail.getRecipients()

RecipientIsNotXd

    public Collection<MailAddress> match(Mail mail) throws 
MessagingException
    {
        LOGGER.info("Attempting to match non-XD recipients");

        Collection<MailAddress> recipients = new ArrayList<MailAddress>();

        for (MailAddress addr : (Collection<MailAddress>) 
mail.getRecipients())
        {
            if (!routingResolver.isXdEndpoint(addr.toString()))
            {
                recipients.add(addr);
            }
        }

        if (recipients.isEmpty())
            LOGGER.info("Matched no recipients");
        else
            for (MailAddress addr : recipients)
                LOGGER.info("Matched recipient " + addr.toString());

        return mail.getRecipients();
    }

And since i just saw it from RecipientIsXdAndNotSMIME

If you don't comment this out Thunderbird client will not be handled 
correctly. Those two cases are used elsewhere.

        if ((message.isMimeType("application/x-pkcs7-mime") || 
message.isMimeType("application/pkcs7-mime"))
                ) { // && 
(StringUtils.contains(message.getContentType(), 
"smime-type=enveloped-data"))) {

Original issue reported on code.google.com by bgran...@harris.com on 28 Mar 2011 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by bgran...@harris.com on 28 Mar 2011 at 6:57

GoogleCodeExporter commented 9 years ago
First issue (recipients) fixed, will push shortly.

Requesting clarification for second issue:
------------------------------------------
Hey Jason,

I fixed the first of the two issues here, thanks for catching it.

I am confused about the second one though. When the Agent encrypts messages, it 
applies a content type of application/pkcs7-mime; smime-type=enveloped-data; 
name="smime.p7m". How is Thunderbird affected by checking this value?

Beau

Original comment by bgran...@harris.com on 29 Mar 2011 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by bgran...@harris.com on 29 Mar 2011 at 8:53

GoogleCodeExporter commented 9 years ago
Second issue caused when SMIME is done outside of agent. Verified that Agent 
does check for SMIME as suggested above. Updated code as per original details.

Will push code today.

Original comment by bgran...@harris.com on 29 Mar 2011 at 9:21