Skip to content

Commit b26c7b4

Browse files
committed
Update readme with experimental new plugins feature (see branch)
Also remove unnecessarily duplicated logging
1 parent 3379ece commit b26c7b4

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ A similar issue may occur on Windows with the [pythonnet](https://github.com/pyt
8989
Please feel free to [open an issue](https://github.com/simonrob/email-oauth2-proxy/issues) reporting any bugs you find, or [submit a pull request](https://github.com/simonrob/email-oauth2-proxy/pulls) to help improve this tool.
9090

9191

92+
## Advanced / experimental features
93+
The [plugins branch](https://github.com/simonrob/email-oauth2-proxy/tree/plugins) has a semi-experimental new feature that enables the use of separate scripts to modify IMAP/SMTP commands when they are received from the client or server before passing through to the other side of the connection. This allows a wide range of additional capabilities or triggers to be added the proxy. For example, the [IMAPIgnoreSentMessageUpload plugin](https://github.com/simonrob/email-oauth2-proxy/blob/plugins/plugins/IMAPIgnoreSentMessageUpload.py) intercepts any client commands to add emails to the IMAP sent messages mailbox, which resolves message duplication issues for servers that automatically do this when emails are received via SMTP (e.g., Office 365, Gmail, etc). See the documentation and examples in this branch for further details and setup instructions.
94+
95+
9296
## Potential improvements (pull requests welcome)
9397
- Switch to asyncio (asyncore is currently deprecated, but [PEP 594](https://peps.python.org/pep-0594/) will remove it completely in Python 3.12)
9498
- Full feature parity on different platforms (e.g., live menu updating; monitoring network status)

emailproxy.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,7 @@ def process_data(self, byte_data, censor_server_log=False):
621621
self.server_connection.send(byte_data, censor_log=censor_server_log) # just send everything straight to server
622622

623623
def send(self, byte_data):
624-
if not self.authenticated: # after authentication these are identical to server-side logs (in process_data)
625-
Log.debug(self.proxy_type, self.connection_info, '<--', byte_data)
624+
Log.debug(self.proxy_type, self.connection_info, '<--', byte_data)
626625
try:
627626
super().send(byte_data)
628627
except (ssl.SSLWantReadError, ssl.SSLWantWriteError) as e: # only relevant when using local certificates
@@ -877,8 +876,6 @@ def handle_read(self):
877876

878877
def process_data(self, byte_data):
879878
self.client_connection.send(byte_data) # by default we just send everything straight to the client
880-
if self.client_connection.authenticated:
881-
Log.debug(self.proxy_type, self.connection_info, '<--', byte_data) # command after any editing/interception
882879

883880
def send(self, byte_data, censor_log=False):
884881
if not self.client_connection.authenticated: # after authentication these are identical to server-side logs

0 commit comments

Comments
 (0)