From 7cb2fc2f54b87538b33328a9c2f1b41f466626d4 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Thu, 31 Oct 2002 19:41:25 +0000 Subject: [PATCH] Now echomail also honors the pack mail switch --- ChangeLog | 5 ++ TODO | 2 - html/setup/nodes.html | 4 +- mbfido/Makefile | 2 +- mbfido/postecho.c | 25 +++++-- mbfido/scan.c | 159 ++++++++++++++++++++++++------------------ mbsetup/m_node.c | 6 +- 7 files changed, 121 insertions(+), 82 deletions(-) diff --git a/ChangeLog b/ChangeLog index f059e173..e1e0eb77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,8 @@ v0.35.05 19-Oct-2002 Added in screen 1.14 settings for Plus All, Notify, Passwd and Pause. Removed the default Virnet record from the fidonet setup. + In node setup the pack netmail switch is renamed and is now + for all mail. mbfido: With ticfile processing, the KeepDate setup setting now works. @@ -42,6 +44,9 @@ v0.35.05 19-Oct-2002 Plus All, Notify, Passwd, Message, Tic on/off and Pause. The AreaMgr reuqests now honor the setting of the switches Plus All, Notify, Passwd and Pause. + Echomail is now also packed or not according to the packmail + switch in mbsetup. + Statistics count for exported echomail now works. mbtask: Removed debug logging of "does" info. diff --git a/TODO b/TODO index 4cbef8b2..9209d5ee 100644 --- a/TODO +++ b/TODO @@ -90,8 +90,6 @@ mbfido: N: Force processing of arealists so that all tags are forced to uppercase. - N: Echomail is packed when mail for a node is set to unpacked. - mbcico: L: Implement modem connect response translation for ISDN lines, i.e. make the CAUSE responses human readable. see McMail for this diff --git a/html/setup/nodes.html b/html/setup/nodes.html index cf14663b..c1c4cf00 100644 --- a/html/setup/nodes.html +++ b/html/setup/nodes.html @@ -12,7 +12,7 @@
-
Last update 28-Sep-2002
+
Last update 31-Oct-2002

MBSE BBS Setup - Fidonet nodes.

