=head1 NAME check_deliver - check if mail to this recipient can be delivered. =head1 DESCRIPTION This plugin simply checks if the recipient address has a non-empty deliver_to note attached. If there is no such note, the request is DENYd. =head1 TODO It might make sense to handle relay_client here instead of aliases_check. =head1 COPYRIGHT AND LICENSE Copyright (c) 2012 Peter J. Holzer This plugin is licensed under the same terms as the qpsmtpd package itself. Please see the LICENSE file included with qpsmtpd for details. =cut sub hook_rcpt { my ($self, $transaction, $recipient) = @_; my $deliver_to = $recipient->notes('deliver_to'); if (@$deliver_to) { return DECLINED; } else { return (DENY, "no such user $recipient"); } }