diff -r -u Changes.orig Changes
--- Changes.orig	Tue Dec 29 11:54:24 1998
+++ Changes	Wed Dec 27 23:14:41 2000
@@ -1,5 +1,11 @@
 Content-Type: text/plain; charset=iso-8859-1
 
+Changed with rotkraut-patches 02:
+  +    Support for LIST SUBSCRIPTIONS.
+  +    Allow setting of user address in the X ressources.
+  +    Bugfix: empty lines had been dropped when displaying or quoting
+       articles that were encoded with quoted-printable.
+
 Changed with 1.0b.1:
   +    XFace support.
   +    Misc. bugfixes based on patches from Matthias Scheler,
diff -r -u configure.h.orig configure.h
--- configure.h.orig	Tue Dec 29 11:47:02 1998
+++ configure.h	Tue Dec 26 17:21:46 2000
@@ -90,6 +90,15 @@
 
 
 
+/*
+ *  Set ALLOW_MAILADDRESS_RESOURCE to 1 if you want to allow the user
+ *  to set his From address in the X-resources.
+ */
+
+#define ALLOW_MAILADDRESS_RESOURCE	0
+
+
+
 
 
 /***************************************
diff -r -u src/Knews.ad.orig src/Knews.ad
--- src/Knews.ad.orig	Mon Dec 28 14:48:08 1998
+++ src/Knews.ad	Wed Dec 27 23:01:59 2000
@@ -7,7 +7,7 @@
 ! Note: if your using R4, you'll have to change all 'baseTranslations' to
 ! 'translations'.
 
-Knews.knewsVersion:	1.0b.1
+Knews.knewsVersion:	1.0b.1 (rotkraut-patches 02)
 
 
 ! This overrides the NNTPSERVER environment variable (no need to set this)
@@ -62,6 +62,16 @@
 !
 Knews.needsTerminal:	exec xterm -e /bin/sh -c '%C'
 Knews.copiousOutput:	exec xterm -e /bin/sh -c '(%C) | less'
+
+
+! What groups should be automaticly subscribed when creating a new
+! newsrc file?  This might be a constant string (the default) an
+! absolute pathname of a file whose contents will be inserted into the
+! new newsrc or a dot to tell Knews to ask the newsserver with the
+! LIST SUBSCRIPTIONS command.
+!Knews.autoSubscribe:	news.answers:\nnews.newusers.questions:\n
+!Knews.autoSubscribe:	/my/path/to/newsrc-template
+!Knews.autoSubscribe:	.
 
 
 ! Stuff for the misc menu on the post popup.
diff -r -u src/domain.c.orig src/domain.c
--- src/domain.c.orig	Sun Aug 23 16:23:19 1998
+++ src/domain.c	Tue Dec 26 17:21:46 2000
@@ -80,4 +80,17 @@
 
     if (!global.mail_name || global.mail_name[0] == ' ')
 	global.mail_name = global.user_id;
+
+    if (!global.mail_address || global.mail_address[0] == ' ') {
+	char	 buffer[1024];
+
+	if (global.mail_name && global.domain_name &&
+	    strlen(global.mail_name) + 
+	    strlen(global.domain_name) + 1 < sizeof buffer) {
+	    strcat(strcat(strcpy(buffer, global.mail_name), 
+			  "@"), 
+		   global.domain_name);
+	    global.mail_address = XtNewString(buffer);
+	}
+    }
 }
diff -r -u src/global.h.orig src/global.h
--- src/global.h.orig	Sat Nov 21 15:43:56 1998
+++ src/global.h	Wed Dec 27 23:01:58 2000
@@ -7,7 +7,7 @@
 #undef  _POSIX_C_SOURCE
 #define _POSIX_C_SOURCE 2
 
-#define KNEWS_VERSION	"1.0b.1"
+#define KNEWS_VERSION	"1.0b.1 (rotkraut-patches 02)"
 
 #include "../configure.h"
 
@@ -121,6 +121,7 @@
     Cursor		busy_cursor;
     String		version;
     String		mail_name;
+    String		mail_address;
     String		config_file;
     String		newsrc_templ;
     String		old_newsrc_templ;
diff -r -u src/main.c.orig src/main.c
--- src/main.c.orig	Sat Nov 21 15:43:37 1998
+++ src/main.c	Tue Dec 26 17:21:46 2000
@@ -150,6 +150,10 @@
 	 offset(copious_output), XtRImmediate, (XtPointer)NULL},
 	{"mailName", "MailName", XtRString, sizeof(String),
 	 offset(mail_name), XtRImmediate, (XtPointer)NULL},
+#if ALLOW_MAILADDRESS_RESOURCE
+	{"mailAddress", "MailAddress", XtRString, sizeof(String),
+	 offset(mail_address), XtRImmediate, (XtPointer)NULL},
+#endif
 	{"configFile", "ConfigFile", XtRString, sizeof(String),
 	 offset(config_file), XtRImmediate, (XtPointer)NULL},
 	{"busyCursor", "BusyCursor", XtRCursor, sizeof(Cursor),
diff -r -u src/newsrc.c.orig src/newsrc.c
--- src/newsrc.c.orig	Thu Nov 19 09:55:52 1998
+++ src/newsrc.c	Tue Dec 26 17:21:46 2000
@@ -487,20 +487,48 @@
     if (!fp)
 	return;
 
-    if (global.auto_subscribe)
-	if (global.auto_subscribe[0] != '/')
-	    fputs(global.auto_subscribe, fp);
-	else {
-	    FILE	*ng = fopen(global.auto_subscribe, "r");
-
-	    if (!ng)
-		perror(global.auto_subscribe);
-	    else {
-		while ((c = getc(ng)) != EOF)
-		    putc(c, fp);
-		fclose(ng);
-	    }
-	}
+    switch (global.auto_subscribe[0]) {
+
+    case '\0' :         /* empty: do not auto-subscribe any group. */
+        break;
+
+    case '.' :          /* dot: ask server via LIST SUBSCRIPTIONS. */
+      {
+        char    *buffer;
+        long    status;
+
+        buffer = server_comm(main_server, "LIST SUBSCRIPTIONS\r\n", False);
+        if (!buffer)
+          break;
+        sscanf(buffer, "%ld", &status);
+        if (status != NNTP_OK_GROUPS)
+          break;        /* In case of errors, just leave the newsrc empty. */
+
+        while ((buffer = server_read(main_server)) && !IS_DOT(buffer)) {
+          fputs(buffer, fp);
+          fputs(":\n", fp);
+        }
+
+        break;
+      }
+
+    case '/' :          /* filename: copy file content */
+      {
+        FILE    *ng = fopen(global.auto_subscribe, "r");
+
+        if (!ng)
+          perror(global.auto_subscribe);
+        else {
+          while ((c = getc(ng)) != EOF)
+            putc(c, fp);
+          fclose(ng);
+        }
+
+        break;
+      }
+    default :           /* string: copy string content */
+        fputs(global.auto_subscribe, fp);
+    }
 
     fclose(fp);
 }
