[imp] Spam-config with Rspamd in IMP

Joe Greene jgreene at greenemyst.com
Mon Nov 2 14:04:43 UTC 2020


Sorry.. Lots of o/i typos due to beefy meathooks using phone keyboard and it being late on the end of a long day

Sent via Android Phone
Joe Greene
GreeneMyst
Aka volgclawtooth at greenemyst.com

Nov 1, 2020 23:39:27 Joe Greene <jgreene at greenemyst.com>:

> O?
> 'M woefully out of date on my imp/horde etc... However try "cat -" instead of your. '/bin/echo "$(</dev/stdin)"
> Echo os not a program designed to take input beyond the commandline while cay will read from a file handle and a filename of - will read stdin. That should fix your issues.. Unless the putput is being pinted to stderr instead of stdin..which os another possibility
> 
> Sent via Android Phone
> Joe Greene
> GreeneMyst
> Aka volgclawtooth at greenemyst.com
> 
> Nov 1, 2020 17:39:56 Christoph Haas <christoph+horde at haas-online.org>:
> 
>> Hello,
>> 
>> I'm trying to setup a working spam-config for IMP. - The E-mail part  is working and sends "innocent" and "spam" mail messages...
>> 
>> But far more interesting than getting emails, would be reporting to my  external Rspamd via its REST-API.
>> 
>> The command "/usr/bin/curl --data-binary @-  https://my.rspamd-server.com/rspamd/learnspam?password=mysecretpassword"  expects the contents of an email as input.
>> E.g.:
>> "/usr/bin/curl --data-binary @-  https://my.rspamd-server.com/rspamd/learnspam?password=mysecretpassword <  email-from-/dev/stdin"
>> 
>> I've checked that the PHP-user (Apache: www-data) can execute the  curl-command.
>> 
>> So I configured in /var/www/html/horde/imp/config/backends.local.php  (only relevant parts)
>> 'spam' => array(
>> 'innocent' => array(
>> 'display' => true,
>> 'program' => '/usr/bin/curl --data-binary @-  https://my.rspamd-server.com/rspamd/learnham?password=mysecretpassword',
>> ),
>> ),
>> 'spam' => array(
>> 'display' => false,
>> 'program' => '/usr/bin/curl --data-binary @-  https://my.rspamd-server.com/rspamd/learnspam?password=mysecretpassword',
>> ),
>> )
>> 
>> But I get only errors like this in syslog:
>> Nov  1 16:00:10 myhordeserver HORDE: [imp] Error reporting spam:   %  Total    % Received % Xferd  Average Speed   Time    Time     Time   Current
>> Nov  1 16:00:10 myhordeserver HORDE:                                   Dload  Upload   Total   Spent    Left  Speed
>> Nov  1 16:00:10 myhordeserver HORDE: \x0d  0     0    0     0    0      0      0      0 --:--:-- --:--:-- --:--:--     0\x0d100 11869    0      0  100 11869      0   9626  0:00:01  0:00:01 --:--:--  9626\x0d100  11869    0     0  100 11869      0   5312  0
>> :00:02  0:00:02 --:--:--  5312\x0d100 11869    0     0  100 11869       0   3668  0:00:03  0:00:03 --:--:--  3668\x0d100 11885  100    16  100  11869      4   3286  0:00:04  0:00:03  0:00:01  3291
>> Nov  1 16:00:10 myhordeserver HORDE:  [pid 24371 on line 74 of  "/var/www/html/horde/imp/lib/Spam/Program.php"]
>> 
>> Nov  1 17:13:45 groupware HORDE: [imp] Error reporting spam:   % Total      % Received % Xferd  Average Speed   Time    Time     Time  Current
>> Nov  1 17:13:45 groupware HORDE:                                   Dload  Upload   Total   Spent    Left  Speed
>> Nov  1 17:13:45 groupware HORDE: \x0d  0     0    0     0    0     0        0      0 --:--:-- --:--:-- --:--:--     0\x0d100  8877    0     0   100  8877      0  48508 --:--:-- --:--:-- --:--:-- 48508
>> Nov  1 17:13:45 groupware HORDE:  [pid 26040 on line 74 of  "/var/www/html/horde/imp/lib/Spam/Program.php"]
>> 
>> Then I've tried:
>> 'program' => '/bin/echo "$(</dev/stdin)" >>  /var/www/html/horde/ham.log'
>> but with no result. The ham.log or spam.log files are created, but  with no content.
>> 
>> The Docu says "Messages will be reported to the program via standard input."
>> 
>> How can I capture the input to 'program'?
>> 
>> Or even best: Can anybody tell me the correct way to use the  Rspamd-REST-API for training a remote Rspamd-server?
>> 
>> Many thanks in advance!
>> Christoph.
>> 
>> -- 
>> christoph+horde at haas-online.org
>> 
>> -- 
>> imp mailing list
>> Frequently Asked Questions: http://wiki.horde.org/FAQ
>> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
>> 
> -- 
> imp mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: imp-unsubscribe at lists.horde.org
> 


More information about the imp mailing list