How to remove IP in CBL spamhaus

If your ip listed in CBL black list. You can solve by this way:

Stage 1: Connect to mail server by ehlo commamd

telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 localhost.localdomain ESMTP Sendmail 8.13.8/8.13.8; Tue, 12 Jul 2011 15:27:02 +0700

ehlo localhost
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you

If ehlo command return “localhost.localdomain”, it’s invalid. ehlo command have to return in “test.example.com” or “[192.168.9.9]“.

Stage 2: check host name

First, you may want to exercise the various host name query tools to see if they’re right, in which case you need to go no further.

The following is a sequence of commands you should execute, and their expected results (subtituting mail.example.com etc with the values you want for your machine):

shell prompt>  uname -n
mail.example.com

shell prompt>  hostname -s
mail

shell prompt>  hostname -d
example.com

shell prompt>  hostname -f
mail.example.com

shell prompt>  hostname
mail.example.com

If the results you obtain from the above commands is what you’re expecting, you’re done with this page.

Seeing localhost or localhost.localdomain are clear signs of wrongness.

If the results are wrong, first you need to check/correct your /etc/hosts file, second, you have to ensure that the machine knows which /etc/hosts entry to consult during boot (depends on which O/S you’re using), and thirdly, reboot the machine.

CHECK/CORRECT /ETC/HOSTS

If you have a static IP (even if it’s a RFC1918 private IP address behind a NAT gateway), the /etc/hosts file should contain:

127.0.0.1     localhost.localdomain localhost
1.2.3.4       mail.example.com mail

Setting /etc/hosts for DHCP is beyond the scope of this document (why would you want to run a mail server on DHCP anyway?).

Note: many (most) problems people encounter is where the node name “mail” appears in the first line, and Linux takes the first “dotted name” in that line (usually “localhost.localdomain”) as your hostname. If that’s the case, just removing it should solve your problems.

In any event, the node name (eg: “mail”) or hostname (eg: “mail.example.com”) MUST NOT appear in the 127.0.0.1 localhost line.

CHECKING /ETC/SYSCONFIG/NETWORK (REDHAT, FEDORA ET. AL.)

If you have a static IP, then /etc/sysconfig/network will have your initial hostname assignment. It should have the following lines:

NETWORKING=yes
HOSTNAME="mail.example.com"

Stage 3: edit sendmail

Sendmail’s configuration is handled by the file sendmail.cf. Depending on which Linux distro you are running, it may be in /etc/sendmail.cf or /etc/mail/sendmail.cf (probably the latter).

In many installations, the sendmail.cf file is automatically created from a set of “sendmail.mc” files.

This document describes both methods of fixing the problem. If you are using “.mc” files, you should use that method.

If you don’t configure the machine via the “.mc” file:

First, make a backup of your existing .cf file, for reference/recovery.

Sendmail gets its identity from the “j” macro. Look for the line in the .cf file that says something like:

# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Djlocalhost.localdomain

The “Dj” bit is what you’re looking for. You’ll “D”efine the value of the “j” macro, which is the string used in the HELO when your server connects to somewhere else. You’ll need to remove the leading comment ‘#’. Example:

Djhost.mydomain.com

Stage 4: check again with ehlo command to confirm it return valid value.

Stage 5: remove ip in CBL list

Click on CBL
Roll Down webpage, you will see below text
WARNING: If you continually delist 203.176.130.70 without fixing the problem,the CBL will eventually stop allowing the delisting of 203.176.130.70

// //


Posted by 스트라
,