summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-10-18 22:54:51 +0000
committerStef Walter <stef@memberwebs.com>2004-10-18 22:54:51 +0000
commit8ffd57b3fe8fb56d77dde340af147255ce73ad1c (patch)
tree7b01b3934b77a648dd9bc3a1fdf86b4afd8d52a2
parent456d7cc777068bc31a529d6b05ceeb1826b9fece (diff)
Added sample scripts.
-rw-r--r--ChangeLog3
-rw-r--r--scripts/add_header.sh23
-rw-r--r--scripts/proxsmtpd.sh33
-rw-r--r--scripts/spamassassin.sh32
4 files changed, 90 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0837415..677399a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
0.5
- - Initial fork from clamsmtp version 0.9
+ - Added sample scripts.
+ - Initial fork from clamsmtp version 0.9.x
- Converted into filter based SMTP pass-through
diff --git a/scripts/add_header.sh b/scripts/add_header.sh
new file mode 100644
index 0000000..9a9af75
--- /dev/null
+++ b/scripts/add_header.sh
@@ -0,0 +1,23 @@
+#!/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 replaces the subject line with one
+# containing the senders email address. Uses the 'formail' command
+# that comes with the 'procmail' package.
+#
+# Make sure the option 'FilterType' is set as follows:
+# FilterType: pipe
+#
+# See proxsmtpd.conf(5) for configuration details
+#
+
+# Pipe the email through this command
+formail -i "Subject: Changed subject from $SENDER ..."
+
+# Filter success
+exit 0 \ No newline at end of file
diff --git a/scripts/proxsmtpd.sh b/scripts/proxsmtpd.sh
new file mode 100644
index 0000000..d439336
--- /dev/null
+++ b/scripts/proxsmtpd.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+###########################################################################
+# CONFIGURATION
+
+# Most configuration options are found in the proxsmtpd.conf file.
+# For more info see:
+# man proxsmtpd.conf
+
+# The prefix proxsmtpd was installed to
+prefix=/usr/local/
+
+# The location for pid file
+piddir=/var/run/
+
+###########################################################################
+# SCRIPT
+
+case $1 in
+start)
+ mkdir -p $piddir
+ chown $user $piddir
+ $prefix/sbin/proxsmtpd -p $piddir/proxsmtpd.pid
+ echo -n "proxsmtpd "
+ ;;
+stop)
+ [ -f $piddir/proxsmtpd.pid ] && kill `cat $piddir/proxsmtpd.pid`
+ echo -n "proxsmtpd "
+ ;;
+*)
+ echo "usage: proxsmptd.sh {start|stop}" >&2
+ ;;
+esac
diff --git a/scripts/spamassassin.sh b/scripts/spamassassin.sh
new file mode 100644
index 0000000..4a6e8fe
--- /dev/null
+++ b/scripts/spamassassin.sh
@@ -0,0 +1,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