How to prevent users from receiving email

Noel Jones noeldude at gmail.com
Sun Aug 20 03:18:06 UTC 2006


On 8/19/06, Giorgos Keramidas <keramida at ceid.upatras.gr> wrote:
> On 2006-08-19 19:21, Bill Moran <wmoran at collaborativefusion.com> wrote:
> >
> > Apparently my memory is useless and I've lost the ability to use
> > google as well.
> >
> > I just added a user account to a mail server, but I don't want that
> > user to receive mail on that server.  It's running Postfix.
> >
> > I seem to remember a canonical method for preventing certain users
> > from receiving email.  But my memory has failed, and I can't seem
> > to find anything on google.
> >
> > Is it an /etc/aliases trick?
>
> You can use the Postfix `access' map for this.  You can enable an
> `access' map in Postfix by setting in your `main.cf' file:
>
>     smtpd_client_restrictions = \
>         check_client_access hash:/usr/local/etc/postfix/access
>
> Then, in `/usr/local/etc/postfix/access' put:
>
>     user at domain                  REJECT
>
> and run `postmap' on the `access' file:
>
>     # postmap /usr/local/etc/postfix/access
>
> Reload Postfix and off you go :-)
>
> There are other reject options too, which offer more fine-grained
> control of the SMTP error codes and the text of the error messages
> Postfix will return.  See, for example:
>
>     http://www.postfix.org/access.5.html
>

Close.  But check_client_access is unlikely to be effective matching a
recipient address.  Use check_recipient_access instead.

There are lots of examples on the postfix-users list.

-- 
Noel Jones


More information about the freebsd-questions mailing list