• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Plesk 8.3 and Greylisting

ghazlewood

Basic Pleskian
Does anyone know why Brent Meshier's greylisting solution (see here) doesn't work on Plesk 8.3? I've just upgraded a customer to a new CentOS 5 box and wasn't aware that greylisting wouldn't work on the machine, otherwise I would have opted for 8.2.1

TIA

George
 
Ive got the qgreylist rpm in my repo. The whole SMTP_AUTH issue can be compensated for by using the submission port (587). So modifying qmail isn't necessary any more.
 
Thanks for the reminder Scott but unfortunately the server has a number of existing customers on it who all use port 25 to send so 587 isn't an option (unfortunately!). I can't believe I'm the ony one who's stuck with this problem? I guess I'll just have to bide my time...

I did find greylite earlier today but so little has been written about using it with Plesk I'm not sure it's the best option for a live server :)
 
Just install spamdyke which will also greylist for you.

However it does not support pop-before-relay so if you need that you are still stuck :)
 
Hey that looks like a great solution, thanks faris! I'd not heard of spamdyke before. I'm not sure how many POP-before-SMTP users the client has but it's definitely a possibility...
 
I always recommend against the pop-before-relay system anyway. Especially if your users are coming from proxies, some spammer will undoubtedly take advantage of it.
 
Ok i've successfully got spamdyke working on the server but I thought I'd post my findings in case anyone else gets stuck with things or wonders how to set it up with Plesk.

I found a tutorial in German on setting up spamdyke with Plesk which had some useful config examples but I found that their use of some settings was too restrictive so I pared them down.

So after installing spamdyke I created the file below:

/etc/spamdyke.conf
log-level=3
local-domains-file=/var/qmail/control/rcpthosts
max-recipients=20
idle-timeout-secs=60
graylist-dir=/var/qmail/spamdyke/greylist
graylist-min-secs=300
graylist-max-secs=1814400
sender-blacklist-file=/var/qmail/spamdyke/blacklist_senders
recipient-blacklist-file=/var/qmail/spamdyke/blacklist_recipients
ip-in-rdns-keyword-file=/var/qmail/spamdyke/blacklist_keywords
ip-blacklist-file=/var/qmail/spamdyke/blacklist_ip
rdns-whitelist-file=/var/qmail/spamdyke/whitelist_rdns
ip-whitelist-file=/var/qmail/spamdyke/whitelist_ip
greeting-delay-secs=5
never-greylist-ip-file=/var/qmail/spamdyke/never_greylist

tls-certificate-file=/var/qmail/control/servercert.pem
local-domains-file=/var/qmail/control/rcpthosts

Then you need to create some directories and files:
mkdir -p /var/qmail/spamdyke/greylist

touch /var/qmail/spamdyke/blacklist_ip \
/var/qmail/spamdyke/blacklist_recipients \
/var/qmail/spamdyke/whitelist_ip \
/var/qmail/spamdyke/blacklist_keywords \
/var/qmail/spamdyke/blacklist_senders \
/var/qmail/spamdyke/whitelist_rdns

I also found that setting the ownership of the new files was important, so:

chown -R qmaild:nofiles /var/qmail/spamdyke

Next I backed up the original smtp and smtps xinetd.d files:
cp /etc/xinetd.d/smtp_psa /etc/xinetd.d/smtp_psa.orig
cp /etc/xinetd.d/smtps_psa /etc/xinetd.d/smtps_psa.orig

Changed the smtp_psa and smtps_psa files so that on the server_args line between "/var/qmail/bin/relaylock" and "/var/qmail/bin/qmail-smtpd" I had "/usr/local/bin/spamdyke -f /etc/spamdyke.conf"

I also copied the full server_args line to a new file (which I called spamdyke-test-config), added --config-test to the spamdyke arguments. This allows me to quickly test the spamdyke config without having to copy and paste bits.

So after running the config test I found that it complained about a lack of domains in the greylist directory (which should list all domains to be protected) so I ran the following:
cd /var/qmail/spamdyke/greylist/
for i in `ls -1 /var/qmail/mailnames`; do mkdir $i; done

Finally I added an event on 'Domain creation' and 'Domain alias creation' in Event Manager in the CP to:
mkdir /var/qmail/spamdyke/<new_domain_name>;
chown qmaild:nofiles /var/qmail/spamdyke/<new_domain_name>

(I've not tested this bit yet as I've not created a new domain but I assume it will work!)

Finally a quick:
/etc/init.d/xinetd condrestart

Once everything is running ok i guess you can lower the log level in the config.

If users complain about mail being rejected with DENIED_GRAYLISTING when they send mail it is because they are not using SMTP authentication... I did a few 'grep DENIED /usr/local/psa/var/log/maillog' to see where blocks were occuring...

If anyone has any suggestions please let me know...
 
That's a very helpful howto.

I've been working on a howto document for a while now myself but I've had trouble finding the time to polish it up to a level I'd be happy to see released.

