How to block top level domain(TLD) in Zimbra: Difference between revisions

No edit summary
No edit summary
 
Line 2: Line 2:
__FORCETOC__
__FORCETOC__
<div class="col-md-12 ibox-content">
<div class="col-md-12 ibox-content">
=How to block top level domain(TLD) in Zimbra?=
=How to block top level domain(TLD) in Zimbra=
<hr>
<hr>
{{KB|{{WIP}}|{{ZCS 9.0}}|{{ZCS 8.8}}|}}  
{{KB|{{WIP}}|{{ZCS 9.0}}|{{ZCS 8.8}}|}}  
<hr>
<hr>


====Steps====
====Problem====
How to block top level domain(TLD) in Zimbra?
 
====Solution====
1. Create a “postfix_reject_sender.re.in” file and add the TLD to block.
1. Create a “postfix_reject_sender.re.in” file and add the TLD to block.


Line 24: Line 27:
Open “/opt/zimbra/conf/zmconfigd.cf” file and go to the MTA section or search “SECTION mta DEPENDS amavis”.
Open “/opt/zimbra/conf/zmconfigd.cf” file and go to the MTA section or search “SECTION mta DEPENDS amavis”.


Add following line as per the screenshot:
3. Add following line as per the screenshot:


  $ vim /opt/zimbra/conf/zmconfigd.cf
  $ vim /opt/zimbra/conf/zmconfigd.cf
Line 34: Line 37:
Save the file.
Save the file.


3.Open the file “/opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf” and add the following line as per screenshot.
4. Take the backup of following file.
  $ cp /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf.org
  $ cp /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf.org
5. Open the file “/opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf” and add the following line as per screenshot.
  $ vim /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf
  $ vim /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf


Line 42: Line 47:
[[File:smtpd_sender_restrictions.png]]
[[File:smtpd_sender_restrictions.png]]


4. Now restart the MTA service.
6.Restart the mta service and verify the changes.
  $ zmmtactl restart
  $ zmmtactl restart
  $ postconf -n | grep -i smtpd_sender_restrictions
  $ postconf -n | grep -i smtpd_sender_restrictions
Line 48: Line 53:
The file path "regexp:/opt/zimbra/common/conf/postfix_reject_sender.re" should be there.
The file path "regexp:/opt/zimbra/common/conf/postfix_reject_sender.re" should be there.


Now check and verify.


'''Note:''' This is the Postfix level customization, which is not supported by Zimbra and it will not remain same after an upgrade the server. Please follow the above steps in test environment first then apply on production.
'''Note:''' This is the Postfix level customization, which is not supported by Zimbra and it will not remain same after an upgrade the server. Please follow the above steps in test environment first then apply on production.

Latest revision as of 14:15, 7 May 2023

How to block top level domain(TLD) in Zimbra


   KB 24438        Last updated on 2023-05-7  




0.00
(0 votes)

Problem

How to block top level domain(TLD) in Zimbra?

Solution

1. Create a “postfix_reject_sender.re.in” file and add the TLD to block.

$ vim /opt/zimbra/common/conf/postfix_reject_sender.re.in
/\.icu$/   REJECT
/\.site$/  REJECT
/\.host$/  REJECT
/\.fun$/   REJECT

Save the file.


2. Now take the backup of zmconfigd.cf file before adding new line.

$ cp /opt/zimbra/conf/zmconfigd.cf /opt/zimbra/conf/zmconfigd.cf.org

Open “/opt/zimbra/conf/zmconfigd.cf” file and go to the MTA section or search “SECTION mta DEPENDS amavis”.

3. Add following line as per the screenshot:

$ vim /opt/zimbra/conf/zmconfigd.cf
REWRITE common/conf/postfix_reject_sender.re.in common/conf/postfix_reject_sender.re

Zmconfigd cf.png

Save the file.

4. Take the backup of following file.

$ cp /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf.org

5. Open the file “/opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf” and add the following line as per screenshot.

$ vim /opt/zimbra/conf/zmconfigd/smtpd_sender_restrictions.cf
%%contains VAR:zimbraServiceEnabled mta^ check_sender_access regexp:/opt/zimbra/common/conf/postfix_reject_sender.re%%

Smtpd sender restrictions.png

6.Restart the mta service and verify the changes.

$ zmmtactl restart
$ postconf -n | grep -i smtpd_sender_restrictions

The file path "regexp:/opt/zimbra/common/conf/postfix_reject_sender.re" should be there.


Note: This is the Postfix level customization, which is not supported by Zimbra and it will not remain same after an upgrade the server. Please follow the above steps in test environment first then apply on production.

Jump to: navigation, search