• Per-user/individual email blocking/email address filter

    From Eric Oulashin@1:103/705 to GitLab issue in main/sbbs on Tue Jun 9 17:46:46 2026
    open https://gitlab.synchro.net/main/sbbs/-/issues/1162

    Synchronet currently has a global email address, which uses the text/email.can file. Would it be feasible for Synchronet to have per-user email filtering/blocking as well?

    Nelgin had expressed interest in that feature as part of DDMsgReader, and I had some ideas on that - DDMsgReader could allow the user to edit their own list of disallowed email addresses, and for those email addresses, DDMsgReader could simply mark it as deleted (if not already) and not show the email, but I'm wondering if it could be better if this feature was part of Synchronet itself. I had Cursor (AI) look at the Synchronet code and see how the email filter currently works, and it looks like for any email address in email.can, Synchronet will send an error back to the sender (such as 554 Sender Not Allowed, etc.). If a user has an an email address in their own personal email filter list and an email is sent to them, perhaps Synchronet could behave the same as with the global email filter?
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell@1:103/705 to GitLab note in main/sbbs on Tue Jun 9 19:03:02 2026
    https://gitlab.synchro.net/main/sbbs/-/issues/1162#note_9316

    You could do this kind of filtering already, with no change to the mailserver, by using an "external mail processor" (https://wiki.synchro.net/server:mail#external_mail_processors), something like:
    ```

    // These lines open the processing error output file as a new File object.
    // If there are any processing errors (e.g. filtered context, blocked sender), // you can reject the message by simply writing some text to 'errfile'.
    var errfile = new File(processing_error_filename);
    if(!errfile.open("w")) {
    alert("Failed to open " + processing_error_filename);
    exit();
    }


    // These lines open the message text file in append mode (writing to the end) var msgtxt = new File(message_text_filename);
    if(!msgtxt.open("a+")) { // Change the mode to "r+" for "read/update" access
    alert("Failed to open " + message_text_filename);
    exit();
    }

    // Create an object (associative array) of header field strings
    var header = parse_msg_header(msgtxt.readAll());

    var rcptlst = new File(recipient_list_filename);
    if(!rcptlst.open("r")) {
    alert("Failed to open " + recipient_list_filename);
    exit();
    }
    var recipients = rcptlst.iniGetAllObjects("number");

    for (var i = 0; recipients && i < recipients.length; ++i) {
    var recipient = recipients[i];
    if (system.trashcan(system.data_dir + format("%04u", recipient.number) + ".email.can", header.from)) {
    errfile.writeln("A mail processing error occurred. Message rejected.");
    exit();
    }
    }
    ```
    Then your mail reader could let the user create/modify that data/user/####.email.can file. This example rejects the mail if *any* of the recipients have it blocked, but could probably be corrected by re-writing the recipient list excluding just the user(s) for which the mail was blocked, if you cared.
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)