File: dot-outgoing.ex.in

package info (click to toggle)
sn 0.3.8-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 976 kB
  • sloc: ansic: 9,255; sh: 467; makefile: 210
file content (56 lines) | stat: -rw-r--r-- 1,657 bytes parent folder | download | duplicates (7)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#!!!BASH!!
# This is a SAMPLE .outgoing file suitable for use in a local
# newsgroup to feed to a mailing list.
#
# You MUST edit this before copying it into news.group/.outgoing.
# You must set at least LISTADDRESS and SENDMAIL:

# Invocation environment:
# Current directory will be $SNROOT if set else !!SNROOT!!.
# The article is available on descriptor 0, in wire format.
# If TCPREMOTEIP and TCPLOCALIP are set, that is the dotted-quad IP
# of the posting host and server (us) respectively.
# NEWSGROUP is set to this local newsgroup's name.
# The script must exit 0 to indicate it has successfully handled the
# article, or non-0 to indicate failure.

LISTADDRESS=postmaster                     # mailing list address
SENDMAIL="/var/qmail/bin/qmail-inject"     # Running qmail?
#SENDMAIL="/usr/lib/sendmail $LISTADDRESS" # Running sendmail?
#
# If you're using qmail, you can set these:
#
# QMAILSUSER=postmaster       # For envelope sender
# QMAILSHOST=                 # Ditto
# export QMAILSUSER QMAILSHOST
#
# Otherwise, if you're using sendmail, you could set these:
#
# LOGNAME=postmaster
# HOSTNAME=
# export LOGNAME HOSTNAME

#
# Real work begins here.  This turns a news article into
# something suitable for mail.
#

{
if [ "x$TCPREMOTEIP" != x ]; then
  if [ -s .me ]; then me=`cat .me`; else me="$TCPLOCALIP"; fi
  echo "Received: from $TCPREMOTEIP by ${me:-localhost} with nntp; `date +'%e %h %Y %H:%M:%S %Z'`"
fi
echo "To: $LISTADDRESS"
sed 's/
$//
1,/^$/{
/^[nN][eE][wW][sS][gG][rR][oO][uU][pP][sS] *:/d
/^[pP][aA][tT][hH] *:/d
/^[lL][iI][nN][eE][sS] *:/d
/^[bB][yY][tT][eE][sS] *:/d
/^[tT][oO] *:/d
}
/^$/,${
s/^\.//
}
'
} |$SENDMAIL