From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/24562 Path: main.gmane.org!not-for-mail From: NAGY Andras Newsgroups: gmane.emacs.gnus.general Subject: SOUP and foreign groups Date: Sat, 31 Jul 1999 16:59:06 GMT Organization: SunSITE Denmark (sunsite.auc.dk) Sender: owner-ding@hpc.uh.edu Message-ID: <87iu70wyfy.fsf@goldfish.telnet.hu> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035162107 9391 80.91.224.250 (21 Oct 2002 01:01:47 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:01:47 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id NAA02469 for ; Sat, 31 Jul 1999 13:16:48 -0400 (EDT) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.3/8.9.3) with ESMTP id MAB23836; Sat, 31 Jul 1999 12:01:18 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 31 Jul 1999 12:01:50 -0500 (CDT) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id MAA05862 for ; Sat, 31 Jul 1999 12:01:37 -0500 (CDT) Original-Received: from sunsite.auc.dk (sunsite.auc.dk [130.225.51.30]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id MAA02218 for ; Sat, 31 Jul 1999 12:59:08 -0400 (EDT) Original-Received: (qmail 6439 invoked by uid 509); 31 Jul 1999 16:59:07 -0000 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: emacs.ding Original-Lines: 70 User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) XEmacs/20.4 (Emerald) Original-NNTP-Posting-Host: 157.181.160.1 Original-X-Complaints-To: news@sunsite.auc.dk Original-X-Trace: sunsite.auc.dk 933440346 157.181.160.1 (Sat, 31 Jul 1999 18:59:06 MET DST) Original-NNTP-Posting-Date: Sat, 31 Jul 1999 18:59:06 MET DST Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:24562 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:24562 Here's a short document describing how to set up SOUP to handle posts to foreign groups. I have lots of foreign newsgroups on the server machine, and use SOUP to transfer news home and read `offline'. While trying to post to foreign groups through SOUP I ran into the following problem. I set gnus-post-method to 'current on the server machine, so posting to these groups works fine from the server. However, there's no info in the SOUP packets whether a group is foreign or not, so reply packets contain only the `real' group name, no select method prefix and stuff. Thus, groups from foreign servers cannot be posted to. I've found a workaround (or even solution) for this problem, and wonder if this could be integrated into Gnus. Anyway, here it goes: First, I needed a new utility function, currently named gnus-group-find-prefixed-name, which takes and unprefixed group name and returns the full prefixed name, as in the group list. (If there is more than one group with the same base-name, the first found is returned. If there's none, the original name is returned.) (defun gnus-group-find-prefixed-name (real) (let ((alist (cdr gnus-newsrc-alist)) group) (while (and alist (not group)) (setq full (gnus-info-group (pop alist))) (when (string= real (gnus-group-real-name full)) (setq group full))) (or group real))) Gnus-soup uses Message to send out SOUP replies. Message uses the message-post-method variable (either a posting method or a function) to determine which posting method to use for news. When posting from inside Gnus, message-post-method is set locally, so it's original value is not used. (Hence setting it to the following value does not affect the normal behavior of Gnus.) However, when sending out SOUP replies, it is. So we simply set it up to behave as we were posting from inside Gnus: (defun my-post-method (arg) (gnus-post-method arg (gnus-group-find-prefixed-name (car (split-string (message-fetch-field "newsgroups") "[, ]+"))))) (setq message-post-method 'my-post-method) Note that we determine the posting method based on the first newsgroup in the Newsgroups: header. In most cases, this should be sufficient. If that group is not found in the server's newsrc, the default posting method will be used. We also configure the gnus-post-method function to return the posting method deducted from the prefixed group name instead of the default one: (setq gnus-post-method 'current) Note that all the configurations above should take place on the server machine. Configuration on the home machine is not required. I hope this will help others using SOUP. Andras