Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Avoid gunfire in the bathroom tonight.


rocksolid / Rocksolid Nodes Announce / Features added for InterBBS mail

SubjectAuthor
o Features added for InterBBS mailRetro Guy

1
Subject: Features added for InterBBS mail
From: Retro Guy
Newsgroups: rocksolid.nodes.announce
Organization: RetroBBS
Date: Wed, 9 Aug 2023 17:21 UTC
Path: eternal-september.org!news.eternal-september.org!i2pn.org!i2pn2.org!.POSTED!not-for-mail
From: retro.guy@rocksolidbbs.com (Retro Guy)
Newsgroups: rocksolid.nodes.announce
Subject: Features added for InterBBS mail
Date: Wed, 9 Aug 2023 17:21:36 +0000
Organization: RetroBBS
Message-ID: <cd87cb3f10d371a606b9bfa60ea37a10@rocksolidbbs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="1924412"; mail-complaints-to="usenet@i2pn2.org";
posting-account="qk6pvs/sIyKYNRNFdjVS+ghlZZkCUq7cWs+7p7kaLpU";
User-Agent: Rocksolid Light 0.8.5
X-Rslight-Posting-User: 7f2224730128256930309c9186f6203084896743
X-Face: .&YR-G(w(DZ$$,}%k=]*5*!p'=(anr"IT`wZG'2VWdfl\r)l[42u7JH`n(JUQ*e5*A|XCDf
?&\X&uwkl38"CYX3O8m}C8E4p'%N$2#kSTVzx{Ly|DjLT\Vk7NE}NQ(VC$Yq]i:7|z[.9iv^g>*8_B
H0=hZt'[%)4kG|
X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on i2pn2.org
X-Rslight-Site: $2y$10$zX40oVIZKE6xHMrwH0LT5OiXItS/CTnUX.YZ7W61wgHJDkPtimGwO
View all headers

The following features have been added to interBBS Mail:

Check for a KEY first, before sending a notification post of where to find your key.

Move incoming BBSMAIL posts to /processed or /failed for future inspection if necessary, then prune those directories of messages > 30 days old.

Try to get the KEY for a target domain when a user tries to send mail to that domain. If we can get the KEY, the mail succeeds. If we can NOT get the KEY, the mail fails with a useable message to the sender.

To apply these changes, update:

mail.php
interBBS_mail.php

Then add the following two functions to newsportal.php:

function prune_dir_by_days($path, $days) {
if($filenames = array_diff(scandir($path), array('..', '.'))) {
foreach($filenames as $file) {
$filelastmodified = filemtime($path . $file);
if((time() - $filelastmodified) > $days*86400)
{
if(is_file($path . $file)) {
unlink($path . $file);
}
}
}
} else {
return false;
}
return true;
}

function send_admin_message($admin, $from, $subject, $message) {
global $config_dir, $spooldir;
if(($to = get_config_value('aliases.conf', strtolower($admin))) == false) {
$to = strtolower($admin);
}
$to = trim($to);
$from = $to;
$database = $spooldir.'/mail.db3';
$dbh = mail_db_open($database);
if(!$dbh) {
echo "Database errorn";
return false;
}
$date = time();
$msgid = '<'.md5(strtolower($to).strtolower($from).strtolower($subject).strtolower($message)).'>';
$sql = 'INSERT OR IGNORE INTO messages(msgid, mail_from, rcpt_to, rcpt_target, date, subject, message, from_hide, to_hide, mail_viewed, rcpt_viewed) VALUES(?,?,?,?,?,?,?,?,?,?,?)';
$stmt = $dbh->prepare($sql);
$target = "local";
$mail_viewed = "true";
$rcpt_viewed = null;
$q = $stmt->execute([$msgid, $from, $to, $target, $date, $subject, $message, null, null, false, false]);

$dbh = null;
return true;
}

--
Retro Guy

1

rocksolid light 0.9.8
clearnet tor