Get exim to listen on another port on top of port 25

For example, to get exim to listen on both port 25 and port 587, you’d add the following code to the very top of the /etc/exim.conf file:

daemon_smtp_ports = 25 : 587

To specify listening on ports 25 and 26 on all interfaces:

daemon_smtp_ports = 25 : 26

Once saved, restart exim:

How to prevent exim from including the original email in a bounce message

If you want to stop exim from including the orignal message in a bounced email, add this line to the top section of your /etc/exim.conf:

bounce_return_message = false

save, exit and restart exim. This doesn’t stop bounce emails, only the orignal message from being incuded as part of the message.

Force exim to send email from a particular IP

If you need to change the IP that is used to send email out of your system, you can do so by editing your /etc/exim.conf

Change:

remote_smtp:
driver = smtp

To the following below.

remote_smtp:
driver = smtp
interface = IP ADDRESS

Where IP ADDRESS is the IP you want exim to use.

Count the number of connections each IP makes

Use netstat command to calculate and count the number of connections each IP address makes to the server.

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships


The TCP wrappers

The TCP wrappers implements access control through the use of two files, /etc/hosts.allow and /etc/hosts.deny.

Note that the hosts.allow file takes precedence over the hosts.deny file.

A recommended security-strategy is to block all incoming requests by default, but allow specific hosts or networks to connect.

To deny everything by default, add the following line to /etc/hosts.deny:

ALL: ALL

To accept incoming SSH connections from e.g. nodes host1, host2 and host3, add the following line to /etc/hosts.allow:

sshd: host1 host2 host3

To accept incoming SSH connections from all servers from a specific network, add the name of the subnet to /etc/hosts.allow. For example:

sshd: host1 host2 host3 .subnet.host1.com

To accept incoming portmap connections from IP address 192.168.0.1 and subnet 192.168.5, add the following line to /etc/hosts.allow:

portmap: 192.168.0.1 192.168.5.

« Prev - Next »