Is possible to quarantine and then deliver the email ? (both actions)

section1

New Member
Aug 19, 2024
8
1
3
Hi Forum!
I have that question, i want to quarantine emails with strange attachments for example but the email still gets delivered to the recipients..
So in the event of a surge, i can locate those quarantined messages. I’ve been looking for a solution but haven’t found anything useful. Any suggestions?
Thanks
 
I abused the custom script for those actions.

Use a custom script:

Code:
#!/usr/bin/env bash
set -euo pipefail

# PMG custom check API v1: args: APIVERSION QUEUEFILENAME
if [[ $# -ne 2 ]]; then
  echo "usage: $0 APIVERSION QUEUEFILENAME" >&2
  exit 1
fi

cp $2 /my_private_copy_of_all_mails/$(date +%Y-%m-%d_%H-%M-%S)$(tr -dc 'a-z0-9' </dev/urandom | head -c 3).eml

echo "v1"
echo "OK"
exit 0


But beware:

- This could be illegal
- This doesn't make decisions and you will copy all e-mails, not only those with special attachments (you can maybe write a filter to only find your special mime-tags you want to copy, ask an AI about that)
- the folder will become very big, so do a cron job clearing all mails older than a few days automagically.
- It will be difficult to get those e-mails, because so cannot send or look into them via PMG, only via commandline


cronjob
0 6 * * * find /my_private_copy_of_all_mails/ -type f -mtime +5 -delete
 
Last edited: