Problem installing qgreylist

Forum for getting help with Project Gamera, Spamassassin, Clamav, qmail-scanner and other anti-spam tools.
Poooh
New Forum User
New Forum User
Posts: 3
Joined: Sat Mar 10, 2007 2:09 pm

Problem installing qgreylist

Unread post by Poooh »

Hi chaps,

I tried installing qgreylist on a Centos 4.4 machine with the commands:

1. Updated the repo files with:

Code: Select all

wget http://3es.atomicrocketturtle.com/installers/atomic.sh
sh ./atomic.sh
2. Then run

Code: Select all

yum install qgreylist
and get a:
Parsing package install arguments
Nothing to do
I've been on this for a few hours now and I'm a bit confused....What could be going wrong?

Thanks!
Poooh
New Forum User
New Forum User
Posts: 3
Joined: Sat Mar 10, 2007 2:09 pm

Unread post by Poooh »

Ok, after a:

Code: Select all

yum remove qgreylist
and a

Code: Select all

yum install qgreylist
I get a 9.6KB download of a i386 architecture, when I have a i686. Is that normal?

After the install I tried restarting qmail, spamd and xinetd and nothing seems to happen.

BTW, I have Nodeworx control panel and I don't know if they run the "standard" qmail (althought I'm SURE they run qmail).

Could someone shed some light on this?

Thanks!
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

i686 optimizations only really count on things like glibc and openssl. For everything else on a 32-bit cpu, i386 is what you use for building.

I've never heard of nodeworx before, so you're on your own there. I suspect that it isnt working, unless they're using the same design I use in Project Gamera, or they've duplicated the naming conventions used in PSA.
Poooh
New Forum User
New Forum User
Posts: 3
Joined: Sat Mar 10, 2007 2:09 pm

Unread post by Poooh »

Thanks Scott for your help.

In the end I installed it by hand, donwloading and copying the files from this page:

http://www.jonatkins.com/page/software/qgreylist

and it seems to work fine...

Now I want to fine tune it, so I have a few questions:

What values do you recommend for?:

- $greytime =
- $maxageonce =
- $maxagegood =
- $cleanupinterval =

For example, I'd like to set the retry at 1 minute, keep the "retry" IP for 24 hours and the valid IPs for a couple of months. I don't understand the use of the last value (what does it exactly do?)

So I have:

- $greytime = 1 * 60
- $maxageonce = 24 * 60 * 60
- $maxagegood = 60 * 24 * 60 * 60
- $cleanupinterval = 15 * 60

Thanks!
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

I dont remember, thats why I institutionalize all my R&D in the rpms :P
jwdick
Forum User
Forum User
Posts: 55
Joined: Mon Jul 31, 2006 10:55 pm

Unread post by jwdick »

$cleanupinterval is the time ( every 15 minutes ) that greylist cleans itself of "seen once" and Last seen" ip's. This means it checks each ip's last access time/date every 15 minutes. On an email server with thousands if ip's in the folder, this might be too often of a check.
kanagaraj
Forum User
Forum User
Posts: 13
Joined: Mon Oct 17, 2005 7:12 am

Unread post by kanagaraj »

How can fine tune and Which file can be modified.
Following settings

- $greytime = 1 * 60
- $maxageonce = 24 * 60 * 60
- $maxagegood = 60 * 24 * 60 * 60
- $cleanupinterval = 15 * 60

Thanks
jwdick
Forum User
Forum User
Posts: 55
Joined: Mon Jul 31, 2006 10:55 pm

Unread post by jwdick »

kanagaraj wrote:How can fine tune and Which file can be modified.
Following settings

- $greytime = 1 * 60
- $maxageonce = 24 * 60 * 60
- $maxagegood = 60 * 24 * 60 * 60
- $cleanupinterval = 15 * 60

Thanks
After some experimentation, I use the following:

