🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
12 messages
12 total messages Started by news Fri, 12 Jul 2019 22:58
The bystand newsreader
#263641
Author: news
Date: Fri, 12 Jul 2019 22:58
14 lines
1448 bytes
Hello, this is my first post to Usenet, ever. I hope that it is good.

I wrote a new NNTP client (newsreader) software called "bystand". It is
public domain, uses a command-line interface, and it stores the messages
and configuration in a SQLite database. It is written in C, and so far I
have only tried it on Linux, but it might work on FreeBSD too but I have
not tried that. Also, it is customizable.

Fossil repository:  http://zzo38computer.org/fossil/bystand.ui/
Download source code:  http://zzo38computer.org/prog/bystand.zip

If you have any comments, questions, complaints, contributions, etc, then
you can mention them on here (post a follow-up to this message, and/or you
can mention them on the Fossil repository.
Re: The bystand newsreader
#263642
Author: Michael Bäuerle
Date: Sat, 13 Jul 2019 10:29
75 lines
3778 bytes
news@zzo38computer.org wrote:
> 
> Hello, this is my first post to Usenet, ever. I hope that it is good.

Looks good, except for the missing MIME declaration (see below).

> [...]
> If you have any comments, questions [...]

MIME support:
In general MIME support is mandatory since RFC 5536:
<https://tools.ietf.org/html/rfc5536#section-2.3>
<https://tools.ietf.org/html/rfc2049#section-2>
But it looks like you intentionally created a very small implementation
without MIME support.

ZIP archive:
Maybe put the files into a directory named "product-version"
("bystand-0.2.1" in this case) before archiving it.
This is common practice for source distributions.

Build system:
Currently there is none. Maybe add at least a Makefile like this:
------------------------------------------------------------------------
# original build note from bystand.c:
# gcc -s -O2 -o ~/bin/bystand bystand.c sqlite3.o -ldl -lpthread
#

OBJS= bystand.o

# Link executable against shared sqlite library
# -s is omitted, see install rule
bystand: $(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -lsqlite3 -ldl -lpthread

# Install exeutable to ~/bin
# Symbol table is stripped after installation (similar to -s)
install: bystand
	cp bystand ~/bin/bystand
	strip ~/bin/bystand

# Delete object files and executable
clean:
	rm -f *.o
	rm -f bystand

# POSIX conformant inference rule (Source *.c => Object *.o)
# Should work with every make program
# Add debug symbols with -g
..c.o:
	$(CC) -g -O2 $(CFLAGS) $(CPPFLAGS) -c -o $@ $*.c
------------------------------------------------------------------------

This way the user can configure the build with the standard environment
variables.

The local executable is build with debug symbols, the installed
executable is stripped after installation.

Example for a GNU/Linux system using pkgsrc (sqlite installed with
/usr/pkg prefix):
| 
| $ CPPFLAGS="-I /usr/pkg/include" LDFLAGS="-L /usr/pkg/lib -R /usr/pkg/lib" make
| cc -g -O2  -I /usr/pkg/include -c -o bystand.o bystand.c
| cc -o bystand bystand.o -L /usr/pkg/lib -R /usr/pkg/lib -lsqlite3 -ldl -lpthread
| $ ldd bystand
|         linux-vdso32.so.1 =>  (0x00100000)
|         libsqlite3.so.0 => /usr/pkg/lib/libsqlite3.so.0 (0x0fed1000)
|         libdl.so.2 => /lib/powerpc-linux-gnu/libdl.so.2 (0x0fead000)
|         libpthread.so.0 => /lib/powerpc-linux-gnu/libpthread.so.0 (0x0fe72000)
|         libc.so.6 => /lib/powerpc-linux-gnu/libc.so.6 (0x0fcd6000)
|         libm.so.6 => /lib/powerpc-linux-gnu/libm.so.6 (0x0fc08000)
|         /lib/ld.so.1 (0x20746000)

[Superseded because of Copy&Paste error in the ldd line]
Re: The bystand newsreader
#263643
Author: Michael Bäuerle
Date: Sat, 13 Jul 2019 11:24
18 lines
1662 bytes
news@zzo38computer.org wrote:
> 
> [...]
> If you have any comments, [...]

Date header field:
Looks like you generate the timezone always as "+0000". If the timezone
is unknown, "-0000" would be the right choice.

RFC 5536 points to RFC 5322 for the date format:
<https://tools.ietf.org/html/rfc5536#section-3.1.1>
RFC 5322 says:
<https://tools.ietf.org/html/rfc5322#section-3.3>
| 
| [...] Though "-0000" also indicates Universal Time, it is used to
| indicate that the time was generated on a system that may be in a
| local time zone other than Universal Time and that the date-time
| contains no information about the local time zone.
Re: The bystand newsreader
#263645
Author: news
Date: Sat, 13 Jul 2019 16:00
12 lines
1331 bytes
Michael <michael.baeuerle@gmx.net> wrote:
> 
> Date header field:
> Looks like you generate the timezone always as "+0000". If the timezone
> is unknown, "-0000" would be the right choice.

I am aware of that. However, the timezone isn't unknown; it uses UTC.
(However, perhaps I should add a local time option.)

If the timezone on your computer really is unknown, you could use:
 REPLACE(FORMAT_DATE(NOW()),'+','-')
(the plus sign occurs nowhere else in the date/time string)
Re: The bystand newsreader
#263646
Author: news
Date: Sat, 13 Jul 2019 16:00
46 lines
2618 bytes
Michael <michael.baeuerle@gmx.net> wrote:
> 
> news@zzo38computer.org wrote:
> > 
> > Hello, this is my first post to Usenet, ever. I hope that it is good.
> 
> Looks good, except for the missing MIME declaration (see below).
> 
> > [...]
> > If you have any comments, questions [...]
> 
> MIME support: [...]
> But it looks like you intentionally created a very small implementation
> without MIME support.

All headers are added by the template. Perhaps I should include an example
template file that the user can customize as needed. (Examples of
configuration (including schemas) would also be helpful, probably.)

However, I have now added the "MIME-Version: 1.0" header to this message.
(As far as I can tell, for sending, everything else is OK. However, some
of the other stuff MIME does could be helpful to implement too, for when
receiving or writing a follow-up message.)

> 
> ZIP archive:
> Maybe put the files into a directory named "product-version"
> ("bystand-0.2.1" in this case) before archiving it.
> This is common practice for source distributions.
> 

OK, I will do that; thank you.

> Build system:
> Currently there is none. Maybe add at least a Makefile like this: [...]
> 

OK, thank you for that suggestion. I will add that.

Note that what I originally have is actually executable as a shell script
(taking advantage of the fact that "#if 0" is treated as a comment by the
shell, but the C compiler will skip the stuff inside the #if block).

This program does not use threads, although in order to avoid having to
recompile SQLite without thread support, it uses -lpthread anyways. (This
could possibly be fixed in future.)
Re: The bystand newsreader
#263648
Author: Michael Bäuerle
Date: Wed, 17 Jul 2019 17:05
15 lines
1590 bytes
news@zzo38computer.org wrote:
> Michael <michael.baeuerle@gmx.net> wrote:
> > 
> > [...]
> > Build system:
> > Currently there is none. Maybe add at least a Makefile like this: [...]
> 
> OK, thank you for that suggestion. I will add that.

In Revision e65e4bc776 the last rule in Makefile has spaces before the
command:
| 
|         $(CC) -g -O2 $(CFLAGS) $(CPPFLAGS) -c -o $@ $*.c
  ^^^^^^^^
make requires a Tab (ASCII HT) at the marked position.
Re: The bystand newsreader
#263650
Author: Michael Bäuerle
Date: Wed, 17 Jul 2019 17:19
19 lines
1741 bytes
news@zzo38computer.org wrote:
> 
> [...] 
> If you have any comments, [...]

On NetBSD the build for revision e65e4bc776 fails because of MSG_MORE:
| 
| $ CPPFLAGS="-I /usr/pkg/include" LDFLAGS="-L /usr/pkg/lib -R /usr/pkg/lib" make
| cc -g -O2 -O2 -I /usr/pkg/include -c -o bystand.o bystand.c
| bystand.c: In function 'send_line':
| bystand.c:134:30: error: 'MSG_MORE' undeclared (first use in this function)
|      s=send(connection,data,m,MSG_MORE|MSG_NOSIGNAL);
                                ^
The POSIX standard for sys/socket.h [1] does not list it, likely a GNU
specific extension.


______________
[1] <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html>
Re: The bystand newsreader
#263651
Author: news
Date: Fri, 19 Jul 2019 20:07
27 lines
2050 bytes
Michael <michael.baeuerle@stz-e.de> wrote:
> 
> 
> On NetBSD the build for revision e65e4bc776 fails because of MSG_MORE:
> | 
> | $ CPPFLAGS="-I /usr/pkg/include" LDFLAGS="-L /usr/pkg/lib -R /usr/pkg/lib" make
> | cc -g -O2 -O2 -I /usr/pkg/include -c -o bystand.o bystand.c
> | bystand.c: In function 'send_line':
> | bystand.c:134:30: error: 'MSG_MORE' undeclared (first use in this function)
> |      s=send(connection,data,m,MSG_MORE|MSG_NOSIGNAL);
>                                 ^
> The POSIX standard for sys/socket.h [1] does not list it, likely a GNU
> specific extension.
> 
> 
> ______________
> [1] <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html>

Thank you. I have added a #ifndef command to check for that; if MSG_MORE
is not defined then it defines MSG_MORE as zero. (Hopefully this will work.
If it still won't work (maybe because MSG_MORE is important somehow), then
hopefully you can figure out what is wrong with it, and I will correct it.)

-- 
Note: I am not always able to read/post messages during Monday-Friday.
Also, the email address in the "From" header is undeliverable. (It is my
domain name, so I do have control over it, though.)
Re: The bystand newsreader
#263652
Author: news
Date: Fri, 19 Jul 2019 20:08
25 lines
1717 bytes
Michael <michael.baeuerle@stz-e.de> wrote:
> 
> 
> news@zzo38computer.org wrote:
> > Michael <michael.baeuerle@gmx.net> wrote:
> > > 
> > > [...]
> > > Build system:
> > > Currently there is none. Maybe add at least a Makefile like this: [...]
> > 
> > OK, thank you for that suggestion. I will add that.
> 
> In Revision e65e4bc776 the last rule in Makefile has spaces before the
> command:
> | 
> |         $(CC) -g -O2 $(CFLAGS) $(CPPFLAGS) -c -o $@ $*.c
>   ^^^^^^^^
> make requires a Tab (ASCII HT) at the marked position.

Thank you; I fixed that problem now.

-- 
Note: I am not always able to read/post messages during Monday-Friday.
Also, the email address in the "From" header is undeliverable. (It is my
domain name, so I do have control over it, though.)
Re: The bystand newsreader
#263653
Author: Michael Bäuerle
Date: Sat, 20 Jul 2019 08:49
27 lines
1985 bytes
news@zzo38computer.org wrote:
> 
> [Quoted from signature]
> Also, the email address in the "From" header is undeliverable. (It is my
> domain name, so I do have control over it, though.)

Even if this is syntactically valid and does not use foreign namespace,
I recommend not to do it this way. People may waste time trying to send
mail while thinking the address is valid.
RFC 2606 [1] defines the top level domain "invalid" for the purpose of
making invalidity obvious. Suggestion:

   news@zzo38computer.org.invalid

If you want to use "news@zzo38computer.org" as a name, maybe use the
"name-addr" construct defined in RFC 5322 [2] in combination with an
invalid address:

   "news@zzo38computer.org" <foo@bar.invalid>

A "quoted-string" is required for "display-name" here (because @ and dot
are not allowed in "atom").


______________
[1] <https://tools.ietf.org/html/rfc2606#page-2>
[2] <https://tools.ietf.org/html/rfc5322#section-3.4>
Re: The bystand newsreader
#263654
Author: news
Date: Sat, 20 Jul 2019 15:14
22 lines
1862 bytes
Michael <michael.baeuerle@gmx.net> wrote:
> 
> news@zzo38computer.org wrote:
> > 
> > [Quoted from signature]
> > Also, the email address in the "From" header is undeliverable. (It is my
> > domain name, so I do have control over it, though.)
> 
> Even if this is syntactically valid and does not use foreign namespace,
> I recommend not to do it this way. People may waste time trying to send
> mail while thinking the address is valid.
> RFC 2606 [1] defines the top level domain "invalid" for the purpose of
> making invalidity obvious. Suggestion:
> 
>    news@zzo38computer.org.invalid

I was aware of that but did not think to use that. However, now I used your
suggestion and I put that in my template file.

-- 
Note: I am not always able to read/post messages during Monday-Friday (but
sometimes I am able to do so).
Re: The bystand newsreader
#263655
Author: Michael Bäuerle
Date: Sat, 20 Jul 2019 16:19
22 lines
2207 bytes
news@zzo38computer.org.invalid wrote:
> Michael <michael.baeuerle@gmx.net> wrote:
> > news@zzo38computer.org wrote:
> > > 
> > > [Quoted from signature]
> > > Also, the email address in the "From" header is undeliverable. (It is my
> > > domain name, so I do have control over it, though.)
> > 
> > Even if this is syntactically valid and does not use foreign namespace,
> > I recommend not to do it this way. People may waste time trying to send
> > mail while thinking the address is valid.
> > RFC 2606 [1] defines the top level domain "invalid" for the purpose of
> > making invalidity obvious. Suggestion:
> > 
> >    news@zzo38computer.org.invalid
> 
> I was aware of that but did not think to use that. However, now I used your
> suggestion and I put that in my template file.

Thank you. If I now try to "Reply by e-mail" in my newsreader, an error
popup is generated and no ressources (personal and network) are wasted:
<http://micha.freeshell.org/tmp/2019-07-20_flnews_invalid_email.png>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads