The following snippet can be insterted into the "acl_check_rcpt" ACL
in a standard Debian Exim4 installation.  If you have split your Exim4
configuration into several files inside /etc/exim4/conf.d, this should
go into /etc/exim4/conf.d/acl/30_exim4-config_check_rcpt, prior to any
"accept" clauses pertaining to deliveries from remote hosts for local
users.

---->8-------->8-------->8-------->8-------->8-------->8-------->8----
  # Accept mail from the following hosts without subjecting them to
  # greylisting.  This may be needed for large ISPs and other entities
  # that use a pool of outbound mail servers for sending mail.
  #
  accept
    hosts       = ${if exists {/etc/mail/whitelist-hosts} \
                              {/etc/mail/whitelist-hosts} {} }


  # Accept mail from a NULL sender, because these are supposed to be
  # administrative mails (delivery status notifications, callout
  # verifications...)
  #
  accept
    senders = :
  

  # For regular deliveries, consult "greylistd" to obtain greylisting
  # status for this particular peer/sender/recipient triplet.
  # 
  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.
    set acl_m9  = $sender_host_address $sender_address $local_part@$domain
    set acl_m9  = ${readsocket{/var/run/greylistd/socket}{$acl_m9}{5s}{}{}}
    condition   = ${if eq {$acl_m9}{grey}{true}{false}}

---->8-------->8-------->8-------->8-------->8-------->8-------->8----

Note that the third, fourth and fifth argument to ${readsocket ...}
are optional; however, if there is no fifth argument, and if
"greylistd" is not running, then the expansion will fail.  In this
case, Exim will always return a temporary failure (SMTP 451 response),
and not deliver any mail.

If you want to create triplets with entire /24 (formerly "class C")
networks rather than individual IP addresses, you can replace
"$sender_host_address" in the example above with a ${mask...}
expansion, as follows:

    set acl_m9  = ${mask:$sender_host_address/24} \
                  $sender_address $local_part@$domain

