File: relay_only

package info (click to toggle)
qpsmtpd 0.84-9
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,376 kB
  • sloc: perl: 8,012; sh: 382; makefile: 61
file content (36 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/perl -w

=head1 NAME

relay_only - this plugin only permits relaying

=head1 SYNOPSIS

# in config/plugins

check_relay

relay_only

# other rcpt hooks go here

=head1 DESCRIPTION

This plugin can be used for the case where a server is used as the smart
relay host for internal users and external/authenticated users, but should
not be considered a normal inbound MX server

It should be configured to be run _AFTER_ check_relay and before other
RCPT hooks!  Only clients that have authenticated or are listed in the
relayclient file will be allowed to send mail.

=cut

sub hook_rcpt {
  if ( shift->qp->connection->relay_client ) {
    return (OK);
  }
  else {
    return (DENY);
  }
}