blocking forign mails

Discussion in 'Installation/Configuration' started by muekno, Feb 14, 2024.

  1. muekno

    muekno Active Member HowtoForge Supporter

    My configuration
    I have a public hosted mailserver managed by ISPConfig and a private mailserver at my home managed by ISPConfig (fix ip address on the internet) The public server routes mails to my domains to my ip address at home. In the logs there are seen, beside the rerouted mails from the public server a lot of tries from every where, mail connection, sasl login tries etc. I want to block them.
    I tried mynetworks with the IP of my public mailer xx.xx.xx.xx/32, I tried to block the ip adresses of the penetranted IP adresses with fail2ban. Nothing helps. None of these attempts come through, but I like to block them at all, only request from my public mailer should came through.
    ned help hint.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    So you mean you see on your internal mail system attempts from external systems beside your mail relay? In this case, the best option is to block all incoming connections on the email ports using a firewall like UFW and just allow the IP address of your external mail relay.
     
    muekno likes this.
  3. muekno

    muekno Active Member HowtoForge Supporter

    yes the postfix /var/log/mail.log shows a lot of attempts from external systems, I will try UFW
     
  4. muekno

    muekno Active Member HowtoForge Supporter

    seams I can not configure that in ISPConfig, there I can only allow/block ports
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    You must use the ufw command on the shell for that. Block the email ports in ISPConfig and then use ufw command to allow access for the email ports from the IP address of your relay system. But take care to check first that your system is really using ufw and not bastille firewall, you can see this under System > server config.
     

Share This Page