Skip to content
Snippets Groups Projects
Commit 99312621 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add/use new text.dat strings for received Fido and Internet mail

- InternetMailReceived
- InternetMailForwarded
- FidoNetMailReceived
- WithAttachment
- FidoEchoMailReceived

For The Millionaire, closing issue #254

The first string (suppressed with %.0s) is an optional date/time stamp.

This also deprecates (removes support for) the [mail] NewMailNotice and ForwardNotice keys from sbbs.ini.
parent 6d1e6239
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2779 passed
...@@ -4008,13 +4008,13 @@ static void smtp_thread(void* arg) ...@@ -4008,13 +4008,13 @@ static void smtp_thread(void* arg)
p++; p++;
} }
safe_snprintf(str,sizeof(str) safe_snprintf(str,sizeof(str)
,startup->newmail_notice ,text[InternetMailReceived]
,timestr(&scfg,newmsg.hdr.when_imported.time,tmp) ,timestr(&scfg,newmsg.hdr.when_imported.time,tmp)
,sender, p); ,sender, p);
if(newmsg.hdr.auxattr&MSG_HFIELDS_UTF8) if(newmsg.hdr.auxattr&MSG_HFIELDS_UTF8)
utf8_to_cp437_inplace(str); utf8_to_cp437_inplace(str);
if(!newmsg.idx.to) /* Forwarding */ if(!newmsg.idx.to) /* Forwarding */
sprintf(str+strlen(str), startup->forward_notice, rcpt_addr); sprintf(str+strlen(str), text[InternetMailForwarded], rcpt_addr);
putsmsg(&scfg, usernum, str); putsmsg(&scfg, usernum, str);
} }
} }
......
...@@ -87,8 +87,6 @@ typedef struct { ...@@ -87,8 +87,6 @@ typedef struct {
char inbound_sound[INI_MAX_VALUE_LEN]; char inbound_sound[INI_MAX_VALUE_LEN];
char outbound_sound[INI_MAX_VALUE_LEN]; char outbound_sound[INI_MAX_VALUE_LEN];
char pop3_sound[INI_MAX_VALUE_LEN]; char pop3_sound[INI_MAX_VALUE_LEN];
char newmail_notice[INI_MAX_VALUE_LEN];
char forward_notice[INI_MAX_VALUE_LEN];
/* Misc */ /* Misc */
char host_name[128]; char host_name[128];
......
...@@ -609,11 +609,6 @@ void sbbs_read_ini( ...@@ -609,11 +609,6 @@ void sbbs_read_ini(
,iniGetString(list,section,"OutboundSound",nulstr,value)); ,iniGetString(list,section,"OutboundSound",nulstr,value));
sbbs_get_sound_settings(list, section, &mail->sound, &global->sound); sbbs_get_sound_settings(list, section, &mail->sound, &global->sound);
SAFECOPY(mail->newmail_notice
,iniGetString(list,section,"NewMailNotice","%.0s\1n\1mNew e-mail from \1h%s \1n<\1h%s\1n>\r\n", value));
SAFECOPY(mail->forward_notice
,iniGetString(list,section,"ForwardNotice","\1n\1mand it was automatically forwarded to: \1h%s\1n\r\n", value));
/* JavaScript Operating Parameters */ /* JavaScript Operating Parameters */
sbbs_get_js_settings(list, section, &mail->js, &global->js); sbbs_get_js_settings(list, section, &mail->js, &global->js);
...@@ -1126,12 +1121,6 @@ BOOL sbbs_write_ini( ...@@ -1126,12 +1121,6 @@ BOOL sbbs_write_ini(
if(!sbbs_set_sound_settings(lp, section, &mail->sound, &global->sound, &style)) if(!sbbs_set_sound_settings(lp, section, &mail->sound, &global->sound, &style))
break; break;
#if 0
if(!iniSetStringLiteral(lp,section,"NewMailNotice",mail->newmail_notice,&style))
break;
if(!iniSetStringLiteral(lp,section,"ForwardNotice",mail->forward_notice,&style))
break;
#endif
/* JavaScript Operating Parameters */ /* JavaScript Operating Parameters */
if(!sbbs_set_js_settings(lp,section,&mail->js,&global->js,&style)) if(!sbbs_set_js_settings(lp,section,&mail->js,&global->js,&style))
break; break;
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include "msg_id.h" #include "msg_id.h"
#include "scfgsave.h" #include "scfgsave.h"
#include "getmail.h" #include "getmail.h"
#include "text.h"
#include "git_branch.h" #include "git_branch.h"
#include "git_hash.h" #include "git_hash.h"
...@@ -95,6 +96,7 @@ fidoaddr_t sys_faddr = {1,1,1,0}; /* Default system address: 1:1/1.0 */ ...@@ -95,6 +96,7 @@ fidoaddr_t sys_faddr = {1,1,1,0}; /* Default system address: 1:1/1.0 */
sbbsecho_cfg_t cfg; sbbsecho_cfg_t cfg;
scfg_t scfg; scfg_t scfg;
char compiler[32]; char compiler[32];
char* text[TOTAL_TEXT];
bool pause_on_exit=false; bool pause_on_exit=false;
bool pause_on_abend=false; bool pause_on_abend=false;
...@@ -4538,10 +4540,10 @@ int import_netmail(const char* path, const fmsghdr_t* inhdr, FILE* fp, const cha ...@@ -4538,10 +4540,10 @@ int import_netmail(const char* path, const fmsghdr_t* inhdr, FILE* fp, const cha
addr.net=hdr.orignet; addr.net=hdr.orignet;
addr.node=hdr.orignode; addr.node=hdr.orignode;
addr.point=hdr.origpoint; addr.point=hdr.origpoint;
safe_snprintf(str, sizeof(str), "\7\1n\1hSBBSecho: \1m%.*s \1n\1msent you NetMail%s from \1h%s\1n\r\n" safe_snprintf(str, sizeof(str), text[FidoNetMailReceived]
,FIDO_NAME_LEN-1 ,timestr(&scfg, time32(NULL), tmp)
,hdr.from ,hdr.from
,hdr.attr&FIDO_FILE ? " with attachment" : "" ,hdr.attr&FIDO_FILE ? text[WithAttachment] : ""
,smb_faddrtoa(&addr,NULL)); ,smb_faddrtoa(&addr,NULL));
putsmsg(&scfg,usernumber,str); putsmsg(&scfg,usernumber,str);
} }
...@@ -5989,9 +5991,10 @@ void import_packets(const char* inbound, nodecfg_t* inbox, bool secure) ...@@ -5989,9 +5991,10 @@ void import_packets(const char* inbound, nodecfg_t* inbox, bool secure)
if(i!=cfg.badecho && cfg.echomail_notify && (user.number=lookup_user(&scfg, &user_list, hdr.to))!=0 if(i!=cfg.badecho && cfg.echomail_notify && (user.number=lookup_user(&scfg, &user_list, hdr.to))!=0
&& getuserdat(&scfg, &user)==0 && getuserdat(&scfg, &user)==0
&& can_user_read_sub(&scfg, cfg.area[i].sub, &user, NULL)) { && can_user_read_sub(&scfg, cfg.area[i].sub, &user, NULL)) {
sprintf(str char tmp[128];
,"\7\1n\1hSBBSecho: \1m%.*s \1n\1msent you EchoMail on \1h%s \1n\1m%s\1n\r\n" safe_snprintf(str, sizeof(str)
,FIDO_NAME_LEN-1 ,text[FidoEchoMailReceived]
,timestr(&scfg, time32(NULL), tmp)
,hdr.from ,hdr.from
,scfg.grp[scfg.sub[cfg.area[i].sub]->grp]->sname ,scfg.grp[scfg.sub[cfg.area[i].sub]->grp]->sname
,scfg.sub[cfg.area[i].sub]->sname); ,scfg.sub[cfg.area[i].sub]->sname);
...@@ -6217,7 +6220,7 @@ int main(int argc, char **argv) ...@@ -6217,7 +6220,7 @@ int main(int argc, char **argv)
printf("\nLoading configuration files from %s\n", scfg.ctrl_dir); printf("\nLoading configuration files from %s\n", scfg.ctrl_dir);
scfg.size=sizeof(scfg); scfg.size=sizeof(scfg);
SAFECOPY(str,UNKNOWN_LOAD_ERROR); SAFECOPY(str,UNKNOWN_LOAD_ERROR);
if(!load_cfg(&scfg, /* text: */NULL, /* prep: */true, /* node: */false, str, sizeof(str))) { if(!load_cfg(&scfg, text, /* prep: */true, /* node: */false, str, sizeof(str))) {
fprintf(stderr,"!ERROR %s\n",str); fprintf(stderr,"!ERROR %s\n",str);
fprintf(stderr,"!Failed to load configuration files\n"); fprintf(stderr,"!Failed to load configuration files\n");
bail(1); bail(1);
......
...@@ -866,6 +866,11 @@ enum { ...@@ -866,6 +866,11 @@ enum {
,AllKey ,AllKey
,All ,All
,ListKey ,ListKey
,InternetMailReceived
,InternetMailForwarded
,FidoNetMailReceived
,WithAttachment
,FidoEchoMailReceived
,TOTAL_TEXT ,TOTAL_TEXT
}; };
......
...@@ -1404,4 +1404,13 @@ const char * const text_defaults[TOTAL_TEXT]={ ...@@ -1404,4 +1404,13 @@ const char * const text_defaults[TOTAL_TEXT]={
,"\x41" // 853 AllKey ,"\x41" // 853 AllKey
,"\x41\x6c\x6c" // 854 All ,"\x41\x6c\x6c" // 854 All
,"\x4c" // 855 ListKey ,"\x4c" // 855 ListKey
,"\x25\x2e\x30\x73\x01\x6e\x01\x6d\x49\x6e\x74\x65\x72\x6e\x65\x74\x20\x65\x2d\x6d\x61\x69\x6c\x20\x66\x72\x6f\x6d\x20\x01\x68\x25"
"\x73\x20\x01\x6e\x3c\x01\x68\x25\x73\x01\x6e\x3e\x0d\x0a" // 856 InternetMailReceived
,"\x01\x6e\x01\x6d\x61\x6e\x64\x20\x69\x74\x20\x77\x61\x73\x20\x61\x75\x74\x6f\x6d\x61\x74\x69\x63\x61\x6c\x6c\x79\x20\x66\x6f\x72"
"\x77\x61\x72\x64\x65\x64\x20\x74\x6f\x3a\x20\x01\x68\x25\x73\x01\x6e\x0d\x0a" // 857 InternetMailForwarded
,"\x25\x2e\x30\x73\x01\x6e\x01\x68\x01\x6d\x25\x73\x20\x01\x6e\x01\x6d\x73\x65\x6e\x74\x20\x79\x6f\x75\x20\x4e\x65\x74\x4d\x61\x69"
"\x6c\x25\x73\x20\x66\x72\x6f\x6d\x20\x01\x68\x25\x73\x01\x6e\x0d\x0a" // 858 FidoNetMailReceived
,"\x20\x77\x69\x74\x68\x20\x61\x74\x74\x61\x63\x68\x6d\x65\x6e\x74" // 859 WithAttachment
,"\x25\x2e\x30\x73\x01\x6e\x01\x68\x01\x6d\x25\x73\x20\x01\x6e\x01\x6d\x73\x65\x6e\x74\x20\x79\x6f\x75\x20\x45\x63\x68\x6f\x4d\x61"
"\x69\x6c\x20\x6f\x6e\x20\x01\x68\x25\x73\x20\x01\x6e\x01\x6d\x25\x73\x01\x6e\x0d\x0a" // 860 FidoEchoMailReceived
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment