Mailing List Archive

SQL preferences: where does the _DOMAIN_ in the query come from
I'm in the process of setting up my preferences through SQL. Now spamc
is invoked through a Postfix milter, but that's besides the point, since
whatever way spamc is called, it can only specify one -u param as the
username. However, the WIKI and Docs version of the proposed query use
both a _USERNAME_ and _DOMAIN_ variable. In my setup, the domain
variable is empty. How do I get the _DOMAIN_ variable to be filled so
that I can make a flexible SQL setup?

Guido Goluke

Majorlabel
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On Tue, 18 Feb 2020 08:36:11 +0100
Guido Goluke, Majorlabel wrote:

> I'm in the process of setting up my preferences through SQL. Now
> spamc is invoked through a Postfix milter, but that's besides the
> point, since whatever way spamc is called, it can only specify one -u
> param as the username. However, the WIKI and Docs version of the
> proposed query use both a _USERNAME_ and _DOMAIN_ variable. In my
> setup, the domain variable is empty. How do I get the _DOMAIN_
> variable to be filled so that I can make a flexible SQL setup?


Open the docs for Mail::SpamAssassin::Conf and search for _DOMAIN_
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On 18 Feb 2020, at 05:30, RW <rwmaillists@googlemail.com> wrote:
> On Tue, 18 Feb 2020 08:36:11 +0100 Guido Goluke, Majorlabel wrote:
>> I'm in the process of setting up my preferences through SQL. Now
>> spamc is invoked through a Postfix milter, but that's besides the
>> point, since whatever way spamc is called, it can only specify one -u
>> param as the username. However, the WIKI and Docs version of the
>> proposed query use both a _USERNAME_ and _DOMAIN_ variable. In my
>> setup, the domain variable is empty. How do I get the _DOMAIN_
>> variable to be filled so that I can make a flexible SQL setup?
>
>
> Open the docs for Mail::SpamAssassin::Conf and search for _DOMAIN_

I don’t think that answers the question?


--
Battlemage? That's not a profession. It barely qualifies as a hobby.
'Battlemage' is about impressive a title as 'Lord of the Dance'.
<PAUSE> I'm adding Lord of the Dance to my titles.
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On Tue, 18 Feb 2020 06:54:22 -0700
@lbutlr wrote:

> On 18 Feb 2020, at 05:30, RW <rwmaillists@googlemail.com> wrote:
> > On Tue, 18 Feb 2020 08:36:11 +0100 Guido Goluke, Majorlabel wrote:
> >> I'm in the process of setting up my preferences through SQL. Now
> >> spamc is invoked through a Postfix milter, but that's besides the
> >> point, since whatever way spamc is called, it can only specify one
> >> -u param as the username. However, the WIKI and Docs version of the
> >> proposed query use both a _USERNAME_ and _DOMAIN_ variable. In my
> >> setup, the domain variable is empty. How do I get the _DOMAIN_
> >> variable to be filled so that I can make a flexible SQL setup?
> >
> >
> > Open the docs for Mail::SpamAssassin::Conf and search for _DOMAIN_
>
> I don’t think that answers the question?

Have you actually read the definition of _DOMAIN_? It's the first
match on _DOMAIN_, it stands out as being a definition, and it says in
simple unambiguous language where the value comes from.
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On 18 Feb 2020, at 07:25, RW <rwmaillists@googlemail.com> wrote:
> On Tue, 18 Feb 2020 06:54:22 -0700 @lbutlr wrote:
>
>> On 18 Feb 2020, at 05:30, RW <rwmaillists@googlemail.com> wrote:
>>> On Tue, 18 Feb 2020 08:36:11 +0100 Guido Goluke, Majorlabel wrote:
>>>> I'm in the process of setting up my preferences through SQL. Now
>>>> spamc is invoked through a Postfix milter, but that's besides the
>>>> point, since whatever way spamc is called, it can only specify one
>>>> -u param as the username. However, the WIKI and Docs version of the
>>>> proposed query use both a _USERNAME_ and _DOMAIN_ variable. In my
>>>> setup, the domain variable is empty. How do I get the _DOMAIN_
>>>> variable to be filled so that I can make a flexible SQL setup?
>>>
>>>
>>> Open the docs for Mail::SpamAssassin::Conf and search for _DOMAIN_
>>
>> I don’t think that answers the question?
>
> Have you actually read the definition of _DOMAIN_?

