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

rspamc learn fails for already learned messages #2691

Closed
2 of 12 tasks
stbuehler opened this issue Dec 21, 2018 · 2 comments
Closed
2 of 12 tasks

rspamc learn fails for already learned messages #2691

stbuehler opened this issue Dec 21, 2018 · 2 comments

Comments

@stbuehler
Copy link

Classification (Please choose one option):

  • Crash/Hang/Data loss
  • WebUI/Usability
  • Serious bug
  • Ordinary bug
  • Feature
  • Enhancement

Reproducibility (Please choose one option):

  • Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try
  • Not applicable

Rspamd version:

1.8.3-1~stretch

Operation system, CPU:

Debian stretch, amd64

Description (Please provide a descriptive summary of the issue):

rspamc learn fails (with exit code 1) for already learned messages (RSPAMD_TASK_FLAG_ALREADY_LEARNED):

# rspamc learn_spam
[...]
Results for file: stdin (0.004 seconds)
HTTP error: 404, <...> has been already learned as spam, ignore it
# echo $?
1

Expected results:

The exit code should be 0; learning didn't change the database because it didn't have to, not because something was wrong.

@c-rosenberg
Copy link
Contributor

d8c8fd5#diff-02786adb24b9071288d5a4f3456bdb64 fixed this.

# apt-cache policy rspamd                                                                                                                                                                     
rspamd:
  Installed: 1.8.3-1~stretch

# rspamc learn_spam file
Results for file: file (0.044 seconds)
error = "<...> has been already learned as spam, ignore it";
filename = "file";
scan_time = 0.044001;

# echo $?
0

And the same when using curl.

@sbergman27
Copy link

This is a significant issue for users of, say, Dovecot Antispam. I had to write a wrapper script to check for a return code of 1 and return a 0 in that case. Otherwise, users are unable to move previously seen emails in or out of "Junk", or out of the "unsure" folder. rspamc really needs to return a 0 in the case of previously seen emails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants