mirror of
https://github.com/domainaware/parsedmarc.git
synced 2026-02-19 16:06:22 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
976a3274e6 | ||
|
|
bb722e651a | ||
|
|
ab280d7a34 | ||
|
|
92b12eaacf | ||
|
|
8444053476 |
7
.github/workflows/python-tests.yml
vendored
7
.github/workflows/python-tests.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
pip install .[build]
|
||||
- name: Test building documentation
|
||||
run: |
|
||||
cd docs
|
||||
@@ -49,8 +49,7 @@ jobs:
|
||||
ruff check .
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
coverage run tests.py
|
||||
coverage json
|
||||
pytest --cov --cov-report=xml tests.py
|
||||
- name: Test sample DMARC reports
|
||||
run: |
|
||||
pip install -e .
|
||||
@@ -61,3 +60,5 @@ jobs:
|
||||
hatch build
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
8.15.2
|
||||
------
|
||||
|
||||
- Require `mailsuite>=1.9.18`
|
||||
- Pins `mail-parser` version at `3.15.0` due to a parsing regression in mail-parser `4.0.0`
|
||||
- Parse aggregate reports with empty `<auth_results>`
|
||||
- Do not overwrite the log on each run (PR #569 fixes issue #565)
|
||||
|
||||
8.15.1
|
||||
------
|
||||
|
||||
|
||||
31
Dockerfile
31
Dockerfile
@@ -1,12 +1,35 @@
|
||||
FROM python:3.9-slim
|
||||
ARG BASE_IMAGE=python:3.9-slim
|
||||
ARG USERNAME=parsedmarc
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
## build
|
||||
|
||||
FROM $BASE_IMAGE AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip install hatch
|
||||
|
||||
COPY parsedmarc/ parsedmarc/
|
||||
COPY README.md pyproject.toml ./
|
||||
|
||||
RUN pip install -U pip
|
||||
RUN pip install hatch
|
||||
RUN hatch build
|
||||
RUN pip install dist/*.whl
|
||||
|
||||
## image
|
||||
|
||||
FROM $BASE_IMAGE
|
||||
ARG USERNAME
|
||||
ARG USER_UID
|
||||
ARG USER_GID
|
||||
|
||||
COPY --from=build /app/dist/*.whl /tmp/dist/
|
||||
RUN set -ex; \
|
||||
groupadd --gid ${USER_GID} ${USERNAME}; \
|
||||
useradd --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME}; \
|
||||
pip install /tmp/dist/*.whl; \
|
||||
rm -rf /tmp/dist
|
||||
|
||||
USER $USERNAME
|
||||
|
||||
ENTRYPOINT ["parsedmarc"]
|
||||
|
||||
2
build.sh
2
build.sh
@@ -7,7 +7,7 @@ if [ ! -d "venv" ]; then
|
||||
fi
|
||||
|
||||
. venv/bin/activate
|
||||
pip install -U -r requirements.txt
|
||||
pip install .[build]
|
||||
ruff format .
|
||||
cd docs
|
||||
make clean
|
||||
|
||||
@@ -34,7 +34,7 @@ from parsedmarc.utils import is_outlook_msg, convert_outlook_msg
|
||||
from parsedmarc.utils import parse_email
|
||||
from parsedmarc.utils import timestamp_to_human, human_timestamp_to_datetime
|
||||
|
||||
__version__ = "8.15.1"
|
||||
__version__ = "8.15.2"
|
||||
|
||||
logger.debug("parsedmarc v{0}".format(__version__))
|
||||
|
||||
@@ -169,7 +169,7 @@ def _parse_report_record(
|
||||
else:
|
||||
lowered_from = ""
|
||||
new_record["identifiers"]["header_from"] = lowered_from
|
||||
if record["auth_results"] is not None:
|
||||
if isinstance(record["auth_results"], dict):
|
||||
auth_results = record["auth_results"].copy()
|
||||
if "spf" not in auth_results:
|
||||
auth_results["spf"] = []
|
||||
|
||||
@@ -1179,9 +1179,7 @@ def _main():
|
||||
logger.setLevel(logging.DEBUG)
|
||||
if opts.log_file:
|
||||
try:
|
||||
log_file = open(opts.log_file, "w")
|
||||
log_file.close()
|
||||
fh = logging.FileHandler(opts.log_file)
|
||||
fh = logging.FileHandler(opts.log_file, "a")
|
||||
formatter = logging.Formatter(
|
||||
"%(asctime)s - "
|
||||
"%(levelname)s - [%(filename)s:%(lineno)d] - %(message)s"
|
||||
|
||||
@@ -46,15 +46,27 @@ dependencies = [
|
||||
"imapclient>=2.1.0",
|
||||
"kafka-python-ng>=2.2.2",
|
||||
"lxml>=4.4.0",
|
||||
"mailsuite>=1.9.17",
|
||||
"mailsuite>=1.9.18",
|
||||
"msgraph-core==0.2.2",
|
||||
"opensearch-py>=2.4.2,<=3.0.0",
|
||||
"publicsuffixlist>=0.10.0",
|
||||
"pygelf>=0.4.2",
|
||||
"requests>=2.22.0",
|
||||
"tqdm>=4.31.1",
|
||||
"urllib3>=1.25.7",
|
||||
"xmltodict>=0.12.0",
|
||||
"pygelf>=0.4.2",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
build = [
|
||||
"hatch",
|
||||
"myst-parser[linkify]",
|
||||
"nose",
|
||||
"pytest",
|
||||
"pytest-cov",
|
||||
"ruff",
|
||||
"sphinx",
|
||||
"sphinx_rtd_theme",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
tqdm>=4.31.1
|
||||
pygments>=2.11.1
|
||||
dnspython>=2.0.0
|
||||
expiringdict>=1.1.4
|
||||
urllib3>=1.25.7
|
||||
requests>=2.22.0
|
||||
publicsuffixlist>=0.10.0
|
||||
xmltodict>=0.12.0
|
||||
geoip2>=3.0.0
|
||||
imapclient>=2.1.0
|
||||
dateparser>=1.1.1
|
||||
elasticsearch<7.14.0
|
||||
elasticsearch-dsl>=7.4.0
|
||||
opensearch-py>=2.4.2,<=3.0.0
|
||||
kafka-python-ng>=2.2.2
|
||||
mailsuite>=1.9.17
|
||||
pygelf
|
||||
nose>=1.3.7
|
||||
wheel>=0.37.0
|
||||
ruff
|
||||
jinja2>=2.10.1
|
||||
packaging>=19.1
|
||||
imagesize>=1.1.0
|
||||
alabaster>=0.7.12
|
||||
Babel>=2.7.0
|
||||
docutils<0.18,>=0.14
|
||||
sphinx>=1.0.5
|
||||
sphinx_rtd_theme>=0.4.3
|
||||
codecov>=2.0.15
|
||||
lxml>=4.4.0
|
||||
boto3>=1.16.63
|
||||
msgraph-core==0.2.2
|
||||
azure-identity>=1.8.0
|
||||
azure-monitor-ingestion>=1.0.0
|
||||
google-api-core>=2.4.0
|
||||
google-api-python-client>=2.35.0
|
||||
google-auth>=2.3.3
|
||||
google-auth-httplib2>=0.1.0
|
||||
google-auth-oauthlib>=0.4.6
|
||||
hatch>=1.5.0
|
||||
myst-parser>=0.18.0
|
||||
myst-parser[linkify]
|
||||
requests
|
||||
bs4
|
||||
pytest
|
||||
|
||||
Reference in New Issue
Block a user