Customize SPAM notification emails

Ladavin

New Member
Oct 7, 2019
2
0
1
45
I am new to Proxmox and wanted to know if there is a way to edit the notification email that users receive? What I would like to be able to do is send the email from any blocked email once each hour during business hours. and then be able to also add a logo or edit the HTML code is possible. I have tried digging into the interwebs and cannot find anything that really tells me where to go.
 
Hi,

yes you can customize that in full. The default templates for that mail are located in /var/lib/pmg/templates/, normally you can chose between the presets verbose (the default) and short, this can changed in the Webinterface under Spam Detector → Quarantine → User Spamreport Style.


There you see that you can also set the report-style to "custom", this searches then for a (by default not existing) template named spamreport-custom.tt, the search is first done in the /etc/pmg/templates directory then the /var/lib/pmg/templates/ one. So for starting our I'd probably copy over the verbose one into /etc (which does not gets overwritten on package upgrades):
Code:
mkdir /etc/pmg/templates
cp /var/lib/pmg/templates/spamreport-verbose.tt /etc/pmg/templates/spamreport-custom.tt

Play around with that and set the report style to custom.
 
What I would like to be able to do is send the email from any blocked email once each hour during business hours.

The service which sends this mail out, if there's anything to sent is the pmgreport.service and the timer who triggers it is then respectively
Code:
systemctl status pmgreport.service
systemctl cat pmgreport.service

You could just copy and adapt that to trigger hourly between certain hours, but the pmgreport tool only accepts "today" and "yesterday" as specific timespans, so it would always include all mails if you did so.

If you do not care about that then I can give a shot in making a short how-to..
 
  • Like
Reactions: ddangel0
I can give a shot in making a short how-to.

That would be great if you could do that. I am not sure how to schedule a trigger, Can you confirm that running the following command will exacute sending emails to all users that have SPAM that was blocked or Quarantined?

Code:
systemctl start pmgreport.service

Thank you so much for the help and pointing us in the right direction.
 
Hello,
I am working with Ladavin.
We have copied the spamreport-verbose.tt into the template directory.
We have now updated it and have swapped the preset to be custom and updated the custom.
Now we are trying to have it send test email.
I am running into trouble doing that. Is there a simple way to do that? What I have tried was running pmgqm send --style custom --timespan today --receiver myemail@mydomain.com and it returned file error - tooltop: not found
 
That would be great if you could do that. I am not sure how to schedule a trigger, Can you confirm that running the following command will exacute sending emails to all users that have SPAM that was blocked or Quarantined?

Code:
systemctl start pmgreport.service

Thank you so much for the help and pointing us in the right direction.

Note that I made an error here, sorry, the service is not pmgreport - that one sends out the daily admin report.
But pmgspamreport.service and pmgspamreport.timer

I am running into trouble doing that. Is there a simple way to do that? What I have tried was running pmgqm send --style custom --timespan today --receiver myemail@mydomain.com and it returned file error - tooltop: not found

Hmm, strange, just re-checked we never call a tool called "tooltop" or the like.
Also tested a
Code:
pmgqm send --style custom --timespan today --receiver t.lamprecht@proxmox.com
just here successfully after copying the verbose template over as custom one.

Can you post the adapted template?
 
  • Like
Reactions: ddangel0

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!