Yes, but did you read the OPs question?

> It's the first match on _DOMAIN_, it stands out as being a definition, and it says in simple unambiguous language where the value comes from.

If the OP could look up the domain in the sql query they would already KNOW the domain to pass to spamc via the postfix milter.



--
"Are you pondering what I'm pondering?"
"I think so, Brainwulf, but if we're Danish, where's the cream
cheese? Narf!”
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
Guido Goluke, Majorlabel wrote:
> I'm in the process of setting up my preferences through SQL. Now spamc
> is invoked through a Postfix milter, but that's besides the point, since
> whatever way spamc is called, it can only specify one -u param as the
> username. However, the WIKI and Docs version of the proposed query use
> both a _USERNAME_ and _DOMAIN_ variable. In my setup, the domain
> variable is empty. How do I get the _DOMAIN_ variable to be filled so
> that I can make a flexible SQL setup?

I'm not aware of a way to pass it separately to spamc, but if you pass a
full email address (user@domain) to spamc, spamd will Do The Right Thing.

-kgd
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On Tue, 18 Feb 2020 13:35:18 -0700
@lbutlr wrote:

> On 18 Feb 2020, at 07:25, RW <rwmaillists@googlemail.com> wrote:

> > It's the first match on _DOMAIN_, it stands out as being a
> > definition, and it says in simple unambiguous language where the
> > value comes from.
>
> If the OP could look up the domain in the sql query they would
> already KNOW the domain to pass to spamc via the postfix milter.

The domain comes from the username passed in

spamc -u <username>

if <username> is in the form of an email address.

This is the definition of _DOMAIN_ I was referring to:

_USERNAME_
The current user's username.

_MAILBOX_
The portion before the @ as derived from the current
user's username.

_DOMAIN_
The portion after the @ as derived from the current
user's username, this value may be null.

It seems perfectly clear to me, if read carefully.
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On 18 Feb 2020, at 14:48, RW <rwmaillists@googlemail.com> wrote:
> It seems perfectly clear to me, if read carefully.

The definition is clear, but the original post specifically addressed the lack of _DOMAIN_ being defined:


On 18 Feb 2020, at 00:36, Guido Goluke, Majorlabel <info@majorlabel.nl> wrote:
> In my setup, the domain variable is empty. How do I get the _DOMAIN_ variable to be filled so that I can make a flexible SQL setup?



--
"We take off our Republican hats and put on our American hats" --
Many Republicans in Sep 2008
Re: SQL preferences: where does the _DOMAIN_ in the query come from [ In reply to ]
On Wed, 19 Feb 2020 23:03:47 -0700
@lbutlr wrote:

> On 18 Feb 2020, at 14:48, RW <rwmaillists@googlemail.com> wrote:
> > It seems perfectly clear to me, if read carefully.
>
> The definition is clear, but the original post specifically addressed
> the lack of _DOMAIN_ being defined:


It says that _DOMAIN_ comes from the part of the username after the @
and that it may be null. Clearly this implies that the username should
be in the form of an email address if you want _DOMAIN_ to be set.

I don't know what you are finding difficult about this.


> On 18 Feb 2020, at 00:36, Guido Goluke, Majorlabel
> <info@majorlabel.nl> wrote:
> > In my setup, the domain variable is empty. How do I get the
> > _DOMAIN_ variable to be filled so that I can make a flexible SQL
> > setup?
>
>
>