Change Email Report - domain and port

linhu

Member
Aug 19, 2023
38
0
6
Hi, i will chnage in the template the domain and port, because i have a proxy for all extern connections to port 8006 the extern port is 443 with letsencrypt
So how can i change this in the template.
I have copy the template to /etc/pmg/templates

spamreport-verbose.tt

Code:
<!--start entries-->
    [% FOREACH item IN items %]
    <tr>
      <td>[% item.from %]</td>
      <td align=right nowrap>[% item.date %] [% item.time %]</td>
    </tr>
    <tr title='[% PROCESS tooltip d=item | html  %]'>
      <td><a style='cursorointer;' href='[% item.href | url %]'><b>[% item.subject %]</b></a></td>
      <td align=right nowrap>
        <div style='font-size:xx-small;'>
          <a href='[% item.href | url %]&action=whitelist'>Whitelist</a>&nbsp;
          <a href='[% item.href | url %]&action=blacklist'>Blacklist</a>&nbsp;
          <a href='[% item.href | url %]&action=deliver'>Deliver</a>&nbsp;
          <a href='[% item.href | url %]&action=delete'>Delete</a>
        </div>
      </td>
    </tr>
    <tr><td colspan=2><hr></td></tr>
    [% END %]
    <!--end entries-->

when i read the email there are the domain with port 8006, but they must connect via the proxy on port 443
So how can i change the domain and port in the template? And its also important the quarantine tickets are working.
 
Last edited:
there are special settings for that under Configuration -> Spam Detector -> Quarantine , namely "quarantinte host" and "quarantine port".
when you edit these, the url generated will use the given values instead of the default ones
 
Is it possible to deliver the url in the spam report without the port :8006 because if there is already an npm running it would be much easier to use?

I tried to change the spamreport-verbose.ttl so that the item link would point to the right direction like that:

Code:
<a href='https://[% fqdn %]/quarantine?ticket=[% ticket %]&cselect=[% item.id %]&date=[% date %]&action=delete'>Löschen</a>
But it seems, that the ticket variable is not encode and therefore it is not working....


My Workaround was to edit the pmgqm.pm at /usr/share/perl5/PMG/CLI/pmgqm.pm but thats only good until the next update ;)
 
Last edited: