File: add_header.sh

package info (click to toggle)
proxsmtp 1.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 900 kB
  • ctags: 303
  • sloc: sh: 3,521; ansic: 3,323; makefile: 18
file content (43 lines) | stat: -rw-r--r-- 1,421 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
37
38
39
40
41
42
43
#!/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
#

# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#   WARNING WARNING WARNING WARNING WARNING WARNING WARNING 
#
#  By using variables passed in from clamsmtpd in file 
#  manipulation commands without escaping their contents 
#  you are opening yourself up to REMOTE COMPROMISE. You 
#  have been warned. Do NOT do the following unless you 
#  want to be screwed big time:
#
#  mv $EMAIL "$SENDER.eml"
#
#  An attacker can use the above command to compromise your
#  computer. The only variable that is guaranteed safe in
#  this regard is $EMAIL. 
# 
#  The following script does not escape its variables 
#  because it only uses them in safe ways. 
# 
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

# Pipe the email through this command 
formail -i "Subject: Changed subject from $SENDER ..."

# Filter success 
exit 0