diff -r -u src/p_check.c.orig src/p_check.c
--- src/p_check.c.orig	Fri Jan  9 18:16:23 1998
+++ src/p_check.c	Tue Dec 26 17:21:46 2000
@@ -126,8 +126,7 @@
 	}
 
 	/* possible security hole */
-	if (!strstr(art->from, global.mail_name) ||
-	    !strstr(art->from, global.domain_name)) {
+	if (!strstr(art->from, global.mail_address)) {
 	    add_line(w, "Error! You cannot cancel somebody else's article.",
 		     True);
 	    return False;
diff -r -u src/p_menu.c.orig src/p_menu.c
--- src/p_menu.c.orig	Fri Jan  9 18:16:28 1998
+++ src/p_menu.c	Tue Dec 26 17:21:46 2000
@@ -125,11 +125,11 @@
 
     context->line = 1 + insert_extra_headers(fp, NULL);
     fprintf(fp,
-	    "From: %s@%s (%s)\n"
+	    "From: %s (%s)\n"
 	    "Subject: \n"
 	    "Newsgroups: %s\n"
 	    "\n",
-	    global.mail_name, global.domain_name, full_name,
+	    global.mail_address, full_name,
 	    (global.mode == NewsModeGroup ||
 	     global.mode == NewsModeThread) ?
 	    global.curr_group->name : "");
@@ -184,13 +184,13 @@
     context = create_post_context(POST, file_name);
     context->line = insert_extra_headers(fp, global.curr_art);
     fprintf(fp,
-	    "From: %s@%s (%s)\n"
+	    "From: %s (%s)\n"
 	    "Subject: cmsg cancel <%s>\n"
 	    "Control: cancel <%s>\n"
 	    "Newsgroups: %s\n"
 	    "\n"
 	    "Article canceled from within knews.  [put reason here]\n",
-	    global.mail_name, global.domain_name,
+	    global.mail_address,
 	    full_name ? full_name : "",
 	    global.curr_art->msgid,
 	    global.curr_art->msgid,
@@ -364,11 +364,11 @@
 
     fprintf(fp,
 	    "X-Newsreader: knews " KNEWS_VERSION "%s"
-	    "From: %s@%s (%s)%s"
+	    "From: %s (%s)%s"
 	    "Subject: %s%s (fwd)%s"
 	    "To: %s%s",
 	    eol,
-	    global.mail_name, global.domain_name, full_name, eol,
+	    global.mail_address, full_name, eol,
 	    PARENT(art) ? "Re: " : "", art->subject->subject, eol,
 	    to ? to : "", eol);
     context->line += 4;
diff -r -u src/p_setup.c.orig src/p_setup.c
--- src/p_setup.c.orig	Sun Aug 23 15:05:17 1998
+++ src/p_setup.c	Tue Dec 26 17:21:46 2000
@@ -488,6 +488,7 @@
 			    int       append)
 {
     char	*c;
+    int		firstline = True;
 
     while ((c = strchr(line, '\n'))) {
 	if (c > line && c[-1] == '\r')
@@ -497,10 +498,11 @@
 	    fputs(q_string(line, re, q_str, qq_str), fp);
 	fprintf(fp, "%s\n", line);
 	append = False;
+	firstline = False;
 	line = c;
     }
 
-    if (*line != '\0') {
+    if (*line != '\0' || firstline) {
 	if (!append)
 	    fputs(q_string(line, re, q_str, qq_str), fp);
 	fprintf(fp, "%s", line);
@@ -575,16 +577,16 @@
 	    while ((buffer = server_read(server)) && !IS_DOT(buffer)) {
 		n = decode_qp(buffer, buffer + (*buffer == '.' ? 1 : 0),
 			      strlen(buffer), &soft, False);
-		if (n > 0) {
-		    buffer[n] = '\0';
-		    if (!append && IS_SIG_DELIM(buffer))
-			in_sig = True;
-		    if (quote_sig || !in_sig)
-			print_multi_line(fp, re, q_str, qq_str,
-					 buffer, append);
+
+		buffer[n] = '\0';
+		if (!append && IS_SIG_DELIM(buffer))
+		    in_sig = True;
+		if (quote_sig || !in_sig) {
+		    print_multi_line(fp, re, q_str, qq_str, buffer, append);
 		    if (!soft)
 			fputc('\n', fp);
 		}
+
 		append = soft;
 	    }
 	    if (append)
@@ -704,8 +706,8 @@
 	line++;
     }
 
-    fprintf(fp, "From: %s@%s (%s)\n",
-	    global.mail_name, global.domain_name, full_name);
+    fprintf(fp, "From: %s (%s)\n",
+	    global.mail_address, full_name);
     line++;
 
     fprintf(fp, "Subject: Re: %s\n", eat_re(h.subject));
diff -r -u src/read.c.orig src/read.c
--- src/read.c.orig	Sat Nov 21 15:57:49 1998
+++ src/read.c	Tue Dec 26 17:21:46 2000
@@ -453,13 +453,11 @@
 	while (buffer && !IS_DOT(buffer) &&
 	       !IS_BOUNDARY(buffer, bound, len)) {
 	    n = decode_qp(buffer, buffer, strlen(buffer), &soft, False);
-	    if (n == 0)
-		append = soft;
-	    else if (n > 0) {
-		buffer[n] = '\0';
-		add_body_line_multi(buffer, re, f, dec_data, append);
-		append = soft;
-	    }
+
+	    buffer[n] = '\0';
+	    add_body_line_multi(buffer, re, f, dec_data, append);
+	    append = soft;
+
 	    buffer = server_read(server);
 	}
 	break;

