You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Ben Aldrich (JIRA)" <ji...@apache.org> on 2010/09/09 22:36:32 UTC

[jira] Created: (JDKIM-20) jdkim will throw unexpected exceptions

jdkim will throw unexpected exceptions
--------------------------------------

                 Key: JDKIM-20
                 URL: https://issues.apache.org/jira/browse/JDKIM-20
             Project: JAMES jDKIM
          Issue Type: Bug
         Environment: java version "1.6.0_18" ubuntu 10.04
            Reporter: Ben Aldrich


when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 

It looks like we just need to catch these exceptions in the DKIMVerifier.java

more specifically, in the verify method we need to add this around line 270 :
                    } catch (IllegalArgumentException e) {
                        throw new PermFailException(e.getMessage());

and we should also add this in the signatureVerify method:
        try {
          signature.initVerify(key.getPublicKey());
        } catch (IllegalStateException e) {
            throw new PermFailException(e.getMessage());
        }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908560#action_12908560 ] 

Stefano Bagnara commented on JDKIM-20:
--------------------------------------

Hi Ben,

thank you for reporting the issue. Can you provide a couple of sample mail so that I can add them to the test suite as a proof of the bug & bugfix?

Otherwise a full stack trace for the 2 conditions would help understanding what the "condition" is and how to synthetize a couple of messages to prove that.

Stefano

> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Ben Aldrich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Aldrich updated JDKIM-20:
-----------------------------

    Attachment: illegalargumentexception.txt

This is a file in mbox format that causes the illegal argument exception. This file came from our production mail feed. I will have to dig around a little more to find a mail file that causes the illegal state exception. 

> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>         Attachments: illegalargumentexception.txt
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Closed: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Ben Aldrich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Aldrich closed JDKIM-20.
----------------------------


Thanks! We have started to use the jdkim library against our production mail stream, I will let you know if I see any other issues. I really appreciate your hard work.

-Ben 

> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>            Assignee: Stefano Bagnara
>             Fix For: 0.2
>
>         Attachments: illegalargumentexception.txt
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Updated: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Ben Aldrich (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Aldrich updated JDKIM-20:
-----------------------------

    Affects Version/s: 0.2
                       1.0
          Component/s: library

> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Assigned: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara reassigned JDKIM-20:
------------------------------------

    Assignee: Stefano Bagnara

> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>            Assignee: Stefano Bagnara
>         Attachments: illegalargumentexception.txt
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Commented: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908969#action_12908969 ] 

Stefano Bagnara commented on JDKIM-20:
--------------------------------------

I added a catch for the IllegalArgumentException by throwing a PermError with a meaningful error. Added a sample synthetical message to the test suite (the issue was with unencoded "=" in the value of "i=" parameter).

Also I verified an IllegalStateException while parsing the remote Public Key. I added a similar try/catch to the signatureVerify method, as you suggested.


> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>            Assignee: Stefano Bagnara
>             Fix For: 0.2
>
>         Attachments: illegalargumentexception.txt
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


[jira] Resolved: (JDKIM-20) jdkim will throw unexpected exceptions

Posted by "Stefano Bagnara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDKIM-20?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefano Bagnara resolved JDKIM-20.
----------------------------------

    Fix Version/s: 0.2
       Resolution: Fixed

> jdkim will throw unexpected exceptions
> --------------------------------------
>
>                 Key: JDKIM-20
>                 URL: https://issues.apache.org/jira/browse/JDKIM-20
>             Project: JAMES jDKIM
>          Issue Type: Bug
>          Components: library
>    Affects Versions: 0.2, 1.0
>         Environment: java version "1.6.0_18" ubuntu 10.04
>            Reporter: Ben Aldrich
>            Assignee: Stefano Bagnara
>             Fix For: 0.2
>
>         Attachments: illegalargumentexception.txt
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> when calling validate I am seeing IllegalStateExceptions and IllegalArgumentException. 
> It looks like we just need to catch these exceptions in the DKIMVerifier.java
> more specifically, in the verify method we need to add this around line 270 :
>                     } catch (IllegalArgumentException e) {
>                         throw new PermFailException(e.getMessage());
> and we should also add this in the signatureVerify method:
>         try {
>           signature.initVerify(key.getPublicKey());
>         } catch (IllegalStateException e) {
>             throw new PermFailException(e.getMessage());
>         }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org