Giter Club home page Giter Club logo

gld's Introduction

What is gld ?

gld stands for GreyList Daemon. gld is a standalone policy delegation server for postfix that implements the greylist algorithm as defined at http://www.greylisting.org gld is written in C and use mysql as database.

What are the requirements ?

gld needs the following software:

  • a postfix 2.1 or higher server
  • a mysql server or a pgsql server

How to build gld ?

This should be easy, just run ./configure and then make and wait ...
Of course you need to have include files and libraries for MySQL support.

If the compilation fails with mysql related errors, try to run ./configure --with-mysql=DIR .

How to install gld ?

Just run make install

The install copy only 2 files into your system. The files are installed as follow:

file path file role
/etc/gld.conf.sample the sample config file
/usr/local/bin/gld the gld executable file

Afterward, edit /etc/gld.conf.sample file and modify it to suit your needs. Then rename it to gld.conf .

Please, PLEASE read the README-SECURITY file before choosing your options.

Then, create the tables whitelist and greylist on your mysql server I have provided the script tables.sql that helps you to do this task.

Then start gld and see if it run or if an error message is displayed

If you are here, you are done, now just configure postfix to use your brand new greylist server .

To configure postfix just add the following line:

check_policy_service inet:127.0.0.1:2525

to the end of your smtpd_recipient_restrictions statement of your main.cf file.
You don't have to edit or modify your master.cf file .

How to start gld ?

just run gld without any parameters.

How to stop gld ?

Just kill the process with the TERM signal (SIGTERM is the default signal sent by the kill command)

How to reload the configuration of the server ?

Just send the HUP signal to the server ie: kill -HUP <pid> or killall -HUP gld

How to know the version of gld ?

Just try: gld -v

What happens if the mysql server goes down ?

Depending on the configuration of gld, the server can refuse to answer or send a 'dunno' response, which will likely accept the mails. Please read gld.conf for more informations.

What happens if gld goes down ?

Well, gld MUST be running while postfix is running. make sure you start gld before you start postfix .

If gld should die (this has never occured here) postfix will not be able to connect to the policy server and will return a '450 server configuration' . Thus, you won't be able to receive any greylisted mail .....

What kind of replies this server send to postfix ?

gld sends only 2 replies to postfix.

if the email is to be refused, then gld reply: action=defer_if_permit MESSAGE otherwise gld reply: action=dunno

I want to greylist only some emails and only some domains, How to do ?

postfix has a cool feature for that named policy maps. Let say you want to greylist only the email [email protected] and the whole domain bar.com here follow hos to set up postfix for that.

First, define a policy map named greylist_policy in main.cf to do this just add the following lines in main.cf :

smtpd_restriction_classes = greylist_policy
greylist_policy = check_policy_service inet:127.0.0.1:2525

Then in the end of smtpd_recipient_restrictions add the following line: check_recipient_access hash:/etc/postfix/A_FILE_OF_YOUR_CHOICE instead of the standard line: check_policy_service inet:127.0.0.1:2525

Finally create a text file named /etc/postfix/A_FILE_OF_YOUR_CHOICE which contains domain and emails to be greylisted, the format is:

email greylist_policy
domain greylist_policy

thus in our example, the file would contain:

[email protected] greylist_policy
bar.com greylist_policy

Finally make this text file a hash database with the command:

postmap /etc/postfix/A_FILE_OF_YOUR_CHOICE

and you are done ! .

Where do I report bugs,suggestions,insults ?

Just send a mail to [email protected] (of course this email is greylisted ..)
But please, include the version of gld you use and the OS you are running.

Updates

gld is a perfectly working greylisting server.
As greylisting and SMTP protocol has not changed in the last years, gld last update is May 2006.
If any security issue should be discovered, I will patch the code but don't expect new features.

Note from the author:

I want to thanks all people who mailed me with suggestions, patches and especially the following guys:

  • Lefteris Tsintjelis for his help and support for testing 1.6.
  • Dietmar Braun for his idea of the training mode.
  • Wayne Smith for his support and suggestions.
  • Santiago Vila for maintaining the Debian package.
  • Blaz Zupan for maintaining the FreeBSD port.
  • Volker Tanger for the nice howto.
  • Brian Truelsen for his help and suggestions on MXGREY.
  • Wietse Venema for postfix.

gld's People

Contributors

himred avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fsoderblom

gld's Issues

ipv6 LIGHTGREY support

Hello i have problems on my IPv6 mail servers with LIGHTGREY option.

Code support only ipv4. Is it possible to add LIGHTGREY for IPv6? i think for Ipv6 we need keep 3 first block. Fopr example google services:
mail-it0-x234.google.com[2607:f8b0:4001:c0b::234]
mail-io0-x22a.google.com[2607:f8b0:4001:c06::22a]

here is you ipv4 code:

if(conf->light==1)
{
	if(conf->debug==1) printf("%d: lightgrey is on, let's remove the last octet of ip\n",pid);
	l=strlen(ip);
	for(i=l-1;i>=0;i--)
	{
		if(ip[i]=='.')
		{
			ip[i+1]='0';
			ip[i+2]=0;
			break;
		}
	}
}

MariaDB Support

Hello, I noticed the README only mentions MySQL. Considering most distros run MariaDB by default it would only be fair to also mention MariaDB, and remove any compatibility doubt for users. Ok if I submit a PR to change that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.