On Tue, Sep 17, 2024 at 06:38:15AM +0800, Wesley via Postfix-users wrote:

> I want to deny all messages for a local user.
> if I setup policy like this:
> 
>   smtpd_recipient_restrictions = hash:/etc/postfix/recipient-access
> 
> in recipient-access:
> 
>   u...@domain.com  reject
> 
> Will this work? if not, what's the right syntax?

- Just inbound mail from external sources?  Or also other mail (locally
  submitted or generated)?

- What is the address class of "domain.com"?

Your proposed syntax will refuse all SMTP mail to that address, provided
you run:

    # postmap hash:/etc/postfix/recipient-access

after updating the source file.  I prefer to write the above as:

  main.cf:
    indexed = ${default_database_type}:${config_directory}/
    smtpd_recipient_restrictions = ${indexed}recipient-access
  
  recipient-access:
    u...@domain.com  reject

  Makefile:
    # Or (.cdb, ...) depending on the default database type
    DBEXT = db
    WANTS = recipient-access.${DBEXT}

    .SUFFIXES:
    .SUFFIXES: .${DBEXT}

    all: ${WANTS}

    %.${DBEXT}: %
            # Leading TAB
            postmap $@

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to