Skip to content

Exim Blackhole

blackhole: EXIM router-level tool that allows you to throw out emails without DENY answer to the sender.

Table for recipient:

CREATE TABLE IF NOT EXISTS `blackhole_recipient` (
  `recipient` varchar(80) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Config:

ditch_byrecipient:
  driver = redirect
  allow_fail
  data = :blackhole:
  condition = ${lookup mysql{SELECT `recipient` FROM `blackhole_recipient` \
                WHERE ('$local_part@$domain' = `recipient` ) LIMIT 1} {yes} {no} }

Table for sender_domain + recipient:

CREATE TABLE IF NOT EXISTS `blackhole_senderdomain_recipient` (
  `senderdomain` varchar(100) NOT NULL,
  `recipient` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Config:

ditch_by_senderdomain_and_recipient:
  driver = redirect
  allow_fail
  data = :blackhole:
  condition = ${lookup mysql{SELECT `recipient` FROM `blackhole_senderdomain_recipient` \
                WHERE ('$local_part@$domain' = `recipient` AND instr('$sender_address_domain',`senderdomain`) ) LIMIT 1} {yes} {no} }