# Where ist the "hook" for invoking spamassasin (spamd) in sendmail?



## sidney2017 (Dec 27, 2021)

Hi,

even though I also use postfix+dovecot+pigeonhole, I have to install the following combination in a freshly installed FreeBSD 13, 
which has been running stably on another server for a long time:

*Sendmail+SASL2 with procmail and Spamassassin (spamd).*
That system works with real system users and virtusertable

*Procmail *is used to evaluate the spam headers of a mail set by Spamassassin and to store the spam mail directly in a spam folder on the server side if necessary.

My problem is that I don't remember exactly how I installed and integrated the above combination at that time (several years ago).
Especially I can't find the place where it is specified that incoming EMails are first checked and tagged by spamd before they reach procmail.
*procmail *is called with the *.forward* file of the user directory for me 

*.forward*
"|exec /usr/local/bin/procmail"

But obviously it would be possible to integrate procmail with following line in sendmail.mc too instead of using the .forward-method:
FEATURE(`local_procmail')dnl

*Additional Processes:*
_/usr/local/bin/spamd -c -Q -d -r /var/run/spamd/spamd.pid
saslauthd -a pam
sendmail: accepting connections (sendmail)_

Can someone tell me how/where to start to integrate spamd?

Thanks in advance and kind regards
sidney2017


----------



## covacat (Dec 27, 2021)

install spamass-milter


----------



## hardworkingnewbie (Dec 27, 2021)

https://cwiki.apache.org/confluence/display/spamassassin/UsedViaProcmail - that's the official Spamassassin Wiki about how to call Spamassassin from Procmail. 

Personally I would go for spamass-milter with Dovecot+SIEVE, and totally dump Procmail which hasn't seen any release over 20 years.


----------



## sidney2017 (Dec 27, 2021)

hardworkingnewbie said:


> https://cwiki.apache.org/confluence/display/spamassassin/UsedViaProcmail - that's the official Spamassassin Wiki about how to call Spamassassin from Procmail.


Hi,

in my case it seems to be another procedure/workflow, because - like already mentioned -
.forward contains ""|exec /usr/local/bin/procmail" and when
.procmailrc is invoked, the mails are already tagged by spamassassin so that you can filter them with


> :0:
> * X-Spam-Status: Yes
> /usr/home/spam





hardworkingnewbie said:


> Personally I would go for spamass-milter with Dovecot+SIEVE, and totally dump Procmail which hasn't seen any release over 20 years.


I share your opinion and already use another solution (postfix+dovecot+pigeonhole).
But for special reasons I have to set up the sendmail+spamassassin scenario for a few weeks.

Kind regards
Sidney2017


----------



## covacat (Dec 27, 2021)

you may use spamc inside .procmailrc and forget about milter


----------



## sidney2017 (Jan 5, 2022)

The answer is to define a global procmailrc (/usr/local/etc/procmailrc) in which processed mails are passed to spamc:

Example:


> ...
> # Spamassassin
> :0fw
> * <400000
> ...



Best regards
Sidney2017


----------

