[siesta-commit] siesta/lib/Siesta/Plugin ListHeaders.pm,1.3,1.4

[prev] [thread] [next] [lurker] [Date index for 2002/09/17]

From: clampr
Subject: [siesta-commit] siesta/lib/Siesta/Plugin ListHeaders.pm,1.3,1.4
Date: 12:27 on 17 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta/Plugin
In directory usw-pr-cvs1:/tmp/cvs-serv845

Modified Files:
	ListHeaders.pm 
Log Message:
Modified patch from

From: Roger Burton West <roger@xxxxxxxxx.xxx>
Subject: [siesta-dev] RFC2369 (was Re: (unsub|sub|))
Message-Id: <20020917090907.GA21266@xxxxxxxxx.xxx>


Index: ListHeaders.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Plugin/ListHeaders.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ListHeaders.pm	10 Sep 2002 18:24:07 -0000	1.3
+++ ListHeaders.pm	17 Sep 2002 11:27:26 -0000	1.4
@@ -3,18 +3,30 @@
 use Siesta::Plugin;
 use base 'Siesta::Plugin';
 use vars qw/ $DESCRIPTION /;
-$DESCRIPTION = "add RFC2919 List-Id: header";
+$DESCRIPTION = "add RFC2919 and RFC2396 headers";
 
 sub process {
     my $self = shift;
     my $mail = shift;
 
-    my $list      = $mail->list;
-    my $list_name = $list->id;
-    my $address   = $list->post_address;
+    my $list         = $mail->list;
+    my $name         = $list->id;
+    my $post_address = $list->post_address;
+    my $owner        = $list->owner;
+    ( my $list_id       = $post_address ) =~ s/@/./;
+    ( my $sub_address   = $post_address ) =~ s/@/-sub@/;
+    ( my $unsub_address = $post_address ) =~ s/@/-unsub@/;
 
-    $address =~ s/@/./;
-    $mail->head->add( 'List-Id', "$list_name <$address>" );
+    # rfc 2919
+    $mail->head->add( 'List-Id', "name <$list_id>" );
+
+    # rfc 2396
+    $mail->head->add( 'List-Help',        "<mailto:$owner>"; );
+    $mail->head->add( 'List-Unsubscribe', "<mailto:$unsub_address>"; );
+    $mail->head->add( 'List-Subscribe',   "<mailto:$sub_address>"; );
+    $mail->head->add( 'List-Post',        "<mailto:$post_address>"; );
+    $mail->head->add( 'List-Owner',       "<mailto:$post_address>"; );
+    $mail->head->add( 'List-Archive',     'NO' );
 
     return;
 }



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52