Subject: Re: Does mail/dspam play nice with postfix?
To: None <>
From: Quentin Garnier <>
List: pkgsrc-users
Date: 12/29/2007 20:32:13
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Dec 29, 2007 at 09:26:44AM -0800, Charlie Root wrote:
> >>Anyone got any clue-by-fours for me?
> >
> >Personally I use a transport, e.g.:
> >
> >dspam-relearn-spam     unix - n  n      -       10      pipe
> > flags=3DRu user=3Ddspam argv=3D/usr/pkg/bin/dspam --user ${user} --clas=
> > --source=3Derror
> >dspam-relearn-innocent     unix - n  n      -       10      pipe
> > flags=3DRu user=3Ddspam argv=3D/usr/pkg/bin/dspam --user ${user}=20
> > --class=3Dinnocent --source=3Derror
> >
> >That way I avoid any limitations of postfix on |cmd aliases, and I can
> >use a non-root user for the actual dspam command.
> That make sense, by itself.  But I'm still not sure how the user sends=20
> messages to this service for relearning.  Maybe I need a bigger clue-by-=
> four.  (A clue-by-eight?)
> Do you add a [pair of] aliases to /etc/mail/aliases{,.db} specifying=20
> /path/to/the/pipes ?

Well, I use a transport_maps entry.  What I currently have in this
configuration (which I did almost 4 years ago now I think;  I was still
quite the newbie with Postfix at the time, and Postfix configuration was
slightly different in those areas) is a regex map that transforms
spam-${USER}@my.domain.tld into ${USER}@spam.dspam and then a transport
entry for the spam.dspam domain that gets it into dspam.

It might very well be over-designed for the task, but I have a lot of
other transformations so I think at the time it was the best way to get
that processed at the time I wanted it.

Excerpt from

canonical_maps =3D regex:Dspam
transport_maps =3D TransportDspam

Contents of "Dspam":

/^spam-([[:alnum:]]+)$/    ${1}@spam.dspam
/^notspam-([[:alnum:]]+)$/ ${1}@notspam.dspam

Contents of "TransportDspam":

spam.dspam      dspam-relearn-spam
notspam.dspam   dspam-relearn-innocent

IIRC, the need for the canonicalisation of the address that way is so I
could use ${USER} in the entry.

Quentin Garnier - -
"See the look on my face from staying too long in one place
[...] every time the morning breaks I know I'm closer to falling"
KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.6 (NetBSD)