git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] send-email: support NNTP

From
Łukasz Stelmach <l.stelmach@samsung.com>
Date
Apr 24, 2013, 08:42 UTC
Message-ID
<87bo94720r.fsf@samsung.com>
In-Reply-To
<87zjwofken.fsf@linux-k42r.v.cablecom.net>
It was <2013-04-24 śro 09:38>, when Thomas Rast wrote:
Show 15 quoted lines
> Łukasz Stelmach <l.stelmach@samsung.com> writes:
>
>> Enable sending patches to NNTP servers (Usenet, Gmane).
>
> I'm surprised Junio didn't mention this: your patch lacks the
> Signed-off-by.
>
>> +	if ($email_protocol eq 'nntp') {
>> +		$header = "Newsgroups: $to\n" . $header;
>> +	} else {
>> +		$header = "To: $to${ccline}\n" . $header;
>> +	}
>
> Are you silently ignoring any Ccs that have been set if you're in NNTP
> mode?
Yes.
> Would it be possible to instead send the Ccs by mail as usual, and only
> the main message over NNTP?  (You don't need to run off and implement
> this, but I'm curious how hard you think it would be.)

Currently you choose a code path with --protocol. The message is sent only once. It is possible to iterate over To/Cc/Bcc/Newsgroups and choose send it more than once. There are some tiny nasty bits though, I don't know how to handle. For example:

--8<---------------cut here---------------start------------->8---
@@ -761,12 +807,21 @@ if (!defined $sender) {
 }
 
 my $prompting = 0;
-if (!@initial_to && !defined $to_cmd) {
+
+if ($email_protocol eq 'smtp' && !@initial_to && !defined $to_cmd) {
 	my $to = ask("Who should the emails be sent to (if any)? ",
 		     default => "",
 		     valid_re => qr/\@.*\./, confirm_only => 1);
 	push @initial_to, parse_address_line($to) if defined $to; # sanitized/validated later
 	$prompting++;
+} elsif ($email_protocol eq 'nntp' &&
+	 !@initial_newsgroups &&
+	 !defined $newsgroups_cmd) {
+	my $newsgroup = ask("Which newsgroups should the message be sent to (if any)? ",
+		     default => "",
+		     valid_re => qr/[\x20-\x7f]+/, confirm_only => 1);
+	push @initial_newsgroups, $newsgroup if defined $newsgroup; # sanitized/validated later
+	$prompting++;
 }
--8<---------------cut here---------------end--------------->8---

How to ask interactively where to send the message? With protocol set
early it is clear what we are trying to do. Any suggestions?

The other issue is that I am not sure (RFC?) if it is OK to send
To/Cc/Bcc headers in a NNTP message. Theoretically they should not break
things but...

> At least in the git@vger world with a lot of etiquette surrounding the
> use of Ccs, NNTP mode isn't very useful if you can't also send Ccs.  But
> maybe you have another use-case where that is not a problem?

I've sent this patch vi NNTP :) You've got it.
-- 
Łukasz Stelmach
Software wizzard
Samsung Poland R&D Center
Previous: Thomas RastNext: Thomas Rast
Message 11 of 14 in “send-email: support NNTP”
  1. send-email: support NNTPŁukasz Stelmach, Apr 23, 2013
  2. Junio C HamanoApr 23, 2013
  3. Łukasz StelmachApr 24, 2013
  4. Junio C HamanoApr 24, 2013
  5. Łukasz StelmachApr 25, 2013
  6. Junio C HamanoApr 25, 2013
  7. Junio C HamanoApr 25, 2013
  8. Eric SunshineApr 24, 2013
  9. Łukasz StelmachApr 24, 2013
  10. Thomas RastApr 24, 2013
  11. Łukasz StelmachApr 24, 2013
  12. Thomas RastApr 24, 2013
  13. Junio C HamanoApr 24, 2013
  14. Łukasz StelmachApr 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.