[SOLVED] Spam- Report missing

bkraegelin

Renowned Member
I do not get any spam reports.
Using the commandline
  • pmgreport -debug 1
    works, I also get daily usage reports
  • pmgqm status
    lists all users and # of spam in quarantine
  • pmgqm send -debug 1
    empty output
Do you have any hints, where to look for?

Version Mail Gateway 7.0-7
LXC installation on Virtual Environment 6.4-13
Kernel Linux pm-mailgw 5.4.41-1-pve #1 SMP PVE

Thanks,
Birger
 
hmm - works here ...

are there any mails in quarantine which arrived today? - the default parameter for timespan is today - and only considers mails sent on this day
(try providing the timespan parameter (e.g. pmgqm send -debug 1 -timespan week)

could you post the outputs of the commands above?

I hope this helps!
 
I have to add, I did install LXC version 6.4-1 and upgraded in-place to 7.0-7 according to https://pmg.proxmox.com/wiki/index.php/Upgrade_from_6.x_to_7.0.
With a lot of reboots after that, because I edited my postfix templates.
Rebooting to be sure, that the configuration always works after reboot.

For pmgreport I included all details, this might be helpful.

Code:
pmgreport -debug 1
Content-Type: multipart/related; boundary="----------=_1631251729-2840-0"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
From: Proxmox Mail Gateway <postmaster>
Subject: Proxmox Status Report - 2021-09-10 (pm-mailgw.localnet)

This is a multi-part message in MIME format...

------------=_1631251729-2840-0
Content-Type: text/html
Content-Disposition: inline
Content-Transfer-Encoding: binary

<!DOCTYPE html>
<html> <head>
<title>Proxmox Status Report - 2021-09-10 (pm-mailgw.localnet)</title>
<style>
<!-- styles deleted -->
</style> </head>
<body>

  <h2>System Status</h2>
  <table>
    <tr> <td>Hostname</td> <td style="width:150px;">pm-mailgw</td> </tr>
    <tr> <td>Uptime</td> <td style="width:150px;">1 day 22:23</td> </tr>
    <tr> <td>Version</td> <td style="width:150px;">pmg-api/7.0-7/78c8fe17</td> </tr>
    <tr> <td>Load</td> <td style="width:150px;">1.55</td> </tr>
    <tr> <td>Memory</td> <td style="width:150px;">50.32%</td> </tr>
    <tr> <td>Disk</td> <td style="width:150px;">10.25%</td> </tr>
  </table>

  <h2>Incoming Mails (24 hours)</h2>
  <table>
    <tr> <td>Incoming Mails</td> <td style="width:150px;">7231</td> </tr>
    <tr> <td>Junk Mails (97.90%)</td> <td style="width:150px;">7079</td> </tr>
    <tr> <td>Spam Mails (0.61%)</td> <td style="width:150px;">44</td> </tr>
    <tr> <td>SPF rejects (0.21%)</td> <td style="width:150px;">15</td> </tr>
    <tr> <td>Bounces (0.22%)</td> <td style="width:150px;">16</td> </tr>
    <tr> <td>Virus Mails (0.00%)</td> <td style="width:150px;">0</td> </tr>
    <tr> <td>Mail Traffic</td> <td style="width:150px;">8.340 MByte</td> </tr>
  </table>

  <h2>Outgoing Mails (24 hours)</h2>
  <table>
    <tr> <td>Outgoing Mails</td> <td style="width:150px;">0</td> </tr>
    <tr> <td>Bounces</td> <td style="width:150px;">0</td> </tr>
    <tr> <td>Mail Traffic</td> <td style="width:150px;">0.000 MByte</td> </tr>
  </table>

  <h2>Spam Quarantine</h2>
  <table>
    <tr> <td>Quarantine Size (MBytes)</td> <td style="width:150px;">4</td> </tr>
    <tr> <td>Number of Mails</td> <td style="width:150px;">233</td> </tr>
    <tr> <td>Average Size (Bytes)</td> <td style="width:150px;">18118</td> </tr>
    <tr> <td>Average Spam Level</td> <td style="width:150px;">6</td> </tr>
  </table>
</body> </html>
------------=_1631251729-2840-0--

For pmgqm status I redacted PII. Luckily I have not so much SPAM this morning...
Code:
pmgqm status
Count  Spamlevel Mail
1           5.00 user-b1@domain.tld (external address)
1           5.00 user-b2@domain.tld (external address)
1           5.00 user-b3@domain.tld (external address)
1           5.00 user-d@domain.tld (external address)
1           5.00 user-g@domain.tld (external address)
1           7.00 user-h@domain.tld (external address)
1           5.00 user-k1@domain.tld (external address)
1           8.00 user-k2@domain.tld (external address)
1           5.00 user-k3@domain.tld (external address)
1           5.00 user-l@domain.tld (external address)
1           5.00 user-m1@domain.tld (external address)
1           5.00 user-m2@domain.tld (external address)
1           5.00 user-s@domain.tld (external address)
1           5.00 user-t@domain.tld (external address)
1           5.00 user-w@sub-w.domain.tld (external address)

pmgqm send -debug 1 just gives no output

Do you have any hints, how to debug?

Thanks,
Birger
 
Do you have any hints, how to debug?
a) as suggested in my first response - try adding a 'timespan' parameter to the pmgqm send command
b) check in the GUI for the addresses when the mails were put in quarantine

