Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antispam feature add header and rewrite_subject does not work #1275

Closed
feiaweng opened this issue Sep 5, 2024 · 4 comments
Closed

Antispam feature add header and rewrite_subject does not work #1275

feiaweng opened this issue Sep 5, 2024 · 4 comments
Assignees
Milestone

Comments

@feiaweng
Copy link

feiaweng commented Sep 5, 2024

As a rule of thumb: before reporting an issue

  • see if it hasn't been reported (and possibly already been fixed) first
  • try with the git master

Describe the bug
The add header value and rewrite_subject are the same. This does not work. In this case only the add header will be performed.
The settings must be different.
Example:
add header = 6.9;
rewrite_subject = 7;
In Froxlor is only one setting in database configurable.
Please change it to different values, than it will work.

System information

  • Froxlor version: $version/$gitSHA1
  • Web server: apache2/nginx/lighttpd
  • DNS server: Bind/PowerDNS (standalone)/PowerDNS (Bind-backend)
  • POP/IMAP server: Courier/Dovecot
  • SMTP server: postfix/exim
  • FTP server: proftpd/pureftpd
  • OS/Version: ...

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Logfiles
If applicable, add log-entries to help explain your problem.

Additional context
Add any other context about the problem here.

@froxlor froxlor deleted a comment Sep 5, 2024
@d00p
Copy link
Member

d00p commented Sep 5, 2024

Does the following patch resolve the issue?

diff --git a/lib/Froxlor/Cron/Mail/Rspamd.php b/lib/Froxlor/Cron/Mail/Rspamd.php
index ece47766..624e91dd 100644
--- a/lib/Froxlor/Cron/Mail/Rspamd.php
+++ b/lib/Froxlor/Cron/Mail/Rspamd.php
@@ -185,7 +185,7 @@ class Rspamd
                                $this->frx_settings_file .= '   apply {' . "\n";
                                $this->frx_settings_file .= '           actions {' . "\n";
                                $this->frx_settings_file .= '                   "add header" = ' . $email['spam_tag_level'] . ';' . "\n";
-                               $this->frx_settings_file .= '                   rewrite_subject = ' . $email['spam_tag_level'] . ';' . "\n";
+                               $this->frx_settings_file .= '                   rewrite_subject = ' . ($email['spam_tag_level'] + 0.01) . ';' . "\n";
                                $this->frx_settings_file .= '                   reject = ' . $email['spam_kill_level'] . ';' . "\n";
                                if ($type == 'rcpt' && (int)$email['policy_greylist'] == 0) {
                                        $this->frx_settings_file .= '                   greylist = null;' . "\n";

@feiaweng
Copy link
Author

feiaweng commented Sep 5, 2024

The only change I see is the green line. Have changed it in the Rspamd.php, but no changes in froxlor_settings.conf.
"add header" = 7; rewrite_subject = 7;

@d00p
Copy link
Member

d00p commented Sep 5, 2024

Well you need to force regeneration of the config files...bin/froxlor-cli froxlor:cron -fd in your froxlor install directory

@feiaweng
Copy link
Author

feiaweng commented Sep 5, 2024

I did the job froxlor-cron-with-debug, but with bin/froxlor-cli froxlor:cron -fd it has changed now.
Thanks

@d00p d00p self-assigned this Sep 10, 2024
@d00p d00p added this to 2.2 Sep 10, 2024
@d00p d00p added this to the 2.2.x milestone Sep 10, 2024
@github-project-automation github-project-automation bot moved this to To do in 2.2 Sep 10, 2024
@d00p d00p closed this as completed in c69b38b Sep 10, 2024
@github-project-automation github-project-automation bot moved this from To do to Done in 2.2 Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants