[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-11-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16701526#comment-16701526
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user chiominto78 commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r236981465
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

Can someone please contact me at chiomintojames1...@gmail.com




> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-11-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16701527#comment-16701527
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user chiominto78 commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r236981473
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

Can someone please contact me at chiomintojames1...@gmail.com




> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16353305#comment-16353305
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user randymo commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r166178863
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

Yes, this should work.


> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16353273#comment-16353273
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user chibenwa commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r166176208
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

Hi @randymo.

I understand your needs, and I understand current code do not allow to 
satisfy it.

In this discussion, people are trying to bring additional flexibility to 
classes using inheritance, which sounds like a bad idea. I know this area of 
the code is a bit "old school". But maybe we can give a try to do this well by 
composition.

I would propose to add a new **interface** : 

```
public interface EncryptionProvider {
enum EncryptionMode {
None,
StartTls,
Ssl
}

class KeystoreInformation { // Name could be improved?
private final String keystoreLocation;
private final char[] secret;
private final String algorithm;

// ... Boiler plate
}

Encryption get(EncryptionMode encryptionMode, KeystoreInformation 
keystoreInformation);
}
```
We can then have the 'standard' implementation of it being a lazy provider 
around the current version of `buildSSLContext`.

Then, **AbstractConfigurableAsyncServer** could use this interface in its 
`init` method. We would have removed the burdon of managing SSL from this 
already huge class while enabling you to pass **your** SSL logic.

It also brings in the possibility to store the keystore in a database. Or 
to generate a fake one for testing/ demonstration/ quick-start purposes.

Would that sound like a good idea?




> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16352766#comment-16352766
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user randymo commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r166073290
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

the buildSSLContext() needs to be able to set the Encryption, without a way 
to set that field (protected or with setter), the overriding class would need 
to hold that variable to return it, and you would have to override the 
getEncryption(). I was thinking that getEncryption() would just need to be 
overridden in rare cases and the overridden buildSSLContext() would be the 
usual way of doing it.


> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16352598#comment-16352598
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user rouazana commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r166021895
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

I dont't think a setter is needed. Just the overloading implementation can 
overload the getEncryption method().


> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16352466#comment-16352466
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user randymo commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r165990120
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

true, I made it protected, mostly because that is what I did in my testing, 
but we could make it private, but would have to add a setter in that case as 
there is not one currently


> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16352413#comment-16352413
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

Github user rouazana commented on a diff in the pull request:

https://github.com/apache/james-project/pull/103#discussion_r165979538
  
--- Diff: 
server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
 ---
@@ -104,7 +104,7 @@
 
 private String secret;
 
-private Encryption encryption;
+protected Encryption encryption;
--- End diff --

hi, thank you for your contribution.
Just one question for me: if you ensure to call getEncryption instead of 
direct access to encryption (what you seem to have done), you don't need to 
change the visibility of this field, no?


> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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



[jira] [Commented] (JAMES-2330) Give ability to override AbstractConfigurableAsyncServer.buildSSLContext

2018-02-02 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-2330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16351134#comment-16351134
 ] 

ASF GitHub Bot commented on JAMES-2330:
---

GitHub user randymo opened a pull request:

https://github.com/apache/james-project/pull/103

randymo-JAMES-2330



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/randymo/james-project master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/james-project/pull/103.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #103


commit cfa4faf101db03f3bdd2054c30044eb20b8aae42
Author: Randal Modowski <32932331+randymo@...>
Date:   2017-11-06T17:11:28Z

Merge pull request #1 from apache/master

merge with main

commit 7c29a9ef06b1748ba043441d254fce6f283693f9
Author: Randal Modowski <32932331+randymo@...>
Date:   2017-11-14T20:52:42Z

Merge pull request #2 from apache/master

merging with main master

commit e30bb73eface9579c99da3a685dcff6199b8a889
Author: Randal Modowski 
Date:   2018-02-03T00:27:25Z

Merge branch 'master' of https://github.com/apache/james-project

commit 3a498558cf6f0361bbeea15d3113df4aa02c4c51
Author: randymo 
Date:   2018-02-03T00:48:43Z

JAMES-2330: Give ability to override 
AbstractConfigurableAsyncServer.buildSSLContext




> Give ability to override AbstractConfigurableAsyncServer.buildSSLContext
> 
>
> Key: JAMES-2330
> URL: https://issues.apache.org/jira/browse/JAMES-2330
> Project: James Server
>  Issue Type: Bug
>  Components: SMTPServer
>Affects Versions: 3.0.1
>Reporter: Randal Modowski
>Priority: Major
>  Labels: easyfix
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I was trying to have my smtp server be able to serve different certs to user 
> based on remote ip, but couldn't the way james is curretly.
> I am creating a PR to make buildSSLContext protect as well as the Encryption 
> field itself. Also making all reference to Encryption use the getEncryption() 
> in case someone wants to override that call as well.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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