Add global music player, invoicing/payment system, account subpages, mail account admin, and the qualityiron.vegas Jet 2.0 port
Jet interpreter (Tag.cpp, __call.cpp, __imap*.cpp/h, __smtpsend.cpp/h, __imapemptyfolder.cpp/h - new): assorted parser/tag fixes found across this work - a stray literal-tag-in-comment and backslash-quote parser corruption class, a dangling-pointer fix, a __call.cpp fd leak, IMAP folder-management tags, multi-account/per-host IMAP support, and a smtpsend Message-ID fix. barant.com site (jetc/barant-site/): - A site-wide persistent music player (header band, playlist/queue, stereo FFT EQ, session-persisted state) fed by new library/ ianslibrary/music song-list subpages. - /account split into info/phones/invoices subpages; a full invoicing and Square payment system (create/edit/copy/pay/email invoice); admin invoice management and mail-account management subpages. - /services split into overview/hosting/siptrunking/documents subpages, retiring the old standalone pages. - SIPPHONE.tag: a Jet 2.0 WebRTC softphone tag. - main.css/spa.js/email.js: the SPA loading indicator, the music player band styling, and assorted fixes accumulated alongside this work. qualityiron-site/: the qualityiron.vegas job/contractor/customer/ document management app, ported from its original Jet 1.4 codebase to Jet 2.0 as barant.coms APIServers second multi-tenant site. wcwc/wcwc.jet: the WCWC site Jet source (wcwc.jtc build output not included). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
905fbafa5a
commit
b8f7793773
406 files changed
+15803
-587
No files matched your search
@@ -10,6 +10,8 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
namespace jet {
|
||||
|
||||
@@ -88,10 +90,31 @@ namespace jet {
|
||||
return std::string(buf);
|
||||
}
|
||||
|
||||
// RFC 5322 3.6.4: Message-ID "SHOULD be present" - in practice
|
||||
// several real receivers (confirmed live: Gmail) now hard-reject
|
||||
// anything missing one ("550 5.7.1 Messages missing a valid
|
||||
// Message-ID header are not accepted") rather than just marking it
|
||||
// down, so this isn't optional in practice. Domain part is the
|
||||
// sender's own domain (everything after '@' in `from`), matching
|
||||
// RFC 5322's own recommendation that it be a name under the
|
||||
// generating system's control - falls back to the literal `from`
|
||||
// string in the (should-never-happen) case it has no '@' at all.
|
||||
std::string __smtpsend::generateMessageId(const std::string &from) {
|
||||
size_t at = from.find('@');
|
||||
std::string domainPart = (at == std::string::npos) ? from : from.substr(at + 1);
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_REALTIME, &ts);
|
||||
std::ostringstream idStream;
|
||||
idStream << ts.tv_sec << "." << std::setfill('0') << std::setw(9) << ts.tv_nsec
|
||||
<< "." << rand() << "@" << domainPart;
|
||||
return idStream.str();
|
||||
}
|
||||
|
||||
std::string __smtpsend::buildMessage(const std::string &from, const std::string &to,
|
||||
const std::string &subject, const std::string &html) {
|
||||
std::string msg;
|
||||
msg += "Date: " + rfc2822Date() + "\r\n";
|
||||
msg += "Message-ID: <" + generateMessageId(from) + ">\r\n";
|
||||
msg += "From: " + from + "\r\n";
|
||||
msg += "To: " + to + "\r\n";
|
||||
msg += "Subject: " + subject + "\r\n";
|
||||
|
||||
Reference in new issue
Block a user