Notify receiver that someone is trying to send him a message but he is blocked (attach original blocked mail)

poetry

Active Member
May 28, 2020
206
63
33
Is it possible to sent a notification to receiver with original blocked mail as attachment that someone is trying to send him a message but he is blocked.

I am most interested in both messages blocked by spam filter and messages blocked by DNSBL Sites.

Would something like this work:
notify.png

Where would you put this rule? On top of all rules or below? What priority should this rule be? Please let me know. Thank you!
 
Where would you put this rule? On top of all rules or below? What priority should this rule be? Please let me know. Thank you!
I would suggest that you try it out - that way you'll get a feeling how the notify feature works - and at which priority you want to put it...

Is it possible to sent a notification to receiver with original blocked mail as attachment that someone is trying to send him a message but he is blocked.
If you forward any message a recipient should get (with the message attached) - why block it in the first place?

I am most interested in both messages blocked by spam filter and messages blocked by DNSBL Sites.
messages blocked by DNSBL sites are blocked during the smtp-connection with the sending server - PMG never has those mails and thus cannot forward them (also the rule system does not see these mails since they get blocked by postscreen)

I hope this helps!
 
Thank you for some answers @Stoiko Ivanov but still unclear about what is actually possible.

We understand that it might not seem smart to do what we are trying to do but we are just testing the system and how if we implement this and reduce the workload on our helpdesk.

It's completely different if you receive a bad message directly or in an attachment with notice and information that this message might be dangerous with spam score and so on and you should be really careful to open it... This way we would not get a ton of help desk requests for every specific message that is blocked for this specific costumer that has this requirement for us.

What we are trying to do it like I said notify receiver every time when the message is blocked or rejected when send to this domain and this notification need to be send to receiver.

We have been testing this without success. Do the filters/notifications have access to log messages?

For example is there the option to detect the syslog/status fields? This below does just not work.

What are all available fields that we can match? We would like to match status of the message when it's blocked or rejected and notify with original message receiver or just the log information when it's blocked by DNSBL.

blocked.png
 
We have been testing this without success. Do the filters/notifications have access to log messages?

For example is there the option to detect the syslog/status fields? This below does just not work.
no - the Match Field What objects, and the modify field Action objects all act on the message-headers (e.g. From, Subject, Date, To, Reply-To, List-Id)

check the reference documentation:
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#chapter_mailfilter

It's completely different if you receive a bad message directly or in an attachment with notice and information that this message might be dangerous with spam score and so on and you should be really careful to open it... This way we would not get a ton of help desk requests for every specific message that is blocked for this specific costumer that has this requirement for us.
you could try adding 2 actions to the rule which matches the bad mails for the specific domain:
* Notfiy (recipient) with your warning message and with the original message attached
* Block
That way they should get the message, but with your warning on top...
We would like to match status of the message when it's blocked or rejected and notify with original message receiver or just the log information when it's blocked by DNSBL.
as said above the blocking based on DNSBL (the ones you configure in GUI->Configuration->Mail Proxy->Options->DNSBL Sites) are done during the SMTP-dialogue (by postscreen), they never reach the rule system - thus no rules can be applied on those messages (and not notifications)

I hope this explains it
 
@Stoiko Ivanov Thank you very much! Per your guidance I managed to make this work.
I still have some questions about how things work (for example in which direction proxmox processes rules (probably from bottom (lower number) to the top as I can see) but I will figure it out on my own. I have taken enough of your time.
I am impressed how much you can do with proxmox.

Here is some help if someone is trying to replicate what I am trying to do in this thread.
1. Create who objects (you can do domain also or anything else I was just testing with some emails in this image)
1610475374945.png

2. Create object for notification:
1610475487791.png
1610475439114.png

3. Create rule1610475540064.png

As far as I could test it works well without any problem. If spam level is above 4 it will block the mail and notify receiver of the delivery and attach email in the attachment. I have customized the notification message so it's clear what is going on for the user.

Thanks again @Stoiko Ivanov you helped me a lot.
 
(for example in which direction proxmox processes rules (probably from bottom (lower number) to the top as I can see
rules are evaluated/run in order from higher priority to lower priority (rule with priority 99 is evaluated before rule with priority 98,...)
evaluation for a mail and a recipient (mails can have multiple recipients), when one of the final actions (accept, block, quarantine) for the recipient is taken.

Glad you found a solution!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!