diff --git a/README.md b/README.md index 98aae3a..7cb18bc 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ curl -v -s http://127.0.0.1:9090/api/v1/quarmails?rfc822_message=1 | jq curl -v -s -G --data-urlencode 'filters={"groupOp":"OR","rules":[{"field":"hdr_subject","op":"eq","data":"996 test from quar mit sync xyz"}]}' http://127.0.0.1:9090/api/v1/quarmails | jq ``` -## update a QuarMail´s metadata (e.g. sandbox_results) by ID +## update metadata of a QuarMail (e.g. sandbox_results) by ID ``` curl -v -s -X PATCH -d '{"cf_meta":"12345abc"}' http://127.0.0.1:9090/api/v1/quarmails/311|jq ``` @@ -28,17 +28,17 @@ curl -v -s http://127.0.0.1:9090/api/v1/quarmails?rfc822_message=1 | jq curl -v -s -X DELETE http://127.0.0.1:9090/api/v1/quarmails/141 | jq ``` -## get a QuarMail´s metadata by ID +## get metadata of a QuarMail by ID ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136 | jq ``` -## get a QuarMail´s metadata by ID + RFC822 message +## get metadata of a QuarMail by ID + RFC822 message ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136?rfc822_message=1 | jq ``` -## get a QuarMail´s metadata by ID + RFC822 message headers +## get metadata of a QuarMail by ID + RFC822 message headers ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136?headers=1 | jq ``` @@ -58,17 +58,17 @@ curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136/uris | jq curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136/uris/249 | jq ``` -## get all attachments metadata of a QuarMail +## get metadata of all attachments QuarMail-ID ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136/attachments | jq ``` -## get an attachments metadata of a QuarMail by ID +## get metadata of an attachments by ID (quarmail + attachment) ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136/attachments/71 | jq ``` -## get an attachments metadata of a QuarMail by ID + attachment data +## get metadata of an attachment by ID (quarmail + attachment) + attachment data ``` curl -v -s http://127.0.0.1:9090/api/v1/quarmails/136/attachments/71?data=1 | jq ``` diff --git a/app/Gulag.py b/app/Gulag.py index 2a4013f..b074f26 100644 --- a/app/Gulag.py +++ b/app/Gulag.py @@ -139,7 +139,6 @@ class Gulag: r5321_rcpts = email.header.decode_header( msg['X-Envelope-To-Blocked'])[0][0] except: - # TODO: move_message to INBOX.failed logging.warning(whoami(self) + "Failed to extract envelope recipients! Moving message to failed folder!" ) @@ -149,7 +148,6 @@ class Gulag: try: r5322_from = email.header.decode_header(msg['From'])[0][0] except: - # TODO: move_message to INBOX.failed logging.warning(whoami(self) + "Failed to extract from header! Moving message to failed folder!" ) @@ -214,7 +212,7 @@ class Gulag: # attachments (parts with a name/filename attribute) for part in msg.walk(): if part.get_filename(): - # ist ein Attachment + # is an Attachment filename = email.header.decode_header(part.get_filename()) if filename[0][1]: # filename is encoded diff --git a/app/GulagUtils.py b/app/GulagUtils.py index 02e6eec..6cbee28 100644 --- a/app/GulagUtils.py +++ b/app/GulagUtils.py @@ -11,7 +11,8 @@ def extract_uris(input_text): for m in re.finditer(uri_pattern, input_text): uri = urllib.parse.unquote(m.group(0)) uris[uri] = {} - # extract sub-URIs (google redirector: https://www.google.de/url?sa=t&url=...) + # extract sub-URIs like google´s redirector: + # https://www.google.de/url?sa=t&url=... for m2 in re.finditer(suburi_pattern, uri): suburi = urllib.parse.unquote(m2.group(1)) uris[suburi] = {"suburi": True} diff --git a/docker-build.sh b/docker-build.sh index 9a56c5d..fa6d10d 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -3,7 +3,6 @@ BRANCH="$(/usr/bin/git branch|/bin/grep \*|/usr/bin/awk {'print $2'})" VERSION="$(/bin/cat VERSION)" BASEOS="$(/bin/cat BASEOS)" -#REGISTRY="some-registry.invalid" GO="" while getopts g opt @@ -21,16 +20,8 @@ fi IMAGES="gulag-server gulag-db" -# --build-arg http_proxy=http://wprx-zdf.zwackl.local:3128 \ -# --build-arg https_proxy=http://wprx-zdf.zwackl.local:3128 \ for IMAGE in ${IMAGES}; do /usr/bin/docker build \ -t "${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}" \ -f "docker/${IMAGE}/${BASEOS}/Dockerfile" . -# /usr/bin/docker tag "${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}" "${REGISTRY}/${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}" done - -#/bin/echo "Push images to registry:" -#for IMAGE in ${IMAGES}; do -# /bin/echo "/usr/bin/docker push ${REGISTRY}/${IMAGE}/${BASEOS}:${VERSION}_${BRANCH}" -#done