Reject user mails to/from some domain.

Discussion in 'General' started by mixo, May 7, 2010.

  1. mixo

    mixo New Member

    Hello.
    I have Ispconfig 2 Server.
    I want to block some domains.
    For example:
    I want to block send and recive any mail from this domain: @example.com.
    I have blocked recieving by adding smtpd_sender_restrictions = regexp:/etc/postfix/access line in /etc/postfix/main.cf file and "access" file, but cann't achieve block send.
    How can i do it?
    Rgds mixo.
     
  2. mixo

    mixo New Member

    I've solved this problem with this line in main.cf:
    check_recipient_access regexp:/etc/postfix/access.
    It blocks outgoing mail.
    But still one problem.
    It blocks when i send from Outlook, but from roundcube doesn't.
    Any idea?
     
  3. mixo

    mixo New Member

    I've blocked sending mail from roundcube webmail to some domain by changing code in /home/admispconfig/ispconfig/web/roundcubemail/program/steps/mail/sendmail.inc:
    PHP:
     if (strlen(strstr($mailto,'example.com'))>0) {
         
    $OUTPUT->show_message('Forbidden''error');
         
    $OUTPUT->send('iframe');
      }
      else
      {
        
    $sent rcmail_deliver_message($MAIL_MIME$from$mailto$smtp_error);
      }
    instead of:
    PHP:
      $sent rcmail_deliver_message($MAIL_MIME$from$mailto$smtp_error);
    Open source is fine ;)
     

Share This Page