Skip to content

Commit

Permalink
fix: context information in postmaster
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Jan 17, 2024
1 parent ed3c5fa commit 2f85ae5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

*
* Context information `tos` in the Postmaster email handling

## [1.19.2] - 2024-01-17

Expand Down
24 changes: 13 additions & 11 deletions src/netius/clients/smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,21 +517,23 @@ def message(
# this should provide some extra information on the agent
if mark: contents = self.mark(contents)

# creates the context object that will be used to pass
# contextual information to the callbacks
context = dict(
froms = froms,
tos = tos,
contents = contents,
mark = mark,
comply = comply,
ensure_loop = ensure_loop
)

# creates the method that is able to generate handler for a
# certain sequence of to based (email) addresses
def build_handler(tos, domain = None, tos_map = None):

# creates the context object that will be used to pass
# contextual information to the callbacks
context = dict(
froms = froms,
tos = tos,
contents = contents,
mark = mark,
comply = comply,
ensure_loop = ensure_loop,
domain = domain,
tos_map = tos_map
)

def on_close(connection = None):
# verifies if the current handler has been build with a
# domain based clojure and if that's the case removes the
Expand Down

0 comments on commit 2f85ae5

Please sign in to comment.