Subject: Re: Does mail/dspam play nice with postfix?
To: None <paul@whooppee.com>
From: Quentin Garnier <cube@cubidou.net>
List: pkgsrc-users
Date: 12/29/2007 20:32:13
--7iMSBzlTiPOCCT2k
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=
s=3Dspam=20
> > --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.
>=20
> 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-=
=20
> four.  (A clue-by-eight?)
>=20
> 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 main.cf:

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

Contents of "Dspam":

/^spam-([[:alnum:]]+)@eve-team.com$/    ${1}@spam.dspam
/^notspam-([[:alnum:]]+)@eve-team.com$/ ${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 master.cf entry.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"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.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)

iQEVAwUBR3agvdgoQloHrPnoAQKjfggAs2318nA4vO0Vszul92KbAlh5AKygLLpi
sxhc5PFHiVlnnFrM5yfdLkEFL0gY/HcKXQoqg2hB6o1gmyrh0RZacR/6UsGBqlnx
4KFjOvdGwjxbCrNxbVODf1J6miceh3O3fp/T+eCZfvChDJDpA1GFJFfw0Y7AzAyk
0P4P/VRzz9INEjmCdTz+RaGblIOba7JnRDtS95gsPhcHRJNSi66j3tQDzu14Qh35
YHfXyrxj2DQ69tGJUEAJOexKJQHGLHnYzMaN8MSjC9fQnD1TyjWo46tp7/GHifi3
LsZgSxmG5jF5H7D11DHT6hCDg+muoSxbNxTJ2d/oPLkBEhwwQ6xMmA==
=j4Dm
-----END PGP SIGNATURE-----

--7iMSBzlTiPOCCT2k--