• src/sbbs3/js_msgbase.c

    From rswindell@VERT to CVS commit on Sat Apr 4 15:07:05 2020
    src/sbbs3 js_msgbase.c 1.256 1.257
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv1155

    Modified Files:
    js_msgbase.c
    Log Message:
    Bug: a get_mg_header() followed by a put_msg_header() would add a header field (SMTPREVERSEPATH a.k.a. "reverse_path") if it didn't already have one.
    That's because smb_getmsghdr() will point the msg.reverse_path convenience pointer to the from_net_addr if there was no explicit reverse-path (e.g. RFC822's
    "return-path" header field). This could manifest itself in *any* change to a message header via JS failing with an "illegal header length increase" error if the added header field just happen to put the total header length over the allocation threshold of the pre-existing msg header.

    Fix: only model a msg header "reverse_path" property if the header field actually existed (not based on the SMBLIB convenience pointer).
    When the expand_fields option is used, the old behavior remains but expanded headers cannot be written back to the base, so no harm there.

    Reported by Coz in #synchronet from failed runs of scrubmsgs.js. Thanks!


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Sun Apr 5 22:18:01 2020
    src/sbbs3 js_msgbase.c 1.257 1.258
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv9320

    Modified Files:
    js_msgbase.c
    Log Message:
    MsgBase.open() would not, could not, actually create a message base.
    It would create 3 0-byte files (*.shd, *.sdt, *.sid), but more is actually needed for a message base to be "created" (i.e. a call to smb_create()).
    So, MsgBase.open() now uses smb_open_sub() rather than smb_open() to initialize theSMB status fields with the proper default values (based on the sysop configuration) and calls smb_crate() if the header file is empty.
    Yes, normally, SCFG creates message bases, but it shouldn't have to
    (e.g. a fresh install on *nix, doesn't actually start with any files in data/subs) and now that we have JavaScript-based message lister/readers, we really needed this support.


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Fri Apr 24 03:08:03 2020
    src/sbbs3 js_msgbase.c 1.259 1.260
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv8971

    Modified Files:
    js_msgbase.c
    Log Message:
    The RECIPIENTLIST header field would get removed (converted to an RFC822TO header field) when saving a message using the MsgBase class.
    A similar problem existed with REPLYTOLIST/RFC822REPLYTO, but was not actually observed.
    Since the following header fields were not populated in the msg header "field_list", if they existed in a message header that was modified using
    the MsgBase class, they would be lost:
    - RFC822TO
    - RFC822CC
    - RFC822ORG
    - RFC822REPLYTO
    - RFC822SUBJECT


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thu May 7 12:29:10 2020
    src/sbbs3 js_msgbase.c 1.260 1.261
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/tmp/cvs-serv3023

    Modified Files:
    js_msgbase.c
    Log Message:
    Allow an added or modified message header to have to/from/reply-to "net type" values of NET_NONE. This is a weird scenario, but it is technically possible (e.g. for nntpservice.js) to save a message with a to/from/treply-to "net address" header, but an associated net-type of NET_NONE. By saving the net-type NET_NONE, when saving a modified header, if the associated net address header field value cannot be parsed into a valid network address, there won't be any error reported, e.g.
    Error -110 adding SENDERNETADDR field to message header


    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From rswindell@VERT to CVS commit on Thu May 7 14:58:38 2020
    src/sbbs3 js_msgbase.c 1.261 1.262
    Update of /cvsroot/sbbs/src/sbbs3
    In directory cvs:/home/rswindell/sbbs/src/sbbs3

    Modified Files:
    js_msgbase.c
    Log Message:
    Populate the *_net_type fields, even when set to NET_NONE (0), when the corresponding *_net_addr field is present (not NULL).



    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to sbbs/master on Sun Nov 22 08:14:40 2020
    https://gitlab.synchro.net/sbbs/sbbs/-/commit/325b9b76b4ace104d93cc220
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Resolve newish gcc warning about unused set variable.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun May 23 04:44:37 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/4c2ec210bbee64521dd85b36
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Fix mime_version and content_type property names in JSDOCS

    Underscores are more JS friendly (and correct).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Jul 11 05:58:26 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/e53c5926508c739c27c4d67c
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Ignore the PRIVATE message attribute for the "mail" base

    When setting the value of a message's 'can_read' property, ignore the PRIVATE message attribute (which is sometimes set in FTN netmail messages) since it's assumed all messages in the mail base are private, no special destination (to) name matching is needed here.

    This only popped up recently via msglist.js because of the recent addition of checking each messages's 'can_read' property.

    As reported by <Diehard> via IRC PM.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun Apr 17 21:20:59 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/4f8f844f38f103e3f1ca4a4c
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Fix LAZY_BOOLEAN macro definition

    This is what was causing the 'is_utf8' message header property to be created as a Number instead of a Boolean.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Apr 21 22:09:52 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/1e62752ab8340af66f18f0b0
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Restore ability for MsgBase.open() to open an arbitrary SMB msgbase

    Before commit 5da26eca, you could pass Msgbase() the path to an SMB
    on the disk and open() it, no configuration needed. As of 2 years
    ago, I broke that, and passing a path to an SMB would open the "mail" base instead - most unexpected. This is a feature of smb_open_sub() which we switched to using (from smb_open()), so go back to using smb_open() when
    an unrecognized code is pass to the constructor.

    This has the negative consequence that the "mail" base can't be created
    via JS. Probably should fix that.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Thu Apr 21 22:09:52 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/dc4b1bd9350a5581fa410c7f
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Use smb_open_sub() for the "mail" base too

    This restores the ability for JS MsgBase() to be used to create the
    initial mail message base properly, if needed.

    This means that the 'subnum' should now be equal to scfg.total_subs
    when referencing an arbitrary SMB via path (not in the configuration).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sun May 8 11:31:19 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/323ff1e8198df77405409ab2
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Remember the last 'first_msg' property value after msgbase is closed

    The other msgbase property values are stored in the smb.status or other private_t members which retain their value when the message base is closed, unlike the 'first_msg' property which required a read of the message base index to get the value (and that doesn't work when the message base is closed, so would return 0).

    for deon (ALTERANT)

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Nov 19 23:02:14 2022
    https://gitlab.synchro.net/main/sbbs/-/commit/6c5cb01c0979e74332c314e4
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Fix return return value when methods auto-open a message base (e.g. save_msg())

    js_open() sets the rval for the context (e.g. to JSVAL_TRUE), so we need to set it back to JSVAL_FALSE for failure conditions. Otherwise, the methods always return true even upon (save-msg) failure.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Wed Mar 29 12:52:05 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/fe14b001e563ea3b10c82cbf
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    MsgBase.save_msg() throw an exception when an empty recipient list is provided

    ... rather than just return false.

    This will make debugging this type of issue much easier in the future. sendmail.js was allowing empty recipient_list array arguments and the MsgBase .status was 0 and .error just an emtpy string - unhelpful.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Mon May 8 06:22:44 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/d5e8981d0631d766b37a061f
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    MsgBase.save_msg() docs says only one argument is required

    So use js_argc() to report an error if there's fewer than 1 argument, but
    don't just fail silently when 2 arguments are provided.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows)@VERT to Git commit to main/sbbs/master on Tue May 9 01:07:50 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/de41e1b7a314ceaacfb6c321
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Use js_argc() to generate the helpful exception when insufficient args used

    ... rather than just failing silently with a special return value
    (e.g. false).

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Wed Dec 13 19:11:22 2023
    https://gitlab.synchro.net/main/sbbs/-/commit/33e1817edbda217eb5d23cbb
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    Log the number of bytes that were attempted to be allocated

    ... in malloc error reporting messages

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat Mar 2 16:15:48 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/82b9cbe85972cfdbd1ff5255
    Modified Files:
    src/sbbs3/js_msgbase.c
    Log Message:
    More use of JS_ValueToECMAUint32 in place of JS_ValueToInt32

    To support the full 32-bit range for things like dates/times, and message numbers (!).

    This should fix issue #732

    Though dates beyond Feb 7 2106 are definitely going to still be an issue. I'll definitley look into solving that by the the 2100.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net