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)