Skip to content

Commit

Permalink
Better error handling, configuration hotfix (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazet authored Jan 9, 2024
1 parent f6923f1 commit d871043
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
19 changes: 14 additions & 5 deletions app/src/scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,11 +537,20 @@ def scan_dkim(
if opendkim_valid and dkim_implementation_mismatch_callback:
dkim_implementation_mismatch_callback(message, False, opendkim_valid)

return DKIMScanResult(
valid=False,
errors=[e.args[0]],
warnings=[],
)
if e.args[0]:
return DKIMScanResult(
valid=False,
errors=[e.args[0]],
warnings=[],
)
else:
LOGGER.exception("Error during DKIM signature validation")

return DKIMScanResult(
valid=False,
errors=["An unknown error occured during DKIM signature validation."],
warnings=[],
)


def scan(
Expand Down
4 changes: 4 additions & 0 deletions app/src/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@
"h= tag not permitted in ARC-Seal header field",
"Tag h= nie jest dozwolony w nagłówku ARC-Seal.",
),
(
"An unknown error occured during DKIM signature validation.",
"Wystąpił nieznany błąd podczas walidacji podpisu DKIM.",
),
]
}

Expand Down
2 changes: 1 addition & 1 deletion common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Network:
"1. to mount it into your Docker container,\n"
"2. to restart the containers if a new one is generated,\n"
"3. that generated certificates may be symbolic links - their destination must also be mounted.\n\n",
] = decouple.config("SSL_PRIVATE_KEY_PATH", default=None)
] = decouple.config("SSL_CERTIFICATE_PATH", default=None)

class UI:
LANGUAGE: Annotated[
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ services:
dockerfile: mail_receiver/Dockerfile
command: python3 /opt/server.py
environment:
DB_URL: postgresql+psycopg2://postgres:postgres@db:5432/mailgoose
REDIS_URL: redis://redis:6379/0
env_file:
- .env
volumes:
# Mounting the whole /etc/letsencrypt as the key may be a link to ../../archive/
- /etc/letsencrypt/:/etc/letsencrypt:ro
ports:
- 25:25
- 587:587
Expand Down

0 comments on commit d871043

Please sign in to comment.