Allowing larger groups of rejected hosts

Users tips and ideas

Moderators: FlorianB, Pascal, bourgeois, mentor

Bookworm
Posts: 44
Joined: Thu Apr 30, 2015 3:02 am
How did you hear about Mailcleaner: Web search through forums

Allowing larger groups of rejected hosts

Postby Bookworm » Thu Jun 25, 2015 8:04 am

*warning, this can screw up your system if you don't know what you're doing, warning*

If, like several of us, you have large swathes of IP addresses and ranges that you are blocking using

Configuration --> SMTP --> Connection Control --> Reject connection from these hosts :

Then you'll run into a probably after 2800 IP addresses or so. That is, it only uses BLOB, and not MEDIUMBLOB or LONGBLOB for the column host_reject, in the table mta_config.

However, since the original type is BLOB, you can change to one of the other blob types (other than TINYBLOB) without requiring conversion tools.

Caveat: It will take a tiny bit more overhead. If you already have an overloaded system, don't do this. Upgrade hardware first.

First: run the backup - /usr/mailcleaner/bin/backup_config.sh

next - run /usr/mailcleaner/bin/mc_mysql -m

At the mysql> prompt, type 'user mc_config;' <enter> (the quotes are to separate. Don't type them)
Then, type 'show columns from mta_config;' <enter>
This isn't a required command, but it shows you the columns as they are now, and their types. You'll notice that host_reject is a blob type.

Now comes the dangerous part

ALTER TABLE mta_config MODIFY host_reject LONGBLOB;

If you don't think you'll have many IP's, but you'll go over BLOB, you can use MEDIUMBLOB instead.

You're done.

quit;

You could also alter some of the other columns, but that's the only one that's almost guaranteed to run over.
User avatar
CCGTECH
Posts: 92
Joined: Thu Apr 25, 2013 4:59 am
How did you hear about Mailcleaner: open source community
Location: West Hollywood, CA

Re: Allowing larger groups of rejected hosts

Postby CCGTECH » Mon Jun 29, 2015 4:22 pm

Hi Bookworm,

I have an IP address that is getting blocked even though it is no longer listed in the rejected senders list. I've tried removing ALL the IP's and restarting the server, yet the IP is still getting blocked. Where does this list live in MC? I'd like to get this IP removed from the blocked sender list asap. It seems the web interface doesn't clean up the file where this list lives very well when modifications are made.
Bookworm
Posts: 44
Joined: Thu Apr 30, 2015 3:02 am
How did you hear about Mailcleaner: Web search through forums

Re: Allowing larger groups of rejected hosts

Postby Bookworm » Wed Sep 02, 2015 12:26 am

Sorry - I've been really preoccupied.

A running mailcleaner system holds all black and whitelists in the following directory.

/var/mailcleaner/spool/tmp/exim/blacklists/

If you go into that folder, you -can- create a whitelist file. It's simply that it's purged the next time you reboot the system; the entire folder is rebuilt from the database.

As for blocking IP's, remember that there is more than one place you can block IP addresses in the configuration.

Return to “Tips”

Who is online

Users browsing this forum: No registered users and 2 guests