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 25, 2013, 06:56 UTC
Message-ID
<87sj2fhzdx.fsf@samsung.com>
In-Reply-To
<7vip3bgax9.fsf@alter.siamese.dyndns.org>
It was <2013-04-24 śro 18:17>, when Junio C Hamano wrote:
Show 43 quoted lines
> l.stelmach@samsung.com (Łukasz Stelmach) writes:
>
>> It was <2013-04-23 wto 17:02>, when Junio C Hamano wrote:
>>> Łukasz Stelmach <l.stelmach@samsung.com> writes:
>>>
>>>> Enable sending patches to NNTP servers (Usenet, Gmane).
>>>> ---
>>>>
>>>> The patch implements support for sending messages to groups on NNTP
>>>> serviers.
>>>
>>> Cute.
>>>
>>> A Perl guru might want to encapsulate the differences between $smtp
>>> and $nntp codepaths into two Perl modules, but it looks like a good
>>> starting point.
>>
>> You mean *one* perl module like Git::EmailTransport which hides the
>> differences.
>
> What I meant was one class to handle SMTP and another for NNTP.
>
> You look at the --protocol option, choose one of these classes, and
> initialize an instance of the chosen class.
>
> You can ask the chosen class to instantiate an instance without
> if/else cascade like this:
>
> +
> +# Transport specific setup
> +my ($email_authuser, $email_authpass);
> +if ($email_protocol eq 'nntp') {
> +    $email_authuser = $nntp_authuser;
> +    $email_authuser = $nntp_authuser;
> +    @initial_to = @initial_cc = @bcclist = ();
> +    $to_cmd = $cc_cmd = undef;
> +    $no_cc = $no_bcc = 1;
> +} else {
> +    $email_authuser = $smtp_authuser;
> +    $email_authpass = $smtp_authpass;
> +    $newsgroups_cmd = undef;
> +}
> +
[...]

OK, I see. Good point. Where would you recommend me to put these modules and how to name them? I mean I don't want to make to much mess here (;

-- 
Łukasz Stelmach
Software wizzard
Samsung Poland R&D Center
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 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.