You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Eric Abrahamsen <er...@ericabrahamsen.net> on 2015/10/17 21:22:15 UTC

spamass-milter and virtual config dir

(I've asked this on the postfix group, too, but so far no response, so
I'm trying here as well.)

tl;dr: I can't get spamd/spamc talking together, using the
virtual-config-dir option, when using spamassassin and postfix together,
via spamass-milter.

Full problem:

I'm using spamassassin together with postfix, as a milter. This is
Ubuntu 14.04, standard packages.

I was keeping a single Bayesian database for all users, but would like
to move to per-user databases. So I'm supposed to edit
/etc/default/spamassassin and add the --virtual-config-dir, like this:

OPTIONS="-x --create-prefs --max-children 5 --helper-home-dir
--virtual-config-dir=/var/lib/spamassassin/%d/%l/spamassassin
-u debian-spamd -g debian-spamd
--socketpath=/var/spool/postfix/spamassassin/spamd.sock
--socketowner=debian-spamd --socketgroup=debian-spamd --socketmode=0660"

But in order to make this work, spamc has to pass the current user to
spamd, using the "-u" option, so spamd knows where to get the config and
store the databases. So I look at /etc/default/spamass-milter, where the
OPTIONS line looks like this:

OPTIONS="-u spamass-milter -i 127.0.0.1 -m -I --
--socket /var/spool/postfix/spamassassin/spamd.sock"

My understanding is that everything after the "--" gets passed right to
spamc as an argument. So you'd think that would be the place to put the
"-u" option in.

I don't know how to do that, though! It seems like milter macros should
be involved. In /etc/postfix/main.cf I've got:

milter_connect_macros = j {daemon_name} v {if_name} {mail_addr} _

I would think that {mail_addr} is probably the right value to be using
with "-u". But no matter how I edit the OPTIONS line in
/etc/default/spamass-milter, no matter what I put in there, I just get
the error about using an unrecognized sendmail macro "{i}".

Can anyone tell me how to pass this argument to the milter?

Thanks!
Eric




Re: spamass-milter and virtual config dir

Posted by Eric Abrahamsen <er...@ericabrahamsen.net>.
Matus UHLAR - fantomas <uh...@fantomas.sk> writes:

> On 17.10.15 15:22, Eric Abrahamsen wrote:
>>OPTIONS="-u spamass-milter -i 127.0.0.1 -m -I --
>>--socket /var/spool/postfix/spamassassin/spamd.sock"
>
>>I don't know how to do that, though! It seems like milter macros should
>>be involved. In /etc/postfix/main.cf I've got:
>>
>>milter_connect_macros = j {daemon_name} v {if_name} {mail_addr} _
>>
>>I would think that {mail_addr} is probably the right value to be using
>>with "-u". But no matter how I edit the OPTIONS line in
>>/etc/default/spamass-milter, no matter what I put in there, I just get
>>the error about using an unrecognized sendmail macro "{i}".
>
> sendmail macrop $i means the queue id. But how does the message look like?

Google indicates that that error is what you get as a sort of catchall
"something went wrong" error message, so I don't think that was the real
source of the problem.

Actually, just this afternoon I think I figured out that passing the
"-e" option in the spamass-milter OPTIONS line does what I want (getting
spamc to send the recipient to spamd). Unfortunately by then I'd somehow
screwed up the milter in other mysterious and apparently unfixable ways,
and finally dropped it altogether in favor of putting spamc in the
postfix's dovecot service line. That seems to be what most other people
do, and it's working fine for me.

Thanks,
Eric


Re: spamass-milter and virtual config dir

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 17.10.15 15:22, Eric Abrahamsen wrote:
>OPTIONS="-u spamass-milter -i 127.0.0.1 -m -I --
>--socket /var/spool/postfix/spamassassin/spamd.sock"

>I don't know how to do that, though! It seems like milter macros should
>be involved. In /etc/postfix/main.cf I've got:
>
>milter_connect_macros = j {daemon_name} v {if_name} {mail_addr} _
>
>I would think that {mail_addr} is probably the right value to be using
>with "-u". But no matter how I edit the OPTIONS line in
>/etc/default/spamass-milter, no matter what I put in there, I just get
>the error about using an unrecognized sendmail macro "{i}".

sendmail macrop $i means the queue id. But how does the message look like?

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
You have the right to remain silent. Anything you say will be misquoted,
then used against you.