A Simple Procmail Listserver
A Simple Procmail Listserver
am 26.03.2005 08:13:34 von Alan Connor
This is recipe that will turn procmail into a
simple mailing list server.
:0
* ^Subject.*\[LIST\]
* ^From:.*\/[A-Za-z0-9_.+-]+@[A-Za-z0-9_.+-]+\.[A-Za-z0-9]+
* ? grep -i "$MATCH" ${HOME}/list2
{
:0c
| `echo $MATCH > $HOME/match`
:0c
| `${HOME}/append.sh`
:0f
| sed -f ${HOME}/append.sed
LIST=`cat ${HOME}/list`
:0c
LIST
:0f
| formail -I"From: LIST " \
-I"Reply-To: your@email.address"
:0
! ${LIST}
}
\[LIST\] put whatever string you want in there to identify the
list to its subscribers and to procmail.
${HOME}/list2 contains the email addresses followed by a space,
followed by that subscriber's handle. One pair per line. This
handle is appended to the bottom of any posts they make.
Their email address will not appear in mail from the list.
${HOME}/list contains just their email addresses, one per line.
(Below, the dashed lines "----------..." are there to indicate
the boundaries of the files, not to be included in them.)
${HOME}/append.sh:
----------------
#!/bin/bash
var=`cat ${HOME}/match`
var2=`sed -n "/$var/s/^\($var *\)\(.*\)/\2/p" ${HOME}/list2`
sed "\$s/.*/${var2}/" ${HOME}/append.sed > \
${HOME}/tempsedxx11Yp341
mv ${HOME}/tempsedxx11Yp341 ${HOME}/append.sed
-----------------
${HOME}/append.sed:
------------------
$a\
This post is from:\
xxxxxx
------------------
If a mail arrives that has the string [LIST] on the subject
line, and it is from someone who is subscribed to the list,
a copy of that mail, with their handle at the bottom, will
be sent to everyone on the list and a copy will be saved
to your mailbox LIST.
AC
--
Zero-Tolerance for Spam and Trollmail
Pass-list --> Block-List --> Challenge-Response
http://tinyurl.com/2t5kp
Re: A Simple Procmail Listserver
am 27.03.2005 14:13:01 von Alan Connor
On comp.mail.misc, in , "Alan Connor" wrote:
I've changed this so that the subscriber's handle shows up on
the From line of posts from the list.
This will allow subscribers to killfile posts from subscribers
they don't want to hear from with ease.
>
>
> This is recipe that will turn procmail into a
> simple mailing list server.
>
>:0
> * ^Subject.*\[LIST\]
> * ^From:.*\/[A-Za-z0-9_.+-]+@[A-Za-z0-9_.+-]+\.[A-Za-z0-9]+
> * ? grep -i "$MATCH" ${HOME}/list2
> {
>
>:0c
>| `echo $MATCH > $HOME/match`
>
>:0c
>| `${HOME}/append.sh`
>
>:0f
>| sed -f ${HOME}/append.sed
>
> LIST=`cat ${HOME}/list`
>
>:0c
> LIST
>
>:0f
>| formail -I"From: LIST " \
> -I"Reply-To: your@email.address"
Switch this for the above:
:0f
| formail -I"From: `cat $HOME/match` <${LIST}@.whatever.com> \
-I"Reply-To: your@email.address"
>
>:0
> ! ${LIST}
>
> }
>
> \[LIST\] put whatever string you want in there to identify the
> list to its subscribers and to procmail.
>
> ${HOME}/list2 contains the email addresses followed by a space,
> followed by that subscriber's handle. One pair per line. This
> handle is appended to the bottom of any posts they make.
>
> Their email address will not appear in mail from the list.
>
> ${HOME}/list contains just their email addresses, one per line.
>
>
> (Below, the dashed lines "----------..." are there to indicate
> the boundaries of the files, not to be included in them.)
>
> ${HOME}/append.sh:
>
> ----------------
> #!/bin/bash
>
> var=`cat ${HOME}/match`
>
> var2=`sed -n "/$var/s/^\($var *\)\(.*\)/\2/p" ${HOME}/list2`
>
> sed "\$s/.*/${var2}/" ${HOME}/append.sed > \
> ${HOME}/tempsedxx11Yp341
Add this line to the end.
echo "$var2" > ${HOME}/match
>
> mv ${HOME}/tempsedxx11Yp341 ${HOME}/append.sed
> -----------------
>
>
> ${HOME}/append.sed:
>
> ------------------
> $a\
> This post is from:\
> xxxxxx
> ------------------
>
> If a mail arrives that has the string [LIST] on the subject
> line, and it is from someone who is subscribed to the list,
> a copy of that mail, with their handle at the bottom, will
> be sent to everyone on the list and a copy will be saved
> to your mailbox LIST.
>
>
> AC
>
--
Zero-Tolerance for Spam and Trollmail
Pass-list --> Block-List --> Challenge-Response
http://tinyurl.com/2t5kp
Re: A Simple Procmail Listserver
am 27.03.2005 16:46:58 von Sam
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
--=_mimegpg-commodore.email-scan.com-10586-1111934818-0002
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Beavis writes:
> On comp.mail.misc, in , "Alan Connor" wrote:
>
> I've changed this so that the subscriber's handle shows up on
> the From line of posts from the list.
>
> This will allow subscribers to killfile posts from subscribers
> they don't want to hear from with ease.
And who in hell, exactly, asked you?
Nobody cares, Beavis. You're a kook. An a barely literate kook. You have
to be insane to run any code you vomit forth. Doing would put you in danger
of getting compromised by someone smarter than you, who knows how to exploit
bugs in your code.
--=_mimegpg-commodore.email-scan.com-10586-1111934818-0002
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQBCRsdix9p3GYHlUOIRAnSwAJ9IA/D5gpn2JP9c2y0rLzmpNoB4CwCc D+Ry
ONckB7LNR9u62xBTwaOOqe4=
=R12/
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-10586-1111934818-0002--
Re: A Simple Procmail Listserver
am 27.03.2005 19:08:44 von Mark Crispin
On Sun, 27 Mar 2005, Sam wrote:
> danger
> of getting compromised by someone smarter than you, who knows how to exploit
> bugs in your code.
Ssssh! Don't tell him!
-- Mark --
http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.