$greytime = 5 * 60 ( yours is set to 1 minute, 2 minutes is default but I find that let's thru too many spammers)

$maxageonce = 24 * 60 * 60 ( the default is good on this )

$maxagegood = 30 * 60 * 60 ( yours is set to keep good ips for 60 days. Nothing wrong with this, left mine at default of 30 days )

$cleanupinterval = 15 * 60 ( cleanup every 15 minutes, setting depends on number of ip's in the greylist folder and the amount of load on the server. There is nothing wrong with a cleanup every 60 minutes [ 60 * 60 ] or once a day [ 24 * 60 * 60 ].
kanagaraj
Forum User
Forum User
Posts: 13
Joined: Mon Oct 17, 2005 7:12 am

Unread post by kanagaraj »

Thanks for your update, which file can we changed

Thanks
jwdick
Forum User
Forum User
Posts: 55
Joined: Mon Jul 31, 2006 10:55 pm

Unread post by jwdick »

These changes can be made in "/var/qmail/bin/greylist"
kanagaraj
Forum User
Forum User
Posts: 13
Joined: Mon Oct 17, 2005 7:12 am

Unread post by kanagaraj »

I have following code in our server /vat/qmail/bin/greylist. But our server graylist folder have lage ip address around 9000. the folder is not clean up from install greylist.
How can we cleanup the folder on regular time interval

Thanks
Raj

# how long, after 1st seening an ip address, is it kept on the greylist
# (a minute or two is good enough - a few spammers retry within 30 seconds
# or so, then never again. the others that do retry will do so for long enough
# to bypass any sensible value for this)
my $greytime = 2 * 60;

# how long, after seeing an ip address once, before is it forgotten about
# (this needs to be high enough to allow for retry intervals of the
# most overloaded mail server, but low enough to avoid a 2nd spam from
# the same IP address)
my $maxageonce = 24 * 60 * 60;

# how long, after seeing an ip address several times, before it is forgotten about
# (this should be high enough that messages from weekly, if not monthly,
# mail lists do not expire from the list)
my $maxagegood = 32 * 24 * 60 * 60;

# how often to run IP address expiry (a minimum - this is only checked when mail arrives)
# (when this runs the script does a stat() on every IP address file,
# but it does need to be small enough that the $maxage* values work)
my $cleanupinterval = 15 * 60;

# timeout to use waiting for smtp commands
# (rfc2821 recommends at least 5 minutes for most commands)
my $smtptimeout = 5 * 60;

# greylist against entire class-c (/24) networks rather than IP addresses
# if set to 1, greylist entire class-c networks rather than single IP addresses
# this should help with clusters of mailservers which connect from separate
# IP addresses with each delivery attempt (eg. yahoo groups)
my $greylistclassc = 1;


# main code starts here......

# clean up old IPs from the greylist folder...
cleanup_maybe;


# TODO: change to an immediate error here..?
unless ( defined $ENV{TCPREMOTEIP} )
{
syslog "err", "ENV{TCPREMOEIP} not set!";
smtp_temp_fail "Cannot find remote IP";
}

# now this should never happen...
unless ( $ENV{TCPREMOTEIP} =~ m{^(\d+\.\d+\.\d+\.\d+)$} )
{
syslog "err", "ENV{TCPREMOEIP} = $ENV{TCPREMOTEIP} - bad format!";
smtp_temp_fail "Bad format for remote IP";
}

my $remoteip = $1;


# IPs we relay for don't get greylisted...
if ( defined $ENV{RELAYCLIENT} )
{
syslog "debug", "Local IP accepted" if $debugmsg;
run_next_stage;
}
jwdick
Forum User
Forum User
Posts: 55
Joined: Mon Jul 31, 2006 10:55 pm

Unread post by jwdick »

This section starts the cleanup code:
# main code starts here......

# clean up old IPs from the greylist folder...
cleanup_maybe;
you should have a function called "cleanup" and one call "cleanup_maybe" in the section above the Main Code

sub cleanup
{
my $time = time;

foreach my $file ( <$base/*> )
{
# changed to allow for partial IP addresses, to allow for
# matching against class-b and class-c networks
# if ( $file =~ m{/([0-9]+\.[0-9]+\.(?:[0-9]+\.(?:[0-9]+)))$} )
if ( $file =~ m{/([0-9.]+)$} )
{
my $ip = $1;

my ( $atime, $mtime ) = (stat $file)[8,9];

# if the stat failed, we've probably got two separate processes cleaning at the same time...
next unless defined $atime and defined $mtime;

if ( $atime == $mtime )
{
if ( $atime < $time - $maxageonce )
{
syslog "info", "forgetting %s (seen once at %s)", $ip, isotime $atime if $verbose;

unlink $file or syslog "err", "failed to unlink $file";
}
}
else
{
if ( $atime < $time - $maxagegood )
{
syslog "info", "forgetting %s (first seen %s, last %s)", $ip, (isotime $mtime), (isotime $atime) if $verbose;

unlink $file or syslog "err", "failed to unlink $file";
}
}

}
# else not an IP address...
}
}


sub cleanup_maybe
{
my $lastclean = -M "$base/.lastcleanup";

# avoid doing this on every smtp connection
if ( !defined $lastclean or $lastclean > $cleanupinterval / (24*60*60) )
{
syslog "debug", "running cleanup" if $debugmsg;

set_mtime "$base/.lastcleanup";
cleanup;
}
}
Look in "/usr/local/psa/var/log/maillog" for cleanup messages
greylist[15657]: forgetting 203.212.21. (seen once at 2007-03-19 04:11)
greylist[15657]: forgetting 218.20.220. (seen once at 2007-03-19 04:23)
greylist[15657]: forgetting 221.199.152. (seen once at 2007-03-19 04:15)
greylist[15657]: forgetting 59.42.45. (seen once at 2007-03-19 04:11)
greylist[15657]: forgetting 74.224.60. (first seen 2007-02-11 04:53, last 2007-02-16 03:19)
MrTeck
Forum User
Forum User
Posts: 16
Joined: Fri Dec 17, 2004 11:05 am

Unread post by MrTeck »

Hi all.
There is a way to whitelist my customers domains?
When they try to send a mail (have a dinamic IP) fails the fisrts times, and some customers complains about it.

Something like use all domains of /var/qmail/control/rcpthosts for example.

:oops:
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Unread post by exi1ed0ne »

It looks like the qgreylist rpm is missing from the x86_64 repo. Any issues with swiping the 32 bit version?

OK, it's not there either. Hmmm.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Native versions should be hitting the archive now.
Post Reply