Try to not have an IP blacklisted

pppplus

Verified User
Joined
Dec 19, 2008
Messages
526
From some weeks, I have a problem with main IP server.

This IP is blacklisted every 3-4 days.

Why ? probably because too much webmaster use gmail, yahoo email as sender. Maybe because someone send mails from stranges domains... not in the server (It would be impossible but...)

I have a 3 IP on this server :

- main
- second (for about 30% of domains)
- third not used for domains

I never had problem on second one, because only domains with this IP can use it to send emails. I have a big sender of email, with pharma products (10000 by days not spam) and this IP was never blacklisted

I use something like this in exim.conf :
Code:
remote_smtp:
  driver = smtp
  interface = ${lookup{$sender_address_domain}lsearch{/etc/virtual/interfaces2} {$value}{main.IP}}
  helo_data = "mail.$sender_address_domain"
  #{main.IP} for domains not list in /etc/virtual/interfaces2
Problem is, each time domains is not listed in /etc/virtual/interfaces2, I use main IP. In this file, I list only domains for second IP.

Now, I try something new :
I write a small batch script, to list all domains, with their IP in /etc/virtual/interfaces2, and run it every 20 minutes with cron
Code:
#!/bin/sh 

# delete temp interface3
rm -f /etc/virtual/interfaces3

# read directories to find all users
for user in `ls /usr/local/directadmin/data/users`
	do 	
		# search IP
                for ligne in `cat /usr/local/directadmin/data/users/$user/user_ip.list`; do
			IPuser=$ligne
		done
                
                # search all domains
		for ligne2 in `cat /usr/local/directadmin/data/users/$user/domains.list`; do
			echo $ligne2: $IPuser >> /etc/virtual/interfaces3
		done

	done

# copy temp file to  /etc/virtual/interfaces2
cp /etc/virtual/interfaces3 /etc/virtual/interfaces2

Now, in exim.conf, I have :
Code:
remote_smtp:
  driver = smtp
  interface = ${lookup{$sender_address_domain}lsearch{/etc/virtual/interfaces2} {$value}{third.IP}}
  helo_data = "mail.$sender_address_domain"
  #{third.IP} for domains not list in /etc/virtual/interfaces2
So third.IP can be blacklisted, it is not a real problem. Webmasters can create real emails in their account !

I hope it would works well.

If you have some comments, suggestions... you can !
My bash script is probably not perfect... and my method maybe strange, but it seem to work !
If you have better, I take it :)
 
Back
Top