Skip to content

Instantly share code, notes, and snippets.

View jab4's full-sized avatar
💭
Oh well...probably just nothing.

jab4

💭
Oh well...probably just nothing.
  • Germany, St. Ingbert
View GitHub Profile
@jab4
jab4 / why-greylisting-is-bad.md
Created February 7, 2022 18:36
Running a mail server? Don't use Greylisting.

Don't use Greylisting.

When postgrey https://postgrey.schweikert.ch/ started out in 2004, it probably happened with all good intentions: Legit mail comes from legit Postfix (or Sendmail, Exim, Exchange, ...) instances, retrying mail delivery upon encountering a 450 tempfail error, while most bad mail originated from scriptkiddies' tools with mediocre knowledge of the inner workings of SMTP and the Internet itself.

Postgrey has its ups and downs, and back in the days with only a fraction of today's mail volume, it really helped to stop many spam messages right in their tracks.

Fast forward to the 2020s. Spambot authors have become more sophisticated. They use hacked accounts at GMail and Microsoft's derivatives of Hotmail, whitelisted by many on domain level. They create spam using real other people's real signatures. They go as far as using your own company's signatures, sucked off a hacked correspondent's mailbox, to pretend they are a workmate of yours. They still use zombie boxes to send mail.

modSecurity apache basic auth authentication authorisation brute force attack prevent deny
############################################
httpd.conf
###########################################
#enabling 2 modules
LoadModule unique_id_module modules/mod_unique_id.so
<IfModule security2_module>
@mdjekic
mdjekic / validate_cidr.php
Created February 7, 2018 11:41
PHP function for validating CIDR notation format (ipv4, ipv6)
<?php
/**
* Validates the format of a CIDR notation string
*
* @param string $cidr
* @return bool
*/
function validateCidr($cidr)
{