On Wednesday 24 July 2013 17:48:47 Kareem Dana wrote: > I am using SpamAssassin 3.3.2 on FreeBSD 9.1. I'd just like to confirm that > I can pipe messages to sa-learn. The following commands should do the same > thing, correct? > > # cat spammail | sa-learn --spam > # sa-learn --spam spammail
Yes, it happens to work the same, although it is not documented in the sa-learn man page / usage page. > I have tested and they appear to be identical, but ultimately I will be > invoking sa-learn through the dovecot antispam plugin ( > http://wiki2.dovecot.org/Plugins/Antispam) and their webpage has a whole > section about how sa-learn does not support piped input and I need a > wrapper script. I believe that is outdated, but I want to be absolutely > sure that I can pipe mail to sa-learn and it will work properly. The SA 3.3.2 and the current 3.4.0 both contain a code that copies stdin to a temporary file in order to make the ArchiveIterator happy, which only accepts files or directories. So the only current advantage of passing a message on stdin is a more comfortable use, but there is no speed or disk I/O advantage. I'm not sure when this feature was introduced but left undocumented. I very much doubt it will ever go away, so you can use it, unless you want to comply with the current official documentation, which only mentions files. Feel free to open a documentation update request in bugzilla. See sa-learn code, search for: # Deal with the target listing, and STDIN -> tempfile Mark