Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit 7d3ad93

Browse files
committed
Create SubEthaExtensions.kt
1 parent 815c14f commit 7d3ad93

File tree

1 file changed

+15
-0
lines changed
  • simplekotlinmail-server/src/jvmMain/kotlin/net/axay/simplekotlinmail/server/utils

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package net.axay.simplekotlinmail.server.utils
2+
3+
import org.subethamail.smtp.MessageContext
4+
import org.subethamail.smtp.server.Session
5+
import javax.net.ssl.SSLSocket
6+
7+
/**
8+
* @return The session. This will probably never be null.
9+
*/
10+
val MessageContext.session get() = (this as? Session)
11+
12+
/**
13+
* @return The [SSLSocket], or null if the socket is not an SSLSocket.
14+
*/
15+
val Session.sslSocket get() = (socket as? SSLSocket)

0 commit comments

Comments
 (0)