summaryrefslogtreecommitdiff
path: root/scripts/spamassassin.sh
blob: 4a6e8fe7d02c8c45069f926c2b1dfaa82028db46 (plain)
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
#!/bin/sh

################################################################################
# PROXSMTP SAMPLE SCRIPT
#
# These sample scripts are to give you an idea of how to use proxsmtp
# filtering. They are NOT intended for use on production servers.
#
# A simple proxsmtp script which sends email through spamassassin.
#
# Make sure the option 'FilterType' is set as follows:
#   FilterType: pipe
#
# See proxsmtpd.conf(5) for configuration details
#

# Pipe mail through this command
spamassassin -e

# Now check return value
if [ $? -ne 0 ]; then

	# The last line of output to stderr will be used
	# as an error message when the filter fails
	echo "550 Content Rejected: We don't like spam" >&2

	# Cause the filter to fail, email will be rejected
	exit 1
fi

# Filter success
exit 0