Hello everyone.

I've been through the wiki, forum search and actually found a partial solution to my issue.
So, let me go over what I need and did so far.

I need a couple of my users to not be able to receive e-mail nor send e-mail outside their domain.

So I've found plenty of articles describing how to prevent them to send e-mail outside the domain, implemented, tested, it works!
But blocking mail from outside the domain is the problem.


So, what I've done so far.

As zimbra user:

Code:
$ cd /opt/zimbra/conf

$ echo "user1@mydomain.lan restrict_tpmail" > tpmail_senders
$ postmap tpmail_senders

$ echo "mydomain.lan OK" > tpmail_recipients
$ postmap tpmail_recipients

$ vi zmconfigd.cf
in the SECTION mta DEPENDS amavis, under the line POSTCONF virtual_transport LOCAL postfix_virtual_transport

POSTCONF smtpd_sender_restrictions FILE postfix_sender_restrictions.cf
POSTCONF smtpd_recipient_restrictions           FILE postfix_recipient_restrictions.cf
POSTCONF smtpd_restriction_classes restrict_tpmail
POSTCONF restrict_tpmail FILE postfix_restrict_tpmail.cf

$ echo "check_sender_access hash:/opt/zimbra/conf/tpmail_senders" > postfix_sender_restrictions.cf
$ echo "check_recipient_access hash:/opt/zimbra/conf/tpmail_recipients, reject" >> postfix_restrict_tpmail.cf

$ cat postfix_sender_restrictions.cf 
check_sender_access hash:/opt/zimbra/conf/tpmail_senders

$ cat postfix_recipient_restrictions.cf 
check_sender_access hash:/opt/zimbra/conf/tpmail_senders

$ cat postfix_restrict_tpmail.cf 
check_recipient_access hash:/opt/zimbra/conf/tpmail_recipients, reject

$ cat tpmail_recipients
mydomain.lan OK

$ cat tpmail_senders
user1@mydomain.lan restrict_tpmail

$ zmmtactl restart

So, I've setup a second domain on my zimbra test box, when sending email from user1@mydomain.lan to testuser@otherdomain.lan I get the message not send popup warning like its expected.
But when I send mail from testuser@otherdomain.lan to user1@mydomain.lan it just gets there, and it isnt blocked.
Mail inside mydomain.lan works just fine.


Any tips? Any other info I can provide?