Incidentally, if you put the conf file and the blacklist/whitelist files in /etc/spamdyke.d/ then you have fewer issues with ownership. The only thing I've put in the /var/qmail directory is the graylist tree.

I've also created a script to create the graylist directories with a little twist where you can disable or enable a particular domain with that setting not being changed when you scan the rcpthosts (and morercpthosts in my case) for new domains. I'm very proud of it :) I used the whole thing as a kind of learning project as I've never had the need to look into shell scripting much in the past. It has been huge fun. And all thanks to spamdyke!

I'm a little unhappy about having used the rm -rf command to delete directories though. I can see it leading to trouble but I have not figured out how to make it "safe". I guess I should make it display a list of the directories it is going to remove and ask for a confirmation before continuing....hmm...yes....I'll give this a go if I have time.

Faris.
 
Thanks for the advice faris, I like the idea of /etc/spamdyke.d for the config files.

I've tested the domain creation portion (Event Manager) of my howto and realised that it doesn't work! I'd be very interested to know how you did the greylist directory creation, you mention that it scans rcpthosts, that sounds like a cool solution which keeps everything clear of plesk... Would you be happy to share?

Cheers
 
Everything you need to install spamdyke in plesk!

Hi, all

thank you for this thread... it got me going in the right direction and i finally got it working with Event Manager and all.

I have added this how to to our wiki.
Don't worry i was sure to pay respects to this thread!

See it all here (install, Bash script, event manager setup, Everything!)

Blue Oryx Internet Solutions, LLC Wiki

Let me know if it helps!
 
Superb job! Thanks for posting. Now I can perfect my setup with Event Manager. Perhaps the author of spamdyke, Sam, would be happy linking or posting the full doc on the main spamdyke site? What do you think?
 
If he links me on his site that would be awesome! I can use any SEO i can get!

If he just uses my code and adds it to his install maybe he could through up a thank you link too!

wonder if he reads this forum?

anyway, keep me posted, i would love to know if it works on others servers too. (it should)

also, anyone else seeing qmail turned off in the service manager in plesk but everything running smoothly? I have a separate post asking too.

this is kinda weird.
 
SPAMdyke

Spamdyke is an excellent software.

However, currently spamdyke only works for SMTP authentication and not POP3 before SMTP authentication. Secondly spamdyke has some problem working on SSL SMTP port 465 with Plesk.

These two problems, especially the latter, may cause quite a problem to the hosted users if they are not familiar with the settings.

Other than that, everything else is working very well.
 
I just installed spamdyke yesterday and am very pleased with how it's working.
However, I also suffer from the smtps/465 problem. Is there any way to solve this? What exactly is the problem?
 
I've just rolled out spamdyke onto a couple of other production servers and am strangely having a few problems. Namely that although I have created the folders for each of the domains I want greylisted, none of the domains are being greylisted and I am seeing no files created inside the domain folders. I have checked the permissions on the folders and spamdyke etc. and everything is correct. Spamdyke is running and I can see it rejecting via one of the RBLs but it's not using greylisting at all. Most mysterious. Looking back at the original server I setup I can see that although it was creating the email address files in January it hasn't been recently... perhaps I should take this to the spamdyke users list...
 
Ignore me, I had a no-graylist-dir setting in there by mistake so it wasn't working as graylist-dir and no-graylist-dir are mutually exclusive! :)
 
Spamdyke install is easy with the tutorial found at Blue Oryx Internet Solutions, LLC Wiki. However, make note that the last item on their list of things to do is to create a Event Handler for new domain creation. They made a typo (as of this post) in the script name to be called by Plesk CP. They have greylist spelled with an 'a'... so keep watch of that.
 
Hello everyone,

This thread (and BlueOryx's wiki) have been tremendous help in me getting spamdyke set up on our Linux Plesk Server.

I have one issue though and hope somebody can help. My /var/qmail/spamdyke/greylist/ directory lists every main domain name in my server (using the "for i in `ls -1 /var/qmail/mailnames`; do mkdir $i; done" command). However, my server already has hundreds of domain aliases set up (some of our domain have 3 or 4 domain aliases attached).

Is there an easy way to get all of those domain aliases into the /var/qmail/spamdyke/greylist/ directory? Some other command which can list them all? As a last ditch effort I can go and and note them down and add them by hand, but a faster way would be great (especially since once I'm done with this server I'm going to do this on another server with hundreds of domains).

EDIT: PARTIAL SOLUTION So I found a text file listing all of the domains in Plesk (both primary and domain aliases). The file is located at /var/qmail/control/virtualdomains . The only problem is that each domain has a colon and number after it. For example...

example.com:83
example2.com:4
domainaliaspointingtoexample.com:83
etc...

So I had to copy this text and edit out the :numbers and then manually add them to the /var/qmail/spamdyke/greylist/ directory. If anyone comes up with a way to automatically check this virtualdomains file, strip out the :numbers and then add them to the /var/qmail/spamdyke/greylist/ then this would take care of existing domain aliases.


~ Mr.T
 
Back
Top