April 23, 2014
Exim4, greylistd except recipient
When using greylistd with exim4, you may add a line to skip or bypass greylisting for recipients as maintained in local plaintext file using one email address per line. Basically this says greylist the triplet unless recipient is in the list.
Create recipient whitelist, one address per line:
/etc/greylistd/whitelist-recipient
Backup existing conf file if multi-file config:
cp /etc/exim4/conf.d/acl/30_exim4-config_check_rcpt ~/
or
cp /etc/exim4/exim4.conf.template ~/
Edit the acl portion of multi file conf:
vim /etc/exim4/conf.d/acl/30_exim4-config_check_rcpt
Modify:
defer
message = $sender_host_address is not yet authorized to deliver \
mail from <$sender_address> to <$local_part@$domain>. \
Please try later.
log_message = greylisted.
!senders = :
!hosts = : +relay_from_hosts : \
${if exists {/etc/greylistd/whitelist-hosts}\
{/etc/greylistd/whitelist-hosts}{}} : \
${if exists {/var/lib/greylistd/whitelist-hosts}\
{/var/lib/greylistd/whitelist-hosts}{}}
!authenticated = *
!acl = acl_local_deny_exceptions
domains = +local_domains : +relay_to_domains
verify = recipient
condition = ${readsocket{/var/run/greylistd/socket}\
{--grey \
${mask:$sender_host_address/24} \
$sender_address \
$local_part@$domain}\
{5s}{}{false}}
To:
defer
message = $sender_host_address is not yet authorized to deliver \
mail from <$sender_address> to <$local_part@$domain>. \
Please try later.
log_message = greylisted.
!recipients = /etc/greylistd/whitelist-recipient
!senders = :
!hosts = : +relay_from_hosts : \
${if exists {/etc/greylistd/whitelist-hosts}\
{/etc/greylistd/whitelist-hosts}{}} : \
${if exists {/var/lib/greylistd/whitelist-hosts}\
{/var/lib/greylistd/whitelist-hosts}{}}
!authenticated = *
!acl = acl_local_deny_exceptions
domains = +local_domains : +relay_to_domains
verify = recipient
condition = ${readsocket{/var/run/greylistd/socket}\
{--grey \
${mask:$sender_host_address/24} \
$sender_address \
$local_part@$domain}\
{5s}{}{false}}
Update Exim4 conf file
update-exim4.conf
Restart Exim4
/etc/init.d/exim4 restart
Post a crit