@@ -61,7 +61,7 @@ netmail to this node. to this node. Netmail holdPut mail on "hold" for this node. -Pack netmailShould netmail be packed in +Pack mailShould net- and echomail be packed in arcmail archives. Send notifySend automatic generated notify messages. diff --git a/mbfido/Makefile b/mbfido/Makefile index 48d8249a..df259eff 100644 --- a/mbfido/Makefile +++ b/mbfido/Makefile @@ -179,7 +179,7 @@ maketags.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/ mbmsg.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/dbcfg.h ../lib/mberrors.h post.h mbmsg.h newspost.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h newspost.h postemail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h postemail.h -scan.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msg.h ../lib/clcomm.h ../lib/msgtext.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h tracker.h ftn2rfc.h rfc2ftn.h postemail.h scan.h +scan.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/msg.h ../lib/clcomm.h ../lib/msgtext.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h tracker.h ftn2rfc.h rfc2ftn.h rollover.h postemail.h scan.h toberep.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h tic.h toberep.h atoul.o: ../config.h ../lib/libs.h ../lib/memwatch.h atoul.h filemgr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h ../lib/diesel.h sendmail.h mgrutil.h createf.h filemgr.h diff --git a/mbfido/postecho.c b/mbfido/postecho.c index 1be6b359..0a40b60c 100644 --- a/mbfido/postecho.c +++ b/mbfido/postecho.c @@ -80,12 +80,25 @@ int EchoOut(fidoaddr, char *, char *, char *, FILE *, int, int, time_t); */ int EchoOut(fidoaddr aka, char *toname, char *fromname, char *subj, FILE *fp, int flags, int cost, time_t date) { - char *buf; + char *buf, ext[4]; FILE *qp; faddr *From, *To; int rc; - if ((qp = OpenPkt(msgs.Aka, aka, (char *)"qqq")) == NULL) { + /* + * Pack flavor for echomail packets. + */ + memset(&ext, 0, sizeof(ext)); + if (nodes.PackNetmail) + sprintf(ext, (char *)"qqq"); + else if (nodes.Crash) + sprintf(ext, (char *)"ccc"); + else if (nodes.Hold) + sprintf(ext, (char *)"hhh"); + else + sprintf(ext, (char *)"nnn"); + + if ((qp = OpenPkt(msgs.Aka, aka, (char *)ext)) == NULL) { WriteError("EchoOut(): OpenPkt failed"); return 1; } @@ -496,10 +509,12 @@ int postecho(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, time_t m StatAdd(&nodes.MailSent, 1L); UpdateNode(); SearchNode(tmpq->aka); + echo_out++; + if (EchoOut(tmpq->aka, t->name, f->name, subj, nfp, flags, cost, mdate)) + WriteError("Forward echomail to %s failed", aka2str(tmpq->aka)); + } else { + WriteError("Forward echomail to %s failed, noderecord not found", aka2str(tmpq->aka)); } - echo_out++; - if (EchoOut(tmpq->aka, t->name, f->name, subj, nfp, flags, cost, mdate)) - WriteError("Forward echomail to %s failed", aka2str(tmpq->aka)); } } diff --git a/mbfido/scan.c b/mbfido/scan.c index c82af214..b2da34d3 100644 --- a/mbfido/scan.c +++ b/mbfido/scan.c @@ -44,6 +44,7 @@ #include "tracker.h" #include "ftn2rfc.h" #include "rfc2ftn.h" +#include "rollover.h" #include "postemail.h" #include "scan.h" @@ -573,86 +574,106 @@ int RescanOne(faddr *L, char *marea, unsigned long Num) */ void ExportEcho(sysconnect L, unsigned long MsgNum, fa_list **sbl) { - char *p; - int seenlen, oldnet, flags = 0; - char sbe[16]; - fa_list *tmpl; - FILE *qp; - faddr *from, *dest; - int is_pid = FALSE; + int seenlen, oldnet, flags = 0, is_pid = FALSE; + char *p, sbe[16], ext[4]; + fa_list *tmpl; + FILE *qp; + faddr *from, *dest; - if ((!L.sendto) || L.pause || L.cutoff) - return; + if ((!L.sendto) || L.pause || L.cutoff) + return; - Syslog('M', "Export to %s", aka2str(L.aka)); + Syslog('M', "Export to %s", aka2str(L.aka)); - if ((qp = OpenPkt(msgs.Aka, L.aka, (char *)"qqq")) == NULL) - return; + if (!SearchNode(L.aka)) { + WriteError("Can't send to %s, noderecord not found", aka2str(L.aka)); + return; + } - flags |= (Msg.Private) ? M_PVT : 0; - from = fido2faddr(msgs.Aka); - dest = fido2faddr(L.aka); - AddMsgHdr(qp, from, dest, flags, 0, Msg.Written, Msg.To, Msg.From, Msg.Subject); - tidy_faddr(from); - tidy_faddr(dest); - fprintf(qp, "AREA:%s\r", msgs.Tag); + /* + * Add statistics count + */ + StatAdd(&nodes.MailSent, 1L); + UpdateNode(); + SearchNode(L.aka); + + memset(&ext, 0, sizeof(ext)); + if (nodes.PackNetmail) + sprintf(ext, (char *)"qqq"); + else if (nodes.Crash) + sprintf(ext, (char *)"ccc"); + else if (nodes.Hold) + sprintf(ext, (char *)"hhh"); + else + sprintf(ext, (char *)"nnn"); - if (Msg_Read(MsgNum, 78)) { - if ((p = (char *)MsgText_First()) != NULL) { - do { - if ((strncmp(p, " * Origin:", 10) == 0) && !is_pid) { - /* - * If there was no PID kludge, insert the TID - * kludge anyway. - */ - fprintf(qp, "\001TID: MBSE-FIDO %s\r", VERSION); - } - fprintf(qp, "%s", p); - if (strncmp(p, " * Origin:", 10) == 0) - break; + if ((qp = OpenPkt(msgs.Aka, L.aka, (char *)ext)) == NULL) + return; - /* - * Only append CR if not the last line - */ - fprintf(qp, "\r"); + flags |= (Msg.Private) ? M_PVT : 0; + from = fido2faddr(msgs.Aka); + dest = fido2faddr(L.aka); + AddMsgHdr(qp, from, dest, flags, 0, Msg.Written, Msg.To, Msg.From, Msg.Subject); + tidy_faddr(from); + tidy_faddr(dest); + fprintf(qp, "AREA:%s\r", msgs.Tag); - /* - * Append ^aTID line behind the PID. - */ - if (strncmp(p, "\001PID", 4) == 0) { - fprintf(qp, "\001TID: MBSE-FIDO %s\r", VERSION); - is_pid = TRUE; - } - - } while ((p = (char *)MsgText_Next()) != NULL); + if (Msg_Read(MsgNum, 78)) { + if ((p = (char *)MsgText_First()) != NULL) { + do { + if ((strncmp(p, " * Origin:", 10) == 0) && !is_pid) { + /* + * If there was no PID kludge, insert the TID + * kludge anyway. + */ + fprintf(qp, "\001TID: MBSE-FIDO %s\r", VERSION); } - } + fprintf(qp, "%s", p); + if (strncmp(p, " * Origin:", 10) == 0) + break; - seenlen = MAXSEEN + 1; - /* - * Ensure that it will not match the first entry. - */ - oldnet = (*sbl)->addr->net - 1; - for (tmpl = *sbl; tmpl; tmpl = tmpl->next) { - if (tmpl->addr->net == oldnet) - sprintf(sbe, " %u", tmpl->addr->node); - else - sprintf(sbe, " %u/%u", tmpl->addr->net, tmpl->addr->node); - oldnet = tmpl->addr->net; - seenlen += strlen(sbe); - if (seenlen > MAXSEEN) { - seenlen = 0; - fprintf(qp, "\rSEEN-BY:"); - sprintf(sbe, " %u/%u", tmpl->addr->net, tmpl->addr->node); - seenlen = strlen(sbe); + /* + * Only append CR if not the last line + */ + fprintf(qp, "\r"); + + /* + * Append ^aTID line behind the PID. + */ + if (strncmp(p, "\001PID", 4) == 0) { + fprintf(qp, "\001TID: MBSE-FIDO %s\r", VERSION); + is_pid = TRUE; } - fprintf(qp, "%s", sbe); - } - fprintf(qp, "\r\001PATH: %u/%u\r", msgs.Aka.net, msgs.Aka.node); - putc(0, qp); - fclose(qp); - echo_out++; + } while ((p = (char *)MsgText_Next()) != NULL); + } + } + + seenlen = MAXSEEN + 1; + /* + * Ensure that it will not match the first entry. + */ + oldnet = (*sbl)->addr->net - 1; + for (tmpl = *sbl; tmpl; tmpl = tmpl->next) { + if (tmpl->addr->net == oldnet) + sprintf(sbe, " %u", tmpl->addr->node); + else + sprintf(sbe, " %u/%u", tmpl->addr->net, tmpl->addr->node); + oldnet = tmpl->addr->net; + seenlen += strlen(sbe); + if (seenlen > MAXSEEN) { + seenlen = 0; + fprintf(qp, "\rSEEN-BY:"); + sprintf(sbe, " %u/%u", tmpl->addr->net, tmpl->addr->node); + seenlen = strlen(sbe); + } + fprintf(qp, "%s", sbe); + } + fprintf(qp, "\r\001PATH: %u/%u\r", msgs.Aka.net, msgs.Aka.node); + putc(0, qp); + fclose(qp); + + echo_out++; } diff --git a/mbsetup/m_node.c b/mbsetup/m_node.c index 064fc21b..901cfb39 100644 --- a/mbsetup/m_node.c +++ b/mbsetup/m_node.c @@ -667,7 +667,7 @@ void GeneralScreen(void) mvprintw(15, 2, "9. Netmail direct"); mvprintw(16, 2, "10. Netmail crash"); mvprintw(17, 2, "11. Netmail hold"); - mvprintw(18, 2, "12. Pack netmail"); + mvprintw(18, 2, "12. Pack mail"); mvprintw(16,42, "13. Send notify"); mvprintw(17,42, "14. Language"); @@ -736,7 +736,7 @@ void GeneralEdit(void) if (nodes.Hold) nodes.Crash = FALSE; break; - case 12:E_BOOL(18,23, nodes.PackNetmail, "^Pack netmail^ for this node") + case 12:E_BOOL(18,23, nodes.PackNetmail, "^Pack mail^ for this node") case 13:E_BOOL(16,63, nodes.Notify, "Send ^notify^ messages to this node") case 14:i = PickLanguage((char *)"7.1.14"); if (i != '\0') @@ -1464,7 +1464,7 @@ int node_doc(FILE *fp, FILE *toc, int page) fprintf(fp, " Mail direct %s", getboolean(nodes.Direct)); fprintf(fp, " Mail crash %s", getboolean(nodes.Crash)); fprintf(fp, " Mail hold %s\n", getboolean(nodes.Hold)); - fprintf(fp, " Pack Netmail %s", getboolean(nodes.PackNetmail)); + fprintf(fp, " Pack mail %s", getboolean(nodes.PackNetmail)); fprintf(fp, " Send notify %s", getboolean(nodes.Notify)); fprintf(fp, " Language %c\n", nodes.Language); fprintf(fp, " No EMSI %s", getboolean(nodes.NoEMSI));