I hope this helps!
 
Thanks, but I did all the checks. By now I see 26 entries with pmgqm status, I also see 26 entries for today in the GUI. Output of pmgqm send -debug 1 -timespan today outputs nothing...

I did a quick perl -d -T /usr/bin/pmgqm send -debug 1 -timespan today. I stepped into some subroutines but not very deep. It does end without any output. The arguments get parsed correctly, but it seems like send has a problem. I'm not quick enough to find, which subroutines I have to dig into and which I may safely step over.
 
Still no solution...

I just checked again, there is still no PMG LXC template version 7. So my way, installing 6.4 and upgrading is the only solution.

How can I check, what went wrong on upgrade?
Is there any hash-checker for /usr/share/perl5/PMG?
Is there any configuration checker?
 
What's the output of:
Code:
 pmgsh get /quarantine/spam

How can I check, what went wrong on upgrade?
Is there any hash-checker for /usr/share/perl5/PMG?
I'd use debsums to check that the debian-packages and their content is in order.

I hope this helps!
 
I did successfully debug /usr/bin/pmgqm and found line 298 in /usr/share/perl5/PMG/CLI/pmgqm.pm, which suppresses the spam report. After modifying this line to TRUE, the spam reports get sent.

A little bit of reading through the code showed, it depends on a list of domains considered intern. This list is read from a file using PVE::INotify::read_file('domains').

My environment does not have this list. My local postfix modification (template main.cf.in) does LDAP lookup for virtual_mailbox_domains.

Questions:
  • Is there some supported hook to fetch this domain list when creating spam reports?
  • Is the file /etc/pmg/domains the right place, to update this list via cron?
  • Is there a recommended way to run a cron job right before creating spam reports?
Thanks for any help,
Birger
 
A little bit of reading through the code showed, it depends on a list of domains considered intern. This list is read from a file using PVE::INotify::read_file('domains').
yes /etc/pmg/domains is the place to enter 'relay domains' (the ones considered internal):
https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#_configuration_files_overview
Is the file /etc/pmg/domains the right place, to update this list via cron?
should work for now (and no current plans to change that) - in general I'd recommend going through the REST-API in most situations (this will not change in a incompatible way, without this being mentioned in the upgrade instructions).
https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/config/domains

  • Is there a recommended way to run a cron job right before creating spam reports?
I'd edit the service associated with the systemd-timer:
Code:
systemctl edit pmgspamreport.service
(add a fitting ExecStartPre line)

I hope this helps!
 

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!