Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-20-2011, 02:15 AM
Special Member
 
Posts: 117
Default [SOLVED] restrict sending mails to other domains

Hello Guys,

I want to restrict all users of zimbra to send emails to other domains like gmail hotmail etc. But they can communicate into local domain. I've used configuration provided in below link but it didn't work. Please help me.

RestrictPostfixSenders - Zimbra :: Wiki

I am using zimbra version : Release 7.1.0_GA_3140.UBUNTU10_64 UBUNTU10_64 NETWORK edition.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 05-23-2011, 03:25 AM
Intermediate Member
 
Posts: 18
Default

Hi,
Have a look at a similar article:
RestrictPostfixRecipients - Zimbra :: Wiki

Maybe you could use parts of it to deny outgoing mail to some domains/addresses.
__________________
Michal Belica - IT consultant
www.beli.sk
Reply With Quote
  #3 (permalink)  
Old 05-23-2011, 03:41 AM
Special Member
 
Posts: 117
Default

Thanks mate.

I already found the solution.

I am marking it as solved.

Here is the solution.

Changes in /opt/zimbra/conf/zmmta.cf
Replace
POSTCONF smtpd_sender_restrictions LOCAL postfix_smtpd_sender_restrictions
With
POSTCONF smtpd_sender_restrictions FILE postfix_smtpd_sender_restrictions

Create a file /opt/zimbra/conf/access_sender and add following content to it.
postmaster@xyz.com
xyz.com reject_unauth_destination
.xyz.com reject_unauth_destination

Execute following command using zimbra user
postmap hash:/opt/zimbra/conf/access_sender

Add following line to /opt/zimbra/postfix/conf/main.cf
smtpd_restriction_classes = local_only
local_only = check_recipient_access hash:/opt/zimbra/conf/local_domains, reject

Create a file /opt/zimbra/conf/local_domains and add following content to it.
xyz.com OK
localhost OK
127.0.0.1 OK

Voila.
Reply With Quote
  #4 (permalink)  
Old 09-14-2011, 01:38 AM
Junior Member
 
Posts: 6
Default

I have similar needs to restrict outgoing email. I followed every steps you proposed but when I run the postmap command, I got the following message:

postmap: warning: /opt/zimbra/conf/access_sender, line 1: expected format: key whitespace value

If I ignore this warning and proceed with all the steps, I'm unable to send any email from Zimbra. If I reset the zmmta.cf and main.cf back to the default settings, it works again.

I've also tried to omit the line Ļpostmaster@xyz.comĻ in access_sender. There isn't any error message when I run postmap hash:. But I get the same result. I can't send any email.

I'm running Release 7.1.2_GA_3268.UBUNTU10_64 UBUNTU10_64 FOSS edition.

Please advise.

Last edited by drewy; 09-14-2011 at 02:03 AM..
Reply With Quote
  #5 (permalink)  
Old 09-14-2011, 01:55 AM
Special Member
 
Posts: 117
Default

can you please post what configuration you did in conf file?
Reply With Quote
  #6 (permalink)  
Old 09-14-2011, 08:32 AM
Junior Member
 
Posts: 6
Default

I followed the steps you suggested:

1) In zmmta.cf, I modified:
POSTCONF smtpd_sender_restrictions FILE postfix_smtpd_sender_restrictions

2) In access_sender file, I added:
toto.com reject_unauth_destination
.toto.com reject_unauth_destination

I omitted the first line "postmaster@toto.comĻ because I got a warning message when I do a postmasp hash: with zimbra user.

3) In main.cf, I added:
smtpd_restriction_classes = local_only
local_only = check_recipient_access hash:/opt/zimbra/conf/local_domains, reject

4) In local_domains file, I added:
toto.com OK
localhost OK
127.0.0.1 OK

When I restarted zimbra and performed telnet, I didnīt get the following response:
220 zimbra.toto.com ESMTP Postfix

However, when I commented out the last two lines in main.cf file, and restart Zimbra, everything works fine again - which means Iīm still unable to restrict outgoing email to external domain names.
#smtpd_restriction_classes = local_only
#local_only = check_recipient_access hash:/opt/zimbra/conf/local_domains, reject

Please help.
Reply With Quote
  #7 (permalink)  
Old 09-14-2011, 09:43 PM
Special Member
 
Posts: 117
Default

Did you execute the following command?

postmap hash:/opt/zimbra/conf/local_domains
Reply With Quote
  #8 (permalink)  
Old 09-15-2011, 02:54 AM
Junior Member
 
Posts: 6
Default

Thatīs one missing step that I didnīt do.

There isnīt any error messages and itīs working, but Iīm still able to send email to outside domains. What else did I miss?
Reply With Quote
  #9 (permalink)  
Old 09-15-2011, 03:03 AM
Special Member
 
Posts: 117
Default

Quote:
Originally Posted by drewy View Post
Thatīs one missing step that I didnīt do.

There isnīt any error messages and itīs working, but Iīm still able to send email to outside domains. What else did I miss?

Well, please check MTA logs. And if it's possible try to restart MTA.
Reply With Quote
  #10 (permalink)  
Old 09-15-2011, 07:57 AM
Junior Member
 
Posts: 6
Default

After spending countless hours trying to get this to work, I finally discovered the way to fix.

1) Firstly, in /opt/zimbra/conf/zmmta.cf
It shouldīve been modified as
POSTCONF smtpd_sender_restrictions FILE postfix_smtpd_sender_restriction.cf

2) Then, I added this
echo Ļhash:/opt/zimbra/conf/access_senderĻ > /opt/zimbra/conf/postfix_smtpd_sender_restriction.cf

Alas, itīs working now. Thanks.

Last edited by drewy; 09-15-2011 at 11:12 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.