Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [SOLVED] restrict sending mails to other domains

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    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.

  2. #2
    Join Date
    Apr 2011
    Location
    Slovakia
    Posts
    18
    Rep Power
    4

    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

  3. #3
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    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.

  4. #4
    Join Date
    Sep 2011
    Posts
    6
    Rep Power
    4

    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.

  5. #5
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    can you please post what configuration you did in conf file?

  6. #6
    Join Date
    Sep 2011
    Posts
    6
    Rep Power
    4

    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.

  7. #7
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    Default

    Did you execute the following command?

    postmap hash:/opt/zimbra/conf/local_domains

  8. #8
    Join Date
    Sep 2011
    Posts
    6
    Rep Power
    4

    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?

  9. #9
    Join Date
    Mar 2011
    Posts
    131
    Rep Power
    4

    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.

  10. #10
    Join Date
    Sep 2011
    Posts
    6
    Rep Power
    4

    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.

Similar Threads

  1. Sending mails to domains without use of DNS server
    By generic31 in forum Administrators
    Replies: 5
    Last Post: 08-08-2011, 03:17 AM
  2. Replies: 2
    Last Post: 01-16-2011, 11:53 PM
  3. Replies: 3
    Last Post: 07-19-2007, 02:00 AM
  4. Mails to other Domains
    By pawan in forum Administrators
    Replies: 4
    Last Post: 04-23-2007, 04:38 AM
  5. Replies: 1
    Last Post: 05-11-2006, 05:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •