From 766bbe358d961346b239ffe868d1477567046f41 Mon Sep 17 00:00:00 2001 From: Dave Hibberd Date: Sun, 7 Jul 2024 16:06:08 +0100 Subject: [PATCH] New upstream version 6.0.24.40 --- BBSHTMLConfig.c | 4 + BBSUtilities.c | 39 +- BPQChat.vcproj.LAPTOP-Q6S4RP5Q.johnw.user | 65 - BPQChat.vcproj.NOTTSDESKTOP.John.user | 65 - BPQChat.vcproj.SKIGACER.johnw.user | 65 - BPQMail.aps | Bin 91752 -> 91908 bytes BPQMail.c | 7 + BPQMail.rc | 11 +- BPQMail.sln | 20 + BPQMail.vcproj.NOTTSDESKTOP.John.user | 65 - BPQMail.vcproj.SKIGACER.johnw.user | 65 - BPQMail.vcxproj.user | 4 - BPQMailConfig.c | 2 + BPQMailrc.h | 1 + BPQWinAPP.vcproj.LAPTOP-Q6S4RP5Q.johnw.user | 65 - BPQWinAPP.vcproj.NOTTSDESKTOP.John.user | 65 - Bpq32.c | 3 + CBPQ32.vcproj.LAPTOP-Q6S4RP5Q.johnw.user | 65 - ...32.vcproj.NOTTSDESKTOP.John-notpi4-64.user | 65 - CBPQ32.vcproj.NOTTSDESKTOP.John.user | 65 - CBPQ32.vcproj.SKIGACER.johnw-notpi4-64.user | 65 - CBPQ32.vcproj.SKIGACER.johnw.user | 65 - ConfigWinRPR.vcxproj.user | 4 - MailNode.vcproj.NOTTSDESKTOP.John.user | 65 - MailNode.vcproj.SKIGACER.johnw.user | 65 - MailNode.vcxproj.user | 8 - MailRouting.c | 1194 +++++++++-------- Versions.h | 4 +- WinRPRHelper.vcproj.NOTTSDESKTOP.John.user | 65 - ...rControl.vcproj.LAPTOP-Q6S4RP5Q.johnw.user | 65 - WinmorControl.vcproj.NOTTSDESKTOP.John.user | 65 - bpqmail.h | 2 +- templatedefs.c | 16 +- 33 files changed, 699 insertions(+), 1725 deletions(-) delete mode 100644 BPQChat.vcproj.LAPTOP-Q6S4RP5Q.johnw.user delete mode 100644 BPQChat.vcproj.NOTTSDESKTOP.John.user delete mode 100644 BPQChat.vcproj.SKIGACER.johnw.user create mode 100644 BPQMail.sln delete mode 100644 BPQMail.vcproj.NOTTSDESKTOP.John.user delete mode 100644 BPQMail.vcproj.SKIGACER.johnw.user delete mode 100644 BPQMail.vcxproj.user delete mode 100644 BPQWinAPP.vcproj.LAPTOP-Q6S4RP5Q.johnw.user delete mode 100644 BPQWinAPP.vcproj.NOTTSDESKTOP.John.user delete mode 100644 CBPQ32.vcproj.LAPTOP-Q6S4RP5Q.johnw.user delete mode 100644 CBPQ32.vcproj.NOTTSDESKTOP.John-notpi4-64.user delete mode 100644 CBPQ32.vcproj.NOTTSDESKTOP.John.user delete mode 100644 CBPQ32.vcproj.SKIGACER.johnw-notpi4-64.user delete mode 100644 CBPQ32.vcproj.SKIGACER.johnw.user delete mode 100644 ConfigWinRPR.vcxproj.user delete mode 100644 MailNode.vcproj.NOTTSDESKTOP.John.user delete mode 100644 MailNode.vcproj.SKIGACER.johnw.user delete mode 100644 MailNode.vcxproj.user delete mode 100644 WinRPRHelper.vcproj.NOTTSDESKTOP.John.user delete mode 100644 WinmorControl.vcproj.LAPTOP-Q6S4RP5Q.johnw.user delete mode 100644 WinmorControl.vcproj.NOTTSDESKTOP.John.user diff --git a/BBSHTMLConfig.c b/BBSHTMLConfig.c index 80f2bca..c37533c 100644 --- a/BBSHTMLConfig.c +++ b/BBSHTMLConfig.c @@ -158,6 +158,7 @@ char MailPage[] = "%s's BBS Web Server" "Welcome Msgs & Prompts" "Housekeeping" "WP Update" + "WebMail" "Node Menu" ""; @@ -178,6 +179,7 @@ char RefreshMainPage[] = "" "Welcome Msgs & Prompts" "Housekeeping" "WP Update" + "WebMail" "Node Menu" ""; @@ -1887,6 +1889,7 @@ VOID SaveFwdCommon(struct HTTPConnectionInfo * Session, char * MsgPtr, char * Re GetCheckBox(input, "WarnNoRoute=", &WarnNoRoute); GetCheckBox(input, "LocalTime=", &Localtime); GetCheckBox(input, "SendPtoMultiple=", &SendPtoMultiple); + GetCheckBox(input, "FourCharCont=", &FOURCHARCONT); // Reinitialise Aliases @@ -2716,6 +2719,7 @@ VOID SendFwdMainPage(char * Reply, int * RLen, char * Key) (WarnNoRoute) ? CHKD : UNC, (Localtime) ? CHKD : UNC, (SendPtoMultiple) ? CHKD : UNC, + (FOURCHARCONT) ? CHKD : UNC, ALIASES); } diff --git a/BBSUtilities.c b/BBSUtilities.c index 6c542ba..d62b3c5 100644 --- a/BBSUtilities.c +++ b/BBSUtilities.c @@ -213,6 +213,7 @@ BOOL UserCantKillT = FALSE; typedef int (WINAPI FAR *FARPROCX)(); FARPROCX pRunEventProgram; +FARPROCX pGetPortFrequency; int RunEventProgram(char * Program, char * Param); @@ -9680,6 +9681,7 @@ VOID SaveConfig(char * ConfigName) SaveIntValue(group, "WarnNoRoute", WarnNoRoute); SaveIntValue(group, "Localtime", Localtime); SaveIntValue(group, "SendPtoMultiple", SendPtoMultiple); + SaveIntValue(group, "FOURCHARCONT", FOURCHARCONT); SaveMultiStringValue(group, "FWDAliases", AliasText); @@ -10116,6 +10118,8 @@ BOOL GetConfig(char * ConfigName) ReaddressReceived = GetIntValue(group, "ReaddressReceived"); WarnNoRoute = GetIntValue(group, "WarnNoRoute"); SendPtoMultiple = GetIntValue(group, "SendPtoMultiple"); + FOURCHARCONT = GetIntValue(group, "FOURCHARCONT"); + Localtime = GetIntValue(group, "Localtime"); AliasText = GetMultiStringValue(group, "FWDAliases"); GetStringValue(group, "BBSName", BBSName); @@ -10588,8 +10592,24 @@ int Connected(int Stream) if (SendNewUserMessage) { + int64_t LongFreq = Freq; + char * MailBuffer = malloc(100); - Length += sprintf(MailBuffer, "New User %s Connected to Mailbox on Port %d Freq %d Mode %d\r\n", callsign, port, Freq, Mode); + + if (Freq == 0 && port) + { + // Get Port Freq if available + + char FreqString[256]; + +#ifdef WIN32 + if (pGetPortFrequency) + LongFreq = pGetPortFrequency(port, FreqString); +#else + LongFreq = GetPortFrequency(port, FreqString); +#endif + } + Length += sprintf(MailBuffer, "New User %s Connected to Mailbox on Port %d Freq %d Mode %ld\r\n", callsign, port, LongFreq, Mode); sprintf(Title, "New User %s", callsign); @@ -11754,9 +11774,8 @@ typedef struct _POPENRET */ void run_pgTimeoutThread( pid_t process ) { - - printf("watchdog thread: PID of subprocess: %d\n", process); - fflush(stdout); +// printf("watchdog thread: PID of subprocess: %d\n", process); +// fflush(stdout); Sleep(5000); // if still running PID (?) then kill. if ( getpgid(process) >= 0 ) @@ -11768,10 +11787,8 @@ void run_pgTimeoutThread( pid_t process ) Debugprintf("Failed to kill PG watchdog Process %d", process); } - - Debugprintf("watchdog thread: PID=%d Exit", process); - fflush(stdout); - //return; +// Debugprintf("watchdog thread: PID=%d Exit", process); +// fflush(stdout); } @@ -12638,7 +12655,6 @@ VOID ProcessLine(CIRCUIT * conn, struct UserInfo * user, char* Buffer, int len) #endif return; } - if (_memicmp(Cmd, "Node", 4) == 0) { ExpandAndSendMessage(conn, SignoffMsg, LOG_BBS); @@ -15757,8 +15773,10 @@ VOID GetPGConfig() strcat(FN, "PG/PGList.txt"); if ((file = fopen(FN, "r")) == NULL) + { return; - + } + while(fgets(buf, 255, file) != NULL) { if ( buf[0] == '#') @@ -15785,6 +15803,7 @@ VOID GetPGConfig() break; } + NUM_SERVERS = n; fclose(file); diff --git a/BPQChat.vcproj.LAPTOP-Q6S4RP5Q.johnw.user b/BPQChat.vcproj.LAPTOP-Q6S4RP5Q.johnw.user deleted file mode 100644 index 0cd9a72..0000000 --- a/BPQChat.vcproj.LAPTOP-Q6S4RP5Q.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQChat.vcproj.NOTTSDESKTOP.John.user b/BPQChat.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/BPQChat.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQChat.vcproj.SKIGACER.johnw.user b/BPQChat.vcproj.SKIGACER.johnw.user deleted file mode 100644 index b5b0536..0000000 --- a/BPQChat.vcproj.SKIGACER.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQMail.aps b/BPQMail.aps index 694b39f7766dad71d538e1d41d602f2a116248da..8e698f3d85c0ee070383c9430a923a9e0fc10b7e 100644 GIT binary patch delta 2016 zcmYk6e{2**6vyA&z3a6=p+LFzuF$(upwQBCzuLRwhp>0IZI|9J?)KVJO0V<>1p>6t zB9ce|!yiOMS|&1(NNFM(Oi(0;fe=*wz=*Mu7|~#YsL?1yMgP#m1mZcfdk{C-o%j8` zH*aR%%@R(=N!%=|=8$gDEGYn)X1xt^=B^hk~5c-3>5B*HJa81$bfVGmzp5ec+v@ zld#&Dh($Q_L*Y}T#u#uqVER)asT??A29mLp#jA>*WeaichM61$(-EmXl5Aqg<%C%} z3Miql(kQD+MCRNDvrm{ULNSt=v>4|QhqY|N>pV-q{3DQa6>V=l1iETsfv(MF|-e0a))c2ZX| zZ%&2oX-+iDVLiGY=9BJ{(s`A+KJk#G%E4wyjYxWc7ZxCqPFoHvtSgw>Gn;-TeQ#ysMS$0981b=N;DK}(;Qx?%Vmyh+6T+H z4yKb*tIP_=C+PRq3(!Y4TIN>!5d!gbeC&j*kKu>q2yAPEQk0!mZ48$K zRv_7b)+(-K`6_mmxL7`RSXb!-E0K6Cp;f}=hUYj-N7%tof>Kha9$1Z}XkxB;4R^AO zz`bmyPL>5EB*#zNg(f6_oV8&y*>AO>Le5y{;@ZqL>qTF^n_WG?me&5=!y~)5?i_&m z4Rww>m#5C{?{v(E>3|i$9{&9?%PscoC1;W^;-ZXIJ!QauGnw{rQ5Zqu-0sU9?fgr? zd*onxBmR`RpZ>*ApomH+)&gv4&h0X>_Y@L)|69UFF>|YbH42AB^4@@%*ak+CTPN@g zxwLgQY2EUxa9PX*w-%u=DU#H-A>nH=^U1bqLqYCucD{_|vy%8g9uWs`3WEkM&v%1= z3VFuN7en2maL!1^N6h5+7iN>rku}2GT)u?xhJB9#uab&=mH2l?-lwp;m^uF1^(mFS zc8#%Ag58P)yHTnVm7}b}tc-3DkS$;uka3$O(>JkaY3APK-8$?b??0|WZ|2*_5fR@c zHQB22E6@w;01esfA-z^mX~%YM8rXl33}qY9lDU#yl24bKFki}p6EFbzP&1Lu9)uJO zLqFKT!`>ilflaVmvj$-&jKEg*?bj^s9fUrnhOc~M!l|uBF$r*C?3m5Cw*ue}E$qTd z9HLIv2#cR5_xF?=ud;|Cx{s6Q&*^vQ6<(I-xUDv z(H)!6h8O5D-dv~euts>rL2qxua^Z-RKH_cIL#Ow!<=mmQJ_9rT0~eZ#m~-U@qyru3H?al7K_-@UVlDl?4-MiC xU6oOxAI;+7PR&Xrv$A7^1ittLXWDEM*&^*$=pVm)kA)ghn=F*?$ac`-1=g delta 1794 zcmYk6X>3$g6vxlGGt*6$Vms5$beYnHwv3&gs5r!V##>#du`<<^UgcJ|NotP z@45HQ%irs6&FIE_1)SVHj# z2R19LTmtU605(`fFX;7~RxcOx3G9G;0lcY@yE_!?;K*)+H7fE*zMvHF$EA>8a63GR z)Xa*H7A(CXh2u+NGZd;c80onGr54buJQ4Fp?-!h4SQb1sXmhnXp-3fBzuV`F`eU(R z#On?UsTGRG4Aabh0RmR3Ux*v{7Fz%+XZHA5Pdr6}}HONGDDkYSsxQloD--K{FrK2DK^*Bz+37 zLmgdHtUp?>;$+m_758_?6|EW8FH*iJDcqG%aSJpo);Q4j)LzBugbgb41|uEm{O6~%S$i1nUdz+tkLd>ZRnvgz!rm)VcT77;`qC+VB_}Em$_t)c5R$#M( zo!%@iFgTVKZzn%&!rlzcG|yN^TKI{X(4&)XHP&D&9Wj>bT?n48N5!B~zgoKu+UVQH zg0hE1os?*EDiRJ#VZYLGUXCBhjdadv#&-Ibv7qQ-#TQBh)>2tB7QhSfJ5>^4O1%8S9 zuNm95{^hhPO4r=9zo_T_!^kixmJ}dv7`dv#x zgkB%WkUk>+GPoJZON5r~c@GJ_wC4nQgV651_sBUSC->zexk%`~{Uc0Ev+G{u{cLAnr?549{whEwqob)GjdW@* zUw48_ldL|C8!^rX(`Y6$*XZqQ7TqZwfR=rkMhBU`#qOrD9IM&NK5VMVTLEzGU!@E$ zby;i{So3pplm~u$LOig(J~UU2@xNI<8vk8U)cb9nT7VHVvKwY>WIyzwR&%Ec+0JTg z)SctK+rn~pqZ#vAy$BUd;(`3x#P;vTa?KqpvSAwytI$3W&TF7@>*|B~u=dh3a(TgWVaI)(|n9HmKsO5`n89=jUdKz>% diff --git a/BPQMail.c b/BPQMail.c index 2ca2985..e528f98 100644 --- a/BPQMail.c +++ b/BPQMail.c @@ -1133,6 +1133,10 @@ // Fix possible failure to update last listed count when user disconnects without using B command // Add short random delay (<30 secs) when forward new Messages immediately is enabled (35) // Fix Connect Script IDLETIME (38) +// Add "Mail Mgmt" to Webmail menu bar and "WebMail" to Mail Mgmt Menu (39) +// Improve "New User" frequency determination (39) +// Allow selection of 2 or 4 character country codes for forward processing (39) +// Fix Send P to multiple BBS's when routing on HR (40) #include "bpqmail.h" #include "winstdint.h" @@ -1150,6 +1154,7 @@ FARPROCX pDllBPQTRACE; FARPROCZ pGetLOC; FARPROCX pRefreshWebMailIndex; FARPROCX pRunEventProgram; +FARPROCX pGetPortFrequency; BOOL WINE = FALSE; @@ -1924,6 +1929,8 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) pGetLOC = GetProcAddress(ExtDriver,"_GetLOC@0"); pRefreshWebMailIndex = GetProcAddress(ExtDriver,"_RefreshWebMailIndex@0"); pRunEventProgram = GetProcAddress(ExtDriver,"_RunEventProgram@8"); + pGetPortFrequency = GetProcAddress(ExtDriver,"_GetPortFrequency@8"); + if (pGetLOC) { diff --git a/BPQMail.rc b/BPQMail.rc index 75ae17f..440945c 100644 --- a/BPQMail.rc +++ b/BPQMail.rc @@ -387,16 +387,16 @@ BEGIN CONTROL "Warn if no route for P or T",IDC_WARNNOROUTE,"Button", BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_MULTILINE | WS_TABSTOP,5,101,103,8 - LTEXT "Aliases",IDC_STATIC,5,144,57,13 - EDITTEXT IDC_ALIAS,4,162,99,81,ES_MULTILINE | ES_UPPERCASE | + LTEXT "Aliases",IDC_STATIC,5,165,57,13 + EDITTEXT IDC_ALIAS,4,183,99,81,ES_MULTILINE | ES_UPPERCASE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL CONTROL "Readdress Locally Input",IDC_READDRESSLOCAL,"Button", BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_MULTILINE | - WS_DISABLED | WS_TABSTOP,4,246,97,8 + WS_DISABLED | WS_TABSTOP,4,267,97,8 CONTROL "Readdress Received",IDC_READDRESSRXED,"Button", BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_MULTILINE | - WS_DISABLED | WS_TABSTOP,4,260,97,8 + WS_DISABLED | WS_TABSTOP,4,281,97,8 GROUPBOX "Per-BBS Params",IDC_STATIC,121,33,326,263 LTEXT "BBS",IDC_STATIC,128,46,57,10 COMBOBOX IDC_BBS,122,59,50,60,CBS_SIMPLE | CBS_OEMCONVERT | @@ -471,6 +471,9 @@ BEGIN WS_TABSTOP,5,130,103,8 LTEXT "Incoming Connect Timeout",IDC_STATIC,125,278,95,12 EDITTEXT IDC_CONTIMEOUT,219,276,22,12,ES_AUTOHSCROLL + CONTROL "Use 4 Char Continent Codes",IDC_FOURCHARCONTINENT, + "Button",BS_AUTOCHECKBOX | BS_LEFTTEXT | BS_MULTILINE | + WS_TABSTOP,6,146,103,8 END IDD_USERADDED_BOX DIALOG DISCARDABLE 176, 132, 129, 68 diff --git a/BPQMail.sln b/BPQMail.sln new file mode 100644 index 0000000..8861280 --- /dev/null +++ b/BPQMail.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C++ Express 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BPQMail", "BPQMail.vcproj", "{3766AA10-C777-4ED8-A83D-F1452DE9B665}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.ActiveCfg = Debug|Win32 + {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Debug|Win32.Build.0 = Debug|Win32 + {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.ActiveCfg = Release|Win32 + {3766AA10-C777-4ED8-A83D-F1452DE9B665}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/BPQMail.vcproj.NOTTSDESKTOP.John.user b/BPQMail.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/BPQMail.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQMail.vcproj.SKIGACER.johnw.user b/BPQMail.vcproj.SKIGACER.johnw.user deleted file mode 100644 index b5b0536..0000000 --- a/BPQMail.vcproj.SKIGACER.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQMail.vcxproj.user b/BPQMail.vcxproj.user deleted file mode 100644 index 6e2aec7..0000000 --- a/BPQMail.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/BPQMailConfig.c b/BPQMailConfig.c index 594881a..06aec1d 100644 --- a/BPQMailConfig.c +++ b/BPQMailConfig.c @@ -1867,6 +1867,7 @@ VOID SaveFWDConfig(HWND hDlg) MaxRXSize = GetDlgItemInt(hDlg, IDC_MAXRECV, &OK, FALSE); MaxAge = GetDlgItemInt(hDlg, IDC_MAXAGE, &OK, FALSE); SendPtoMultiple = IsDlgButtonChecked(hDlg, IDC_MULTIP); + FOURCHARCONT = IsDlgButtonChecked(hDlg, IDC_FOURCHARCONTINENT); // Reinitialise Aliases @@ -3249,6 +3250,7 @@ INT_PTR CALLBACK FwdEditDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARA CheckDlgButton(hDlg, IDC_WARNNOROUTE, WarnNoRoute); CheckDlgButton(hDlg, IDC_USELOCALTIME, Localtime); CheckDlgButton(hDlg, IDC_MULTIP, SendPtoMultiple); + CheckDlgButton(hDlg, IDC_FOURCHARCONTINENT, FOURCHARCONT); CurrentBBS = NULL; diff --git a/BPQMailrc.h b/BPQMailrc.h index 750d898..8b29d46 100644 --- a/BPQMailrc.h +++ b/BPQMailrc.h @@ -319,6 +319,7 @@ #define ID_MULTICAST 40024 #define IDC_DEFAULTNOWINLINK 41001 #define IDC_MULTIP 41002 +#define IDC_FOURCHARCONTINENT 41003 // Next default values for new objects // diff --git a/BPQWinAPP.vcproj.LAPTOP-Q6S4RP5Q.johnw.user b/BPQWinAPP.vcproj.LAPTOP-Q6S4RP5Q.johnw.user deleted file mode 100644 index 0cd9a72..0000000 --- a/BPQWinAPP.vcproj.LAPTOP-Q6S4RP5Q.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user b/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/BPQWinAPP.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/Bpq32.c b/Bpq32.c index d333e5a..7059a56 100644 --- a/Bpq32.c +++ b/Bpq32.c @@ -1217,6 +1217,9 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // Fix potential buffer overflow in Telnet login (36) // Allow longer serial device names (37) // Fix ICF8101 Mode setting (37) +// Kill link if we are getting repeated RR(F) after timeout +// (Indicating other station is seeing our RR(P) but not the resent I frame) (40) + #define CKernel diff --git a/CBPQ32.vcproj.LAPTOP-Q6S4RP5Q.johnw.user b/CBPQ32.vcproj.LAPTOP-Q6S4RP5Q.johnw.user deleted file mode 100644 index ddedde2..0000000 --- a/CBPQ32.vcproj.LAPTOP-Q6S4RP5Q.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcproj.NOTTSDESKTOP.John-notpi4-64.user b/CBPQ32.vcproj.NOTTSDESKTOP.John-notpi4-64.user deleted file mode 100644 index f4ba73a..0000000 --- a/CBPQ32.vcproj.NOTTSDESKTOP.John-notpi4-64.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcproj.NOTTSDESKTOP.John.user b/CBPQ32.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index 270b67b..0000000 --- a/CBPQ32.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcproj.SKIGACER.johnw-notpi4-64.user b/CBPQ32.vcproj.SKIGACER.johnw-notpi4-64.user deleted file mode 100644 index 03fb73a..0000000 --- a/CBPQ32.vcproj.SKIGACER.johnw-notpi4-64.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/CBPQ32.vcproj.SKIGACER.johnw.user b/CBPQ32.vcproj.SKIGACER.johnw.user deleted file mode 100644 index 03fb73a..0000000 --- a/CBPQ32.vcproj.SKIGACER.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/ConfigWinRPR.vcxproj.user b/ConfigWinRPR.vcxproj.user deleted file mode 100644 index 6e2aec7..0000000 --- a/ConfigWinRPR.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/MailNode.vcproj.NOTTSDESKTOP.John.user b/MailNode.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index 34131b7..0000000 --- a/MailNode.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/MailNode.vcproj.SKIGACER.johnw.user b/MailNode.vcproj.SKIGACER.johnw.user deleted file mode 100644 index b5b0536..0000000 --- a/MailNode.vcproj.SKIGACER.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/MailNode.vcxproj.user b/MailNode.vcxproj.user deleted file mode 100644 index 3ea46b0..0000000 --- a/MailNode.vcxproj.user +++ /dev/null @@ -1,8 +0,0 @@ - - - - c:\linbpq\linbpq.exe - c:\linbpq - WindowsLocalDebugger - - \ No newline at end of file diff --git a/MailRouting.c b/MailRouting.c index 6916f2c..ff6feca 100644 --- a/MailRouting.c +++ b/MailRouting.c @@ -29,9 +29,9 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses // Bulls should not be distributed outside their designated area. -// Use 4 char continent codes if this isn't defined +// Use 4 char continent codes if this is set -#define TWOCHARCONT +int FOURCHARCONT = 0; #include "bpqmail.h" @@ -71,266 +71,266 @@ struct Country struct Continent Continents[] = { - "EURO", "EU", // Europe - "MEDR", "EU", // Mediterranean - "ASIA", "AS", // The Orient - "INDI", "AS", // Indian Ocean including the Indian subcontinent - "MDLE", "AS", // Middle East - "SEAS", "AS", // South-East Asia - "NOAM", "NA", // North America (Canada, USA, Mexico) - "CEAM", "NA", // Central America - "CARB", "NA", // Caribbean - "SOAM", "SA", // South America - "AUNZ", "OC", // Australia/New Zealand - "EPAC", "OC", // Eastern Pacific - "NPAC", "OC", // Northern Pacific - "SPAC", "OC", // Southern Pacific - "WPAC", "OC", // Western Pacific - "NAFR", "AF", // Northern Africa - "CAFR", "AF", // Central Africa - "SAFR", "AF", // Southern Africa - "ANTR", "OC", // Antarctica - "MARS", "MARS", // Special for MARS network + "EURO", "EU", // Europe + "MEDR", "EU", // Mediterranean + "ASIA", "AS", // The Orient + "INDI", "AS", // Indian Ocean including the Indian subcontinent + "MDLE", "AS", // Middle East + "SEAS", "AS", // South-East Asia + "NOAM", "NA", // North America (Canada, USA, Mexico) + "CEAM", "NA", // Central America + "CARB", "NA", // Caribbean + "SOAM", "SA", // South America + "AUNZ", "OC", // Australia/New Zealand + "EPAC", "OC", // Eastern Pacific + "NPAC", "OC", // Northern Pacific + "SPAC", "OC", // Southern Pacific + "WPAC", "OC", // Western Pacific + "NAFR", "AF", // Northern Africa + "CAFR", "AF", // Central Africa + "SAFR", "AF", // Southern Africa + "ANTR", "OC", // Antarctica + "MARS", "MARS", // Special for MARS network }; struct Country Countries[] = { - "AFG", "****", "AS", // Afghanistan - "ALA", "EURO", "EU", // Åland Islands - "ALB", "EURO", "EU", // Albania - "DZA", "NAFR", "AF", // Algeria - "ASM", "****", "AS", // American Samoa - "AND", "EURO", "EU", // Andorra - "AGO", "CAFR", "AF", // Angola - "AIA", "CARB", "NA", // Anguilla - "ATG", "CARB", "NA", // Antigua and Barbuda - "ARG", "SOAM", "SA", // Argentina - "ARM", "****", "AS", // Armenia - "ABW", "CARB", "NA", // Aruba - "AUS", "AUNZ", "OC", // Australia - "AUT", "EURO", "EU", // Austria - "AZE", "****", "AS", // Azerbaijan - "BHS", "CARB", "NA", // Bahamas - "BHR", "MDLE", "AS", // Bahrain - "BGD", "INDE", "AS", // Bangladesh - "BRB", "CARB", "NA", // Barbados - "BLR", "EURO", "EU", // Belarus - "BEL", "EURO", "EU", // Belgium - "BLZ", "CEAM", "NA", // Belize - "BEN", "CAFR", "AF", // Benin - "BMU", "CARB", "NA", // Bermuda - "BTN", "ASIA", "AS", // Bhutan - "BOL", "SOAM", "SA", // Bolivia (Plurinational State of) - "BIH", "EURO", "EU", // Bosnia and Herzegovina - "BWA", "****", "AF", // Botswana - "BRA", "SOAM", "SA", // Brazil - "VGB", "CARB", "NA", // British Virgin Islands - "BRN", "ASIA", "AS", // Brunei Darussalam - "BGR", "EURO", "EU", // Bulgaria - "BFA", "CAFR", "AF", // Burkina Faso - "BDI", "CAFR", "AF", // Burundi - "KHM", "****", "AS", // Cambodia - "CMR", "CAFR", "AF", // Cameroon - "CAN", "NOAM", "NA", // Canada - "CPV", "NAFR", "AF", // Cape Verde - "CYM", "CARB", "NA", // Cayman Islands - "CAF", "CAFR", "AF", // Central African Republic - "TCD", "CAFR", "AF", // Chad - "CHL", "SOAM", "SA", // Chile - "CHN", "****", "AS", // China - "HKG", "****", "AS", // Hong Kong Special Administrative Region of China - "MAC", "****", "AS", // Macao Special Administrative Region of China - "COL", "****", "SA", // Colombia - "COM", "SAFR", "AF", // Comoros - "COG", "****", "AF", // Congo - "COK", "SPAC", "OC", // Cook Islands - "CRI", "CEAM", "NA", // Costa Rica - "CIV", "CAFR", "AF", // Côte d'Ivoire - "HRV", "EURO", "EU", // Croatia - "CUB", "CARB", "NA", // Cuba - "CYP", "EURO", "EU", // Cyprus - "CZE", "EURO", "EU", // Czech Republic - "PRK", "****", "AS", // Democratic People's Republic of Korea - "COD", "****", "AF", // Democratic Republic of the Congo - "DNK", "EURO", "EU", // Denmark - "DJI", "NAFR", "AF", // Djibouti - "DMA", "CARB", "NA", // Dominica - "DOM", "CARB", "NA", // Dominican Republic - "ECU", "SOAM", "SA", // Ecuador - "EGY", "MDLE", "AF", // Egypt - "SLV", "CEAM", "NA", // El Salvador - "GNQ", "CAFR", "AF", // Equatorial Guinea - "ERI", "****", "AF", // Eritrea - "EST", "EURO", "EU", // Estonia - "ETH", "****", "AF", // Ethiopia - "FRO", "EURO", "EU", // Faeroe Islands - "FLK", "SOAM", "SA", // Falkland Islands (Malvinas) - "FJI", "SPAC", "OC", // Fiji - "FIN", "EURO", "EU", // Finland - "FRA", "EURO", "EU", // France - "GUF", "SOAM", "SA", // French Guiana - "PYF", "SPAC", "OC", // French Polynesia - "GAB", "CAFR", "AF", // Gabon - "GMB", "CAFR", "AF", // Gambia - "GEO", "ASIA", "AS", // Georgia - "DEU", "EURO", "EU", // Germany - "GHA", "CAFR", "AF", // Ghana - "GIB", "EURO", "EU", // Gibraltar - "GRC", "EURO", "EU", // Greece - "GRL", "EURO", "EU", // Greenland - "GRD", "CARB", "NA", // Grenada - "GLP", "CARB", "NA", // Guadeloupe - "GUM", "SPAC", "OC", // Guam - "GTM", "CEAM", "NA", // Guatemala - "GGY", "EURO", "EU", // Guernsey - "GIN", "CAFR", "AF", // Guinea - "GNB", "CAFR", "AF", // Guinea-Bissau - "GUY", "SOAM", "SA", // Guyana - "HTI", "CARB", "NA", // Haiti - "VAT", "EURO", "EU", // Holy See - "HND", "CEAM", "NA", // Honduras - "HUN", "EURO", "EU", // Hungary - "ISL", "EURO", "EU", // Iceland - "IND", "INDI", "AS", // India - "IDN", "****", "AS", // Indonesia - "IRN", "MDLE", "AS", // Iran (Islamic Republic of) - "IRQ", "MDLE", "AS", // Iraq - "IRL", "EURO", "EU", // Ireland - "IMN", "EURO", "EU", // Isle of Man - "ISR", "MDLE", "AS", // Israel - "ITA", "EURO", "EU", // Italy - "JAM", "CEAM", "NA", // Jamaica - "JPN", "****", "AS", // Japan - "JEY", "EURO", "EU", // Jersey - "JOR", "MDLE", "AS", // Jordan - "KAZ", "****", "AS", // Kazakhstan - "KEN", "****", "AF", // Kenya - "KIR", "EPAC", "OC", // Kiribati - "KWT", "MDLE", "AS", // Kuwait - "KGZ", "ASIA", "AS", // Kyrgyzstan - "LAO", "ASIA", "AS", // Lao People's Democratic Republic - "LVA", "EURO", "EU", // Latvia - "LBN", "MDLE", "AS", // Lebanon - "LSO", "SAFR", "AF", // Lesotho - "LBR", "CAFR", "AF", // Liberia - "LBY", "MDLE", "AS", // Libyan Arab Jamahiriya - "LIE", "EURO", "EU", // Liechtenstein - "LTU", "EURO", "EU", // Lithuania - "LUX", "EURO", "EU", // Luxembourg - "MDG", "SAFR", "AF", // Madagascar - "MWI", "SAFR", "AF", // Malawi - "MYS", "ASIA", "AS", // Malaysia - "MDV", "INDI", "AS", // Maldives - "MLI", "CAFR", "AF", // Mali - "MLT", "EURO", "EU", // Malta - "MHL", "WPAC", "OC", // Marshall Islands - "MTQ", "CARB", "NA", // Martinique - "MRT", "NAFR", "AF", // Mauritania - "MUS", "SAFR", "AF", // Mauritius - "MYT", "SAFR", "AF", // Mayotte - "MEX", "****", "NA", // Mexico - "FSM", "WPAC", "OC", // Micronesia (Federated States of) - "MCO", "EURO", "EU", // Monaco - "MNG", "****", "AS", // Mongolia - "MNE", "EURO", "EU", // Montenegro - "MSR", "CARB", "NA", // Montserrat - "MAR", "NAFR", "AF", // Morocco - "MOZ", "SAFR", "AF", // Mozambique - "MMR", "ASIA", "AS", // Myanmar - "NAM", "****", "AF", // Namibia - "NRU", "WPAC", "OC", // Nauru - "NPL", "****", "AS", // Nepal - "NLD", "EURO", "EU", // Netherlands - "ANT", "CARB", "NA", // Netherlands Antilles - "NCL", "SPAC", "OC", // New Caledonia - "NZL", "AUNZ", "OC", // New Zealand - "NIC", "****", "SA", // Nicaragua - "NER", "NAFR", "AF", // Niger - "NGA", "****", "AF", // Nigeria - "NIU", "SPAC", "OC", // Niue - "NFK", "SPAC", "OC", // Norfolk Island - "MNP", "WPAC", "OC", // Northern Mariana Islands - "NOR", "EURO", "EU", // Norway - "PSE", "MDLE", "AS", // Occupied Palestinian Territory - "OMN", "MDLE", "AS", // Oman - "PAK", "INDI", "AS", // Pakistan - "PLW", "SPAC", "OC", // Palau - "PAN", "CEAM", "SA", // Panama - "PNG", "SPAC", "OC", // Papua New Guinea - "PRY", "SOAM", "SA", // Paraguay - "PER", "SOAM", "SA", // Peru - "PHL", "ASIA", "AS", // Philippines - "PCN", "SPAC", "OC", // Pitcairn - "POL", "EURO", "EU", // Poland - "PRT", "EURO", "EU", // Portugal - "PRI", "CARB", "NA", // Puerto Rico - "QAT", "MDLE", "AS", // Qatar - "KOR", "ASIA", "AS", // Republic of Korea - "MDA", "EURO", "EU", // Republic of Moldova - "REU", "SAFR", "AF", // Réunion - "ROU", "EURO", "EU", // Romania - "RUS", "ASIA", "AS", // Russian Federation - "RWA", "****", "AF", // Rwanda - "BLM", "CARB", "NA", // Saint-Barthélemy - "SHN", "SOAM", "SA", // Saint Helena - "KNA", "CARB", "NA", // Saint Kitts and Nevis - "LCA", "CARB", "NA", // Saint Lucia - "MAF", "CARB", "NA", // Saint-Martin (French part) - "SPM", "NOAM", "NA", // Saint Pierre and Miquelon - "VCT", "CARB", "NA", // Saint Vincent and the Grenadines - "WSM", "SPAC", "OC", // Samoa - "SMR", "EURO", "EU", // San Marino - "STP", "CAFR", "AF", // Sao Tome and Principe - "SAU", "MDLE", "AS", // Saudi Arabia - "SEN", "CAFR", "AF", // Senegal - "SRB", "EURO", "EU", // Serbia - "SYC", "SAFR", "AF", // Seychelles - "SLE", "****", "AF", // Sierra Leone - "SGP", "****", "AS", // Singapore - "SVK", "EURO", "EU", // Slovakia - "SVN", "EURO", "EU", // Slovenia - "SLB", "SPAC", "OC", // Solomon Islands - "SOM", "****", "AF", // Somalia - "ZAF", "SAFR", "AF", // South Africa - "ESP", "EURO", "EU", // Spain - "LKA", "INDE", "AS", // Sri Lanka - "SDN", "****", "AF", // Sudan - "SUR", "SOAM", "SA", // Suriname - "SJM", "EURO", "EU", // Svalbard and Jan Mayen Islands - "SWZ", "****", "AF", // Swaziland - "SWE", "EURO", "EU", // Sweden - "CHE", "EURO", "EU", // Switzerland - "SYR", "MDLE", "AS", // Syrian Arab Republic - "TJK", "ASIA", "AS", // Tajikistan - "THA", "****", "AS", // Thailand - "MKD", "EURO", "EU", // The former Yugoslav Republic of Macedonia - "TLS", "ASIA", "AS", // Timor-Leste - "TGO", "CAFR", "AF", // Togo - "TKL", "AUNZ", "OC", // Tokelau - "TON", "SPAC", "OC", // Tonga - "TTO", "CARB", "NA", // Trinidad and Tobago - "TUN", "****", "AF", // Tunisia - "TUR", "EURO", "EU", // Turkey - "TKM", "****", "AS", // Turkmenistan - "TCA", "CARB", "NA", // Turks and Caicos Islands - "TUV", "SPAC", "OC", // Tuvalu - "UGA", "****", "AF", // Uganda - "UKR", "EURO", "EU", // Ukraine - "ARE", "MDLE", "AS", // United Arab Emirates - "GBR", "EURO", "EU", // United Kingdom of Great Britain and Northern Ireland - "TZA", "****", "AF", // United Republic of Tanzania - "USA", "NOAM", "NA", // United States of America - "VIR", "CARB", "NA", // United States Virgin Islands - "URY", "SOAM", "SA", // Uruguay - "UZB", "ASIA", "AS", // Uzbekistan - "VUT", "SPAC", "OC", // Vanuatu - "VEN", "SOAM", "SA", // Venezuela (Bolivarian Republic of) - "VNM", "****", "AS", // Viet Nam - "WLF", "SPAC", "OC", // Wallis and Futuna Islands - "ESH", "****", "AF", // Western Sahara - "YEM", "****", "AF", // Yemen - "ZMB", "SAFR", "AF", // Zambia - "ZWE", "SAFR", "AF" // Zimbabwe + "AFG", "ASIA", "AS", // Afghanistan + "ALA", "EURO", "EU", // Åland Islands + "ALB", "EURO", "EU", // Albania + "DZA", "NAFR", "AF", // Algeria + "ASM", "ASIA", "AS", // American Samoa + "AND", "EURO", "EU", // Andorra + "AGO", "CAFR", "AF", // Angola + "AIA", "CARB", "NA", // Anguilla + "ATG", "CARB", "NA", // Antigua and Barbuda + "ARG", "SOAM", "SA", // Argentina + "ARM", "ASIA", "AS", // Armenia + "ABW", "CARB", "NA", // Aruba + "AUS", "AUNZ", "OC", // Australia + "AUT", "EURO", "EU", // Austria + "AZE", "ASIA", "AS", // Azerbaijan + "BHS", "CARB", "NA", // Bahamas + "BHR", "MDLE", "AS", // Bahrain + "BGD", "INDE", "AS", // Bangladesh + "BRB", "CARB", "NA", // Barbados + "BLR", "EURO", "EU", // Belarus + "BEL", "EURO", "EU", // Belgium + "BLZ", "CEAM", "NA", // Belize + "BEN", "CAFR", "AF", // Benin + "BMU", "CARB", "NA", // Bermuda + "BTN", "ASIA", "AS", // Bhutan + "BOL", "SOAM", "SA", // Bolivia (Plurinational State of) + "BIH", "EURO", "EU", // Bosnia and Herzegovina + "BWA", "SAFR", "AF", // Botswana + "BRA", "SOAM", "SA", // Brazil + "VGB", "CARB", "NA", // British Virgin Islands + "BRN", "ASIA", "AS", // Brunei Darussalam + "BGR", "EURO", "EU", // Bulgaria + "BFA", "CAFR", "AF", // Burkina Faso + "BDI", "CAFR", "AF", // Burundi + "KHM", "ASIA", "AS", // Cambodia + "CMR", "CAFR", "AF", // Cameroon + "CAN", "NOAM", "NA", // Canada + "CPV", "NAFR", "AF", // Cape Verde + "CYM", "CARB", "NA", // Cayman Islands + "CAF", "CAFR", "AF", // Central African Republic + "TCD", "CAFR", "AF", // Chad + "CHL", "SOAM", "SA", // Chile + "CHN", "ASIA", "AS", // China + "HKG", "ASIA", "AS", // Hong Kong Special Administrative Region of China + "MAC", "ASIA", "AS", // Macao Special Administrative Region of China + "COL", "ASIA", "SA", // Colombia + "COM", "SAFR", "AF", // Comoros + "COG", "CAFR", "AF", // Congo + "COK", "SPAC", "OC", // Cook Islands + "CRI", "CEAM", "NA", // Costa Rica + "CIV", "CAFR", "AF", // Côte d'Ivoire + "HRV", "EURO", "EU", // Croatia + "CUB", "CARB", "NA", // Cuba + "CYP", "EURO", "EU", // Cyprus + "CZE", "EURO", "EU", // Czech Republic + "PRK", "ASIA", "AS", // Democratic People's Republic of Korea + "COD", "CAFR", "AF", // Democratic Republic of the Congo + "DNK", "EURO", "EU", // Denmark + "DJI", "NAFR", "AF", // Djibouti + "DMA", "CARB", "NA", // Dominica + "DOM", "CARB", "NA", // Dominican Republic + "ECU", "SOAM", "SA", // Ecuador + "EGY", "MDLE", "AF", // Egypt + "SLV", "CEAM", "NA", // El Salvador + "GNQ", "CAFR", "AF", // Equatorial Guinea + "ERI", "NAFR", "AF", // Eritrea + "EST", "EURO", "EU", // Estonia + "ETH", "NAFR", "AF", // Ethiopia + "FRO", "EURO", "EU", // Faeroe Islands + "FLK", "SOAM", "SA", // Falkland Islands (Malvinas) + "FJI", "SPAC", "OC", // Fiji + "FIN", "EURO", "EU", // Finland + "FRA", "EURO", "EU", // France + "GUF", "SOAM", "SA", // French Guiana + "PYF", "SPAC", "OC", // French Polynesia + "GAB", "CAFR", "AF", // Gabon + "GMB", "CAFR", "AF", // Gambia + "GEO", "ASIA", "AS", // Georgia + "DEU", "EURO", "EU", // Germany + "GHA", "CAFR", "AF", // Ghana + "GIB", "EURO", "EU", // Gibraltar + "GRC", "EURO", "EU", // Greece + "GRL", "EURO", "EU", // Greenland + "GRD", "CARB", "NA", // Grenada + "GLP", "CARB", "NA", // Guadeloupe + "GUM", "SPAC", "OC", // Guam + "GTM", "CEAM", "NA", // Guatemala + "GGY", "EURO", "EU", // Guernsey + "GIN", "CAFR", "AF", // Guinea + "GNB", "CAFR", "AF", // Guinea-Bissau + "GUY", "SOAM", "SA", // Guyana + "HTI", "CARB", "NA", // Haiti + "VAT", "EURO", "EU", // Holy See + "HND", "CEAM", "NA", // Honduras + "HUN", "EURO", "EU", // Hungary + "ISL", "EURO", "EU", // Iceland + "IND", "INDI", "AS", // India + "IDN", "ASIA", "AS", // Indonesia + "IRN", "MDLE", "AS", // Iran (Islamic Republic of) + "IRQ", "MDLE", "AS", // Iraq + "IRL", "EURO", "EU", // Ireland + "IMN", "EURO", "EU", // Isle of Man + "ISR", "MDLE", "AS", // Israel + "ITA", "EURO", "EU", // Italy + "JAM", "CEAM", "NA", // Jamaica + "JPN", "ASIA", "AS", // Japan + "JEY", "EURO", "EU", // Jersey + "JOR", "MDLE", "AS", // Jordan + "KAZ", "ASIA", "AS", // Kazakhstan + "KEN", "CAFR", "AF", // Kenya + "KIR", "EPAC", "OC", // Kiribati + "KWT", "MDLE", "AS", // Kuwait + "KGZ", "ASIA", "AS", // Kyrgyzstan + "LAO", "ASIA", "AS", // Lao People's Democratic Republic + "LVA", "EURO", "EU", // Latvia + "LBN", "MDLE", "AS", // Lebanon + "LSO", "SAFR", "AF", // Lesotho + "LBR", "CAFR", "AF", // Liberia + "LBY", "MDLE", "AS", // Libyan Arab Jamahiriya + "LIE", "EURO", "EU", // Liechtenstein + "LTU", "EURO", "EU", // Lithuania + "LUX", "EURO", "EU", // Luxembourg + "MDG", "SAFR", "AF", // Madagascar + "MWI", "SAFR", "AF", // Malawi + "MYS", "ASIA", "AS", // Malaysia + "MDV", "INDI", "AS", // Maldives + "MLI", "CAFR", "AF", // Mali + "MLT", "EURO", "EU", // Malta + "MHL", "WPAC", "OC", // Marshall Islands + "MTQ", "CARB", "NA", // Martinique + "MRT", "NAFR", "AF", // Mauritania + "MUS", "SAFR", "AF", // Mauritius + "MYT", "SAFR", "AF", // Mayotte + "MEX", "NOAM", "NA", // Mexico + "FSM", "WPAC", "OC", // Micronesia (Federated States of) + "MCO", "EURO", "EU", // Monaco + "MNG", "ASIA", "AS", // Mongolia + "MNE", "EURO", "EU", // Montenegro + "MSR", "CARB", "NA", // Montserrat + "MAR", "NAFR", "AF", // Morocco + "MOZ", "SAFR", "AF", // Mozambique + "MMR", "ASIA", "AS", // Myanmar + "NAM", "SAFR", "AF", // Namibia + "NRU", "WPAC", "OC", // Nauru + "NPL", "ASIA", "AS", // Nepal + "NLD", "EURO", "EU", // Netherlands + "ANT", "CARB", "NA", // Netherlands Antilles + "NCL", "SPAC", "OC", // New Caledonia + "NZL", "AUNZ", "OC", // New Zealand + "NIC", "CEAM", "SA", // Nicaragua + "NER", "NAFR", "AF", // Niger + "NGA", "CAFR", "AF", // Nigeria + "NIU", "SPAC", "OC", // Niue + "NFK", "SPAC", "OC", // Norfolk Island + "MNP", "WPAC", "OC", // Northern Mariana Islands + "NOR", "EURO", "EU", // Norway + "PSE", "MDLE", "AS", // Occupied Palestinian Territory + "OMN", "MDLE", "AS", // Oman + "PAK", "INDI", "AS", // Pakistan + "PLW", "SPAC", "OC", // Palau + "PAN", "CEAM", "SA", // Panama + "PNG", "SPAC", "OC", // Papua New Guinea + "PRY", "SOAM", "SA", // Paraguay + "PER", "SOAM", "SA", // Peru + "PHL", "ASIA", "AS", // Philippines + "PCN", "SPAC", "OC", // Pitcairn + "POL", "EURO", "EU", // Poland + "PRT", "EURO", "EU", // Portugal + "PRI", "CARB", "NA", // Puerto Rico + "QAT", "MDLE", "AS", // Qatar + "KOR", "ASIA", "AS", // Republic of Korea + "MDA", "EURO", "EU", // Republic of Moldova + "REU", "SAFR", "AF", // Réunion + "ROU", "EURO", "EU", // Romania + "RUS", "ASIA", "AS", // Russian Federation + "RWA", "CAFR", "AF", // Rwanda + "BLM", "CARB", "NA", // Saint-Barthélemy + "SHN", "SOAM", "SA", // Saint Helena + "KNA", "CARB", "NA", // Saint Kitts and Nevis + "LCA", "CARB", "NA", // Saint Lucia + "MAF", "CARB", "NA", // Saint-Martin (French part) + "SPM", "NOAM", "NA", // Saint Pierre and Miquelon + "VCT", "CARB", "NA", // Saint Vincent and the Grenadines + "WSM", "SPAC", "OC", // Samoa + "SMR", "EURO", "EU", // San Marino + "STP", "CAFR", "AF", // Sao Tome and Principe + "SAU", "MDLE", "AS", // Saudi Arabia + "SEN", "CAFR", "AF", // Senegal + "SRB", "EURO", "EU", // Serbia + "SYC", "SAFR", "AF", // Seychelles + "SLE", "NAFR", "AF", // Sierra Leone + "SGP", "ASIA", "AS", // Singapore + "SVK", "EURO", "EU", // Slovakia + "SVN", "EURO", "EU", // Slovenia + "SLB", "SPAC", "OC", // Solomon Islands + "SOM", "NAFR", "AF", // Somalia + "ZAF", "SAFR", "AF", // South Africa + "ESP", "EURO", "EU", // Spain + "LKA", "INDE", "AS", // Sri Lanka + "SDN", "NAFR", "AF", // Sudan + "SUR", "SOAM", "SA", // Suriname + "SJM", "EURO", "EU", // Svalbard and Jan Mayen Islands + "SWZ", "SAFR", "AF", // Swaziland + "SWE", "EURO", "EU", // Sweden + "CHE", "EURO", "EU", // Switzerland + "SYR", "MDLE", "AS", // Syrian Arab Republic + "TJK", "ASIA", "AS", // Tajikistan + "THA", "ASIA", "AS", // Thailand + "MKD", "EURO", "EU", // The former Yugoslav Republic of Macedonia + "TLS", "ASIA", "AS", // Timor-Leste + "TGO", "CAFR", "AF", // Togo + "TKL", "AUNZ", "OC", // Tokelau + "TON", "SPAC", "OC", // Tonga + "TTO", "CARB", "NA", // Trinidad and Tobago + "TUN", "NAFR", "AF", // Tunisia + "TUR", "EURO", "EU", // Turkey + "TKM", "ASIA", "AS", // Turkmenistan + "TCA", "CARB", "NA", // Turks and Caicos Islands + "TUV", "SPAC", "OC", // Tuvalu + "UGA", "SAFR", "AF", // Uganda + "UKR", "EURO", "EU", // Ukraine + "ARE", "MDLE", "AS", // United Arab Emirates + "GBR", "EURO", "EU", // United Kingdom of Great Britain and Northern Ireland + "TZA", "SAFR", "AF", // United Republic of Tanzania + "USA", "NOAM", "NA", // United States of America + "VIR", "CARB", "NA", // United States Virgin Islands + "URY", "SOAM", "SA", // Uruguay + "UZB", "ASIA", "AS", // Uzbekistan + "VUT", "SPAC", "OC", // Vanuatu + "VEN", "SOAM", "SA", // Venezuela (Bolivarian Republic of) + "VNM", "ASIA", "AS", // Viet Nam + "WLF", "SPAC", "OC", // Wallis and Futuna Islands + "ESH", "CAFR", "AF", // Western Sahara + "YEM", "NAFR", "AF", // Yemen + "ZMB", "SAFR", "AF", // Zambia + "ZWE", "SAFR", "AF" // Zimbabwe }; char ** AliasText; struct ALIAS ** Aliases; @@ -339,9 +339,9 @@ struct ALIAS ** NTSAliases = NULL; /*struct ALIAS Aliases[] = { - "AMSAT", "WW", - "USBBS", "USA", - "ALLUS", "USA"}; +"AMSAT", "WW", +"USBBS", "USA", +"ALLUS", "USA"}; */ int NumberofContinents = sizeof(Continents)/sizeof(Continents[1]); @@ -355,7 +355,7 @@ struct Continent * FindContinent(char * Name) for(i=0; i< NumberofContinents; i++) { Cont = &Continents[i]; - + if ((_stricmp(Name, Cont->FourCharCode) == 0) || (_stricmp(Name, Cont->TwoCharCode) == 0)) return Cont; } @@ -371,7 +371,7 @@ struct Country * FindCountry(char * Name) for(i=0; i< NumberofCountries; i++) { Cont = &Countries[i]; - + if (_stricmp(Name, Cont->Country) == 0) return Cont; } @@ -389,7 +389,7 @@ struct ALIAS * FindAlias(char * Name) { if (_stricmp(Name, Alias[0]->Dest) == 0) return Alias[0]; - + Alias++; } @@ -403,7 +403,7 @@ VOID SetupMyHA() struct Continent * Continent; strcpy(MyRouteElements, HRoute); - + // Split it up ptr2 = MyRouteElements + strlen(MyRouteElements) - 1; @@ -418,7 +418,7 @@ VOID SetupMyHA() if (ptr2 == MyRouteElements) { // End - + MyElements[Elements++] = _strdup(ptr2); break; } @@ -435,29 +435,32 @@ VOID SetupMyHA() if (MyElements[1]) { -#ifdef TWOCHARCONT - if (strlen(MyElements[1]) == 4) + if (FOURCHARCONT == 0) { - // Convert to 2 char Continent; - Continent = FindContinent(MyElements[1]); - if (Continent) + if (strlen(MyElements[1]) == 4) { - free(MyElements[1]); - MyElements[1] = _strdup(Continent->TwoCharCode); + // Convert to 2 char Continent; + Continent = FindContinent(MyElements[1]); + if (Continent) + { + free(MyElements[1]); + MyElements[1] = _strdup(Continent->TwoCharCode); + } } } -#else - if (strlen(MyElements[1]) == 2) + else { - // Convert to 4 char Continent; - Continent = FindContinent(MyElements[1]); - if (Continent) + if (strlen(MyElements[1]) == 2) { - free(MyElements[1]); - MyElements[1] = _strdup(Continent->FourCharCode); + // Convert to 4 char Continent; + Continent = FindContinent(MyElements[1]); + if (Continent) + { + free(MyElements[1]); + MyElements[1] = _strdup(Continent->FourCharCode); + } } } -#endif } } @@ -556,7 +559,7 @@ VOID SetupHAElements(struct BBSForwardingInfo * ForwardingInfo) do { ForwardingInfo->BBSHAElements = realloc(ForwardingInfo->BBSHAElements, (Elements+2) * sizeof(void *)); - + while ((*ptr2 != '.') && (ptr2 > SaveHText)) { ptr2 --; @@ -565,13 +568,13 @@ VOID SetupHAElements(struct BBSForwardingInfo * ForwardingInfo) if (ptr2 == SaveHText) { // End - + ForwardingInfo->BBSHAElements[Elements++] = _strdup(ptr2); break; } - ForwardingInfo->BBSHAElements[Elements++] = _strdup(ptr2+1); - *ptr2 = 0; + ForwardingInfo->BBSHAElements[Elements++] = _strdup(ptr2+1); + *ptr2 = 0; } while(TRUE); @@ -579,30 +582,32 @@ VOID SetupHAElements(struct BBSForwardingInfo * ForwardingInfo) if (ForwardingInfo->BBSHAElements[1]) { -#ifdef TWOCHARCONT - if (strlen(ForwardingInfo->BBSHAElements[1]) == 4) + if (FOURCHARCONT == 0) { - // Convert to 2 char Continent; - Continent = FindContinent(ForwardingInfo->BBSHAElements[1]); - if (Continent) + if (strlen(ForwardingInfo->BBSHAElements[1]) == 4) { - free(ForwardingInfo->BBSHAElements[1]); - ForwardingInfo->BBSHAElements[1] = _strdup(Continent->TwoCharCode); + // Convert to 2 char Continent; + Continent = FindContinent(ForwardingInfo->BBSHAElements[1]); + if (Continent) + { + free(ForwardingInfo->BBSHAElements[1]); + ForwardingInfo->BBSHAElements[1] = _strdup(Continent->TwoCharCode); + } } } -#else - if (strlen(ForwardingInfo->BBSHAElements[1]) == 2) + else { - // Convert to 4 char Continent; - Continent = FindContinent(ForwardingInfo->BBSHAElements[1]); - if (Continent) + if (strlen(ForwardingInfo->BBSHAElements[1]) == 2) { - free(ForwardingInfo->BBSHAElements[1]); - ForwardingInfo->BBSHAElements[1] = _strdup(Continent->FourCharCode); + // Convert to 4 char Continent; + Continent = FindContinent(ForwardingInfo->BBSHAElements[1]); + if (Continent) + { + free(ForwardingInfo->BBSHAElements[1]); + ForwardingInfo->BBSHAElements[1] = _strdup(Continent->FourCharCode); + } } } -#endif - } free(SaveHText); @@ -614,7 +619,7 @@ VOID SetupHAddreses(struct BBSForwardingInfo * ForwardingInfo) int Count=0; char ** HText = ForwardingInfo->Haddresses; char * SaveHText, * ptr2; -// char * TopElement; + // char * TopElement; char * Num; struct Continent * Continent; @@ -626,7 +631,7 @@ VOID SetupHAddreses(struct BBSForwardingInfo * ForwardingInfo) int Elements = 1; ForwardingInfo->HADDRS = realloc(ForwardingInfo->HADDRS, (Count+2) * sizeof(void *)); ForwardingInfo->HADDROffet = realloc(ForwardingInfo->HADDROffet, (Count+2) * sizeof(void *)); - + ForwardingInfo->HADDRS[Count] = zalloc(8); // Always at lesat WWW and NULL SaveHText = _strdup(HText[0]); @@ -671,53 +676,56 @@ VOID SetupHAddreses(struct BBSForwardingInfo * ForwardingInfo) // Far simpler to config it, but can users cope?? // Will config for testing. HA, N -/* + /* TopElement=ForwardingInfo->HADDRS[Count][0]; if (strcmp(TopElement, MyElements[0]) == 0) - goto FullHR; + goto FullHR; if (FindContinent(TopElement)) - goto FullHR; - + goto FullHR; + // Need to add stuff from our HR Elements--; if (Elements < MyElementCount) - break; + break; -FullHR: -*/ + FullHR: + */ ForwardingInfo->HADDROffet[Count] = (Num)? atoi(Num): 0; if (ForwardingInfo->HADDRS[Count][1]) { -#ifdef TWOCHARCONT - if (strlen(ForwardingInfo->HADDRS[Count][1]) == 4) + if (FOURCHARCONT == 0) { - // Convert to 2 char Continent; - Continent = FindContinent(ForwardingInfo->HADDRS[Count][1]); - if (Continent) - { - free(ForwardingInfo->HADDRS[Count][1]); - ForwardingInfo->HADDRS[Count][1] = _strdup(Continent->TwoCharCode); - } - } -#else - if (strlen(ForwardingInfo->HADDRS[Count][1]) == 2) - { - // Convert to 4 char Continent; - Continent = FindContinent(ForwardingInfo->HADDRS[Count][1]); - if (Continent) - { - free(ForwardingInfo->HADDRS[Count][1]); - ForwardingInfo->HADDRS[Count][1] = _strdup(Continent->FourCharCode); - } - } -#endif + if (strlen(ForwardingInfo->HADDRS[Count][1]) == 4) + { + // Convert to 2 char Continent; + Continent = FindContinent(ForwardingInfo->HADDRS[Count][1]); + if (Continent) + { + free(ForwardingInfo->HADDRS[Count][1]); + ForwardingInfo->HADDRS[Count][1] = _strdup(Continent->TwoCharCode); + } + } + } + else + { + if (strlen(ForwardingInfo->HADDRS[Count][1]) == 2) + { + // Convert to 4 char Continent; + Continent = FindContinent(ForwardingInfo->HADDRS[Count][1]); + if (Continent) + { + free(ForwardingInfo->HADDRS[Count][1]); + ForwardingInfo->HADDRS[Count][1] = _strdup(Continent->FourCharCode); + } + } + } } free(SaveHText); HText++; @@ -732,7 +740,7 @@ VOID SetupHAddresesP(struct BBSForwardingInfo * ForwardingInfo) int Count=0; char ** HText = ForwardingInfo->HaddressesP; char * SaveHText, * ptr2; -// char * TopElement; + // char * TopElement; char * Num; struct Continent * Continent; @@ -742,7 +750,7 @@ VOID SetupHAddresesP(struct BBSForwardingInfo * ForwardingInfo) { int Elements = 1; ForwardingInfo->HADDRSP = realloc(ForwardingInfo->HADDRSP, (Count+2) * sizeof(void *)); - + ForwardingInfo->HADDRSP[Count] = zalloc(2 * sizeof(void *)); // Always at lesat WWW and NULL SaveHText = _strdup(HText[0]); @@ -781,29 +789,33 @@ VOID SetupHAddresesP(struct BBSForwardingInfo * ForwardingInfo) if (ForwardingInfo->HADDRSP[Count][1]) { -#ifdef TWOCHARCONT - if (strlen(ForwardingInfo->HADDRSP[Count][1]) == 4) + if (FOURCHARCONT == 0) { - // Convert to 2 char Continent; - Continent = FindContinent(ForwardingInfo->HADDRSP[Count][1]); - if (Continent) + + if (strlen(ForwardingInfo->HADDRSP[Count][1]) == 4) { - free(ForwardingInfo->HADDRSP[Count][1]); - ForwardingInfo->HADDRSP[Count][1] = _strdup(Continent->TwoCharCode); + // Convert to 2 char Continent; + Continent = FindContinent(ForwardingInfo->HADDRSP[Count][1]); + if (Continent) + { + free(ForwardingInfo->HADDRSP[Count][1]); + ForwardingInfo->HADDRSP[Count][1] = _strdup(Continent->TwoCharCode); + } } } -#else - if (strlen(ForwardingInfo->HADDRSP[Count][1]) == 2) + else { - // Convert to 4 char Continent; - Continent = FindContinent(ForwardingInfo->HADDRSP[Count][1]); - if (Continent) + if (strlen(ForwardingInfo->HADDRSP[Count][1]) == 2) { - free(ForwardingInfo->HADDRSP[Count][1]); - ForwardingInfo->HADDRSP[Count][1] = _strdup(Continent->FourCharCode); + // Convert to 4 char Continent; + Continent = FindContinent(ForwardingInfo->HADDRSP[Count][1]); + if (Continent) + { + free(ForwardingInfo->HADDRSP[Count][1]); + ForwardingInfo->HADDRSP[Count][1] = _strdup(Continent->FourCharCode); + } } } -#endif } free(SaveHText); HText++; @@ -816,7 +828,7 @@ VOID SetupHAddresesP(struct BBSForwardingInfo * ForwardingInfo) VOID CheckAndSend(struct MsgInfo * Msg, CIRCUIT * conn, struct UserInfo * bbs) { struct BBSForwardingInfo * ForwardingInfo = bbs->ForwardingInfo; - + if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Don't forward to ourself - already here! (unless ForwardToMe set) { if ((conn == NULL) || (!(conn->BBSFlags & BBS) || (_stricmp(conn->UserPointer->Call, bbs->Call) != 0))) // Dont send back @@ -841,9 +853,9 @@ VOID CheckAndSend(struct MsgInfo * Msg, CIRCUIT * conn, struct UserInfo * bbs) { CheckAndSend(Msg, conn, user); } - + Logprintf(LOG_BBS, conn, '?', "Message matches this BBS and RMS Redirect set - fwd to RMS"); - + } else Logprintf(LOG_BBS, conn, '?', "Message matches this BBS and ForwardToMe not set - not queuing message"); @@ -857,7 +869,7 @@ VOID UpdateB2Dest(struct MsgInfo * Msg, char * Alias) FILE * hFile; char * MsgBytes; struct stat STAT; - + sprintf_s(MsgFile, sizeof(MsgFile), "%s/m_%06d.mes", MailDir, Msg->number); if (stat(MsgFile, &STAT) == -1) @@ -1032,7 +1044,7 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) if (strlen(toCall) > 6) toCall[6] = 0; - + strcpy(Msg->to, toCall); strcpy(Msg->via, via); Logprintf(LOG_BBS, conn, '?', "Routing Trace at %s is for us. Leave Here", AMPRDomain); @@ -1048,7 +1060,7 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) if (bbs) { // We have bbs AMPR - + if (_stricmp(Msg->to, "RMS") == 0 || Msg->to[0] == 0) { // Was set to go via RMS or ISP - change it @@ -1057,7 +1069,7 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) } Logprintf(LOG_BBS, conn, '?', "Routing Trace to ampr.org Matches BBS AMPR"); - + set_fwd_bit(Msg->fbbs, bbs->BBSNumber); bbs->ForwardingInfo->MsgCount++; if (bbs->ForwardingInfo->SendNew) @@ -1070,12 +1082,12 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) } } -// See if sending @ winlink.org + // See if sending @ winlink.org if (_stricmp(Msg->to, "RMS") == 0) { // If a user of this bbs with Poll RMS set, leave it here - no point in sending to winlink - + // To = RMS could come from RMS:EMAIL Address. If so, we only check user if @winlink.org, or // we will hold g8bpq@g8bpq.org.uk @@ -1103,7 +1115,7 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) if (user->flags & F_BBS) // User is also a BBS, so set FWD bit so he can get it set_fwd_bit(Msg->fbbs, user->BBSNumber); - + return 1; } } @@ -1118,7 +1130,7 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) if (RMS) { Logprintf(LOG_BBS, conn, '?', "Routing Trace to RMS Matches BBS RMS"); - + set_fwd_bit(Msg->fbbs, RMS->BBSNumber); RMS->ForwardingInfo->MsgCount++; if (RMS->ForwardingInfo->SendNew) @@ -1140,20 +1152,20 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) if (user->flags & F_POLLRMS) { Logprintf(LOG_BBS, conn, '?', "Routing Trace @ winlink.org, but local RMS user - leave here"); - + if (user->flags & F_BBS) // User is also a BBS, so set FWD bit so he can get it set_fwd_bit(Msg->fbbs, user->BBSNumber); return 1; // Route found } } - + RMS = FindRMS(); if (RMS) { Logprintf(LOG_BBS, conn, '?', "Routing Trace @ winlink.org Matches BBS RMS"); - + set_fwd_bit(Msg->fbbs, RMS->BBSNumber); RMS->ForwardingInfo->MsgCount++; if (RMS->ForwardingInfo->SendNew) @@ -1169,7 +1181,7 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) // See if a well-known alias Alias = FindAlias(RouteElements); - + if (Alias) { Logprintf(LOG_BBS, conn, '?', "Routing Trace Alias Substitution %s > %s", @@ -1219,15 +1231,15 @@ int MatchMessagetoBBSList(struct MsgInfo * Msg, CIRCUIT * conn) } Country = FindCountry(ptr2); - + if (Country) { // Just need to add Continent and WW -#ifdef TWOCHARCONT - sprintf_s(FullRoute, sizeof(FullRoute),"%s.%s.WW", RouteElements, Country->Continent2); -#else - sprintf_s(FullRoute, sizeof(FullRoute),"%s.%s.WW", RouteElements, Country->Continent4); -#endif + if (FOURCHARCONT == 0) + sprintf_s(FullRoute, sizeof(FullRoute),"%s.%s.WW", RouteElements, Country->Continent2); + else + sprintf_s(FullRoute, sizeof(FullRoute),"%s.%s.WW", RouteElements, Country->Continent4); + goto FULLHA; } @@ -1261,7 +1273,7 @@ FULLHA: if (ptr2 != FullRoute) *ptr2++ = 0; - + HElements[Elements++] = ptr2; @@ -1270,29 +1282,32 @@ FULLHA: if (HElements[1]) { -#ifdef TWOCHARCONT - if (strlen(HElements[1]) == 4) + if (FOURCHARCONT == 0) { - // Convert to 2 char Continent; - Continent = FindContinent(HElements[1]); - if (Continent) + if (strlen(HElements[1]) == 4) { -// free(MyElements[1]); - HElements[1] = _strdup(Continent->TwoCharCode); + // Convert to 2 char Continent; + Continent = FindContinent(HElements[1]); + if (Continent) + { + // free(MyElements[1]); + HElements[1] = _strdup(Continent->TwoCharCode); + } } } -#else - if (strlen(HElements[1]) == 2) + else { - // Convert to 4 char Continent; - Continent = FindContinent(HElements[1]); - if (Continent) + if (strlen(HElements[1]) == 2) { -// free(MyElements[1]); - HElements[1] = _strdup(Continent->FourCharCode); + // Convert to 4 char Continent; + Continent = FindContinent(HElements[1]); + if (Continent) + { + // free(MyElements[1]); + HElements[1] = _strdup(Continent->FourCharCode); + } } } -#endif } @@ -1301,7 +1316,7 @@ FULLHA: if (Msg->type == 'B') { int i = 0; - + // All elements of Helements must match Myelements while (MyElements[i] && HElements[i]) // Until one set runs out @@ -1345,7 +1360,7 @@ NOHA: if (depth > -1) { Logprintf(LOG_BBS, conn, '?', "Routing Trace NTS Matches TO BBS %s Length %d", bbs->Call, depth); - + if (depth > bestmatch) { bestmatch = depth; @@ -1386,7 +1401,63 @@ NOHA: goto CheckWildCardedAT; } + // First check P message to multiple destinations + // We should choose the BBS with most matching elements (ie match on #23.GBR better that GBR) + // If SendPtoMultiple is set I think we send to any with same match level + + // So if SendPtoMultiple is set I think I need to find the best depth then send to all with the same depth + // If none are found on HA match drop through. + + if (SendPtoMultiple && Msg->type == 'P') + { + struct UserInfo * bestbbs = NULL; + int bestmatch = 0; + int depth; + int Matched = 0; + int MultiPDepth = 0; + + Count = 0; + + Logprintf(LOG_BBS, conn, '?', "SendPtoMultiple is set. Checking for best match level"); + + for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) + { + ForwardingInfo = bbs->ForwardingInfo; + + depth = CheckBBSHElements(Msg, bbs, ForwardingInfo, ATBBS, &HElements[0]); + + if (depth) + { + if (depth > MultiPDepth) + { + MultiPDepth = depth; + bestbbs = bbs; + } + } + } + + if (MultiPDepth) + { + for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) + { + ForwardingInfo = bbs->ForwardingInfo; + + depth = CheckBBSHElements(Msg, bbs, ForwardingInfo, ATBBS, &HElements[0]); + + if (depth == MultiPDepth) + { + Logprintf(LOG_BBS, conn, '?', "Routing Trace HR Matches BBS %s Depth %d", bbs->Call, depth); + CheckAndSend(Msg, conn, bbs); + Count++; + } + } + return Count; + } + else + Logprintf(LOG_BBS, conn, '?', "SendPtoMultiple is set but no match on HA"); + } + if (Msg->type == 'P' || Flood == 0) { // P messages are only sent to one BBS, but check the TO and AT of all BBSs before routing on HA, @@ -1406,7 +1477,7 @@ NOHA: if (ForwardingInfo->PersonalOnly && (Msg->type != 'P') && (Msg->type != 'T')) continue; - + if (CheckBBSToList(Msg, bbs, ForwardingInfo)) { Logprintf(LOG_BBS, conn, '?', "Routing Trace TO %s Matches BBS %s", Msg->to, bbs->Call); @@ -1433,9 +1504,9 @@ NOHA: if ((strcmp(ATBBS, bbs->Call) == 0)) // @BBS = BBS { Logprintf(LOG_BBS, conn, '?', "Routing Trace %s Matches implied AT %s", ATBBS, bbs->Call); - + CheckAndSend(Msg, conn, bbs); - + Matched++; if (SendPtoMultiple && Msg->type == 'P') continue; @@ -1467,50 +1538,7 @@ NOHA: return 1; } - // We should choose the BBS with most matching elements (ie match on #23.GBR better that GBR) - // If SendPtoMultiple is set I think we send to any with same match level - - // So if SendPtoMultiple is set I think I need to find the best depth then send to all with the same depth - - - if (SendPtoMultiple && Msg->type == 'P') - { - Logprintf(LOG_BBS, conn, '?', "SendPtoMultiple is set. Checking for best match level"); - - for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) - { - ForwardingInfo = bbs->ForwardingInfo; - - depth = CheckBBSHElements(Msg, bbs, ForwardingInfo, ATBBS, &HElements[0]); - - if (depth) - { - if (depth > MultiPDepth) - { - MultiPDepth = depth; - bestbbs = bbs; - } - } - - if (MultiPDepth) - { - for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) - { - ForwardingInfo = bbs->ForwardingInfo; - - depth = CheckBBSHElements(Msg, bbs, ForwardingInfo, ATBBS, &HElements[0]); - - if (depth == MultiPDepth) - { - Logprintf(LOG_BBS, conn, '?', "Routing Trace HR Matches BBS %s Depth %d", bbs->Call, depth); - CheckAndSend(Msg, conn, bbs); - } - } - - return 1; - } - } - } + // Normal HA match (not SendPToMultiple) for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) { @@ -1586,182 +1614,182 @@ CheckWildCardedAT: Logprintf(LOG_BBS, conn, '?', "Routing Trace - No Match"); return FALSE; // No match - } - - // Flood Bulls go to all matching BBSs in the flood area, so the order of checking doesn't matter - - // For now I will only route on AT (for non-hierarchical addresses) and HA - - // Ver 1.0.4.2 - Try including TO - - for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) - { - ForwardingInfo = bbs->ForwardingInfo; - - if (ForwardingInfo->PersonalOnly) - continue; - - if (CheckBBSToList(Msg, bbs, ForwardingInfo)) - { - Logprintf(LOG_BBS, conn, '?', "Routing Trace TO %s Matches BBS %s", Msg->to, bbs->Call); - - if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Dont forward to ourself - already here! (unless ForwardToMe set) - { - set_fwd_bit(Msg->fbbs, bbs->BBSNumber); - ForwardingInfo->MsgCount++; - } - Count++; - continue; - } - - if ((strcmp(ATBBS, bbs->Call) == 0) || // @BBS = BBS - CheckBBSAtList(Msg, ForwardingInfo, ATBBS)) - { - Logprintf(LOG_BBS, conn, '?', "Routing Trace AT %s Matches BBS %s", Msg->to, bbs->Call); - CheckAndSend(Msg, conn, bbs); - - Count++; - continue; - } - - - if (CheckBBSHElementsFlood(Msg, bbs, ForwardingInfo, Msg->via, &HElements[0])) - { - Logprintf(LOG_BBS, conn, '?', "Routing Trace HR %s %s %s %s %s Matches BBS %s", - HElements[0], HElements[1], HElements[2], - HElements[3], HElements[4], bbs->Call); - - CheckAndSend(Msg, conn, bbs); - - Count++; - } - - } - - if (Count == 0) - goto CheckWildCardedAT; - - Logprintf(LOG_BBS, conn, '?', "Routing Trace - No Match"); - - return Count; } - BOOL CheckBBSToList(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo) - { - char ** Calls; + // Flood Bulls go to all matching BBSs in the flood area, so the order of checking doesn't matter - // Check TO distributions + // For now I will only route on AT (for non-hierarchical addresses) and HA - if (ForwardingInfo->TOCalls) + // Ver 1.0.4.2 - Try including TO + + for (bbs = BBSChain; bbs; bbs = bbs->BBSNext) + { + ForwardingInfo = bbs->ForwardingInfo; + + if (ForwardingInfo->PersonalOnly) + continue; + + if (CheckBBSToList(Msg, bbs, ForwardingInfo)) { - Calls = ForwardingInfo->TOCalls; + Logprintf(LOG_BBS, conn, '?', "Routing Trace TO %s Matches BBS %s", Msg->to, bbs->Call); - while(Calls[0]) + if (ForwardToMe || _stricmp(bbs->Call, BBSName) != 0) // Dont forward to ourself - already here! (unless ForwardToMe set) { - if (strcmp(Calls[0], Msg->to) == 0) - return TRUE; - - Calls++; + set_fwd_bit(Msg->fbbs, bbs->BBSNumber); + ForwardingInfo->MsgCount++; } + Count++; + continue; } - return FALSE; + + if ((strcmp(ATBBS, bbs->Call) == 0) || // @BBS = BBS + CheckBBSAtList(Msg, ForwardingInfo, ATBBS)) + { + Logprintf(LOG_BBS, conn, '?', "Routing Trace AT %s Matches BBS %s", Msg->to, bbs->Call); + CheckAndSend(Msg, conn, bbs); + + Count++; + continue; + } + + + if (CheckBBSHElementsFlood(Msg, bbs, ForwardingInfo, Msg->via, &HElements[0])) + { + Logprintf(LOG_BBS, conn, '?', "Routing Trace HR %s %s %s %s %s Matches BBS %s", + HElements[0], HElements[1], HElements[2], + HElements[3], HElements[4], bbs->Call); + + CheckAndSend(Msg, conn, bbs); + + Count++; + } + } - BOOL CheckBBSAtList(struct MsgInfo * Msg, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS) + if (Count == 0) + goto CheckWildCardedAT; + + Logprintf(LOG_BBS, conn, '?', "Routing Trace - No Match"); + + return Count; +} + +BOOL CheckBBSToList(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo) +{ + char ** Calls; + + // Check TO distributions + + if (ForwardingInfo->TOCalls) { - char ** Calls; + Calls = ForwardingInfo->TOCalls; - // Check AT distributions - - // if (strcmp(ATBBS, bbs->Call) == 0) // @BBS = BBS - // return TRUE; - - if (ForwardingInfo->ATCalls) + while(Calls[0]) { - Calls = ForwardingInfo->ATCalls; + if (strcmp(Calls[0], Msg->to) == 0) + return TRUE; - while(Calls[0]) - { - if (strcmp(Calls[0], ATBBS) == 0) - return TRUE; - - Calls++; - } + Calls++; } - return FALSE; } + return FALSE; +} - int CheckBBSHElements(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements) +BOOL CheckBBSAtList(struct MsgInfo * Msg, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS) +{ + char ** Calls; + + // Check AT distributions + + // if (strcmp(ATBBS, bbs->Call) == 0) // @BBS = BBS + // return TRUE; + + if (ForwardingInfo->ATCalls) { - // Used for Personal Messages, and Bulls not yot at their target area + Calls = ForwardingInfo->ATCalls; - char *** HRoutes; - int i = 0, j, k = 0; - int bestmatch = 0; - - if (ForwardingInfo->HADDRSP) + while(Calls[0]) { - // Match on Routes + if (strcmp(Calls[0], ATBBS) == 0) + return TRUE; - HRoutes = ForwardingInfo->HADDRSP; - k=0; - - while(HRoutes[k]) - { - i = j = 0; - - while (HRoutes[k][i] && HElements[j]) // Until one set runs out - { - if (strcmp(HRoutes[k][i], HElements[j]) != 0) - break; - i++; - j++; - } - - // Only send if all BBS elements match - - if (HRoutes[k][i] == 0) - { - if (i > bestmatch) - bestmatch = i; - } - k++; - } + Calls++; } - return bestmatch; } + return FALSE; +} +int CheckBBSHElements(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements) +{ + // Used for Personal Messages, and Bulls not yot at their target area - int CheckBBSHElementsFlood(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements) + char *** HRoutes; + int i = 0, j, k = 0; + int bestmatch = 0; + + if (ForwardingInfo->HADDRSP) { - char *** HRoutes; - char ** BBSHA; + // Match on Routes - int i = 0, j, k = 0; - int bestmatch = 0; + HRoutes = ForwardingInfo->HADDRSP; + k=0; - if (ForwardingInfo->HADDRS) + while(HRoutes[k]) { - // Match on Routes - - // Message must be in right area (all elements of message match BBS Location HA) - - BBSHA = ForwardingInfo->BBSHAElements; - - if (BBSHA == NULL) - return 0; // Not safe to flood - i = j = 0; - while (BBSHA[i] && HElements[j]) // Until one set runs out + while (HRoutes[k][i] && HElements[j]) // Until one set runs out { - if (strcmp(BBSHA[i], HElements[j]) != 0) + if (strcmp(HRoutes[k][i], HElements[j]) != 0) break; i++; j++; } - if (HElements[j] != 0) + // Only send if all BBS elements match + + if (HRoutes[k][i] == 0) + { + if (i > bestmatch) + bestmatch = i; + } + k++; + } + } + return bestmatch; +} + + +int CheckBBSHElementsFlood(struct MsgInfo * Msg, struct UserInfo * bbs, struct BBSForwardingInfo * ForwardingInfo, char * ATBBS, char ** HElements) +{ + char *** HRoutes; + char ** BBSHA; + + int i = 0, j, k = 0; + int bestmatch = 0; + + if (ForwardingInfo->HADDRS) + { + // Match on Routes + + // Message must be in right area (all elements of message match BBS Location HA) + + BBSHA = ForwardingInfo->BBSHAElements; + + if (BBSHA == NULL) + return 0; // Not safe to flood + + i = j = 0; + + while (BBSHA[i] && HElements[j]) // Until one set runs out + { + if (strcmp(BBSHA[i], HElements[j]) != 0) + break; + i++; + j++; + } + + if (HElements[j] != 0) return 0; // Message is not for BBS's area HRoutes = ForwardingInfo->HADDRS; @@ -1770,7 +1798,7 @@ CheckWildCardedAT: while(HRoutes[k]) { i = j = 0; - + while (HRoutes[k][i] && HElements[j]) // Until one set runs out { if (strcmp(HRoutes[k][i], HElements[j]) != 0) @@ -1778,11 +1806,11 @@ CheckWildCardedAT: i++; j++; } - + if (i > bestmatch) { // As Flooding, only match if all elements match, and elements matching > offset - + // As Flooding, only match if all elements from BBS are matched // ie if BBS has #23.gbr.eu, and msg gbr.eu, don't match // if BBS has gbr.eu, and msg #23.gbr.eu, ok (so long as bbs in in #23, checked above. @@ -1807,7 +1835,7 @@ int CheckBBSToForNTS(struct MsgInfo * Msg, struct BBSForwardingInfo * Forwarding int MatchLen = 0; // Look for Matches on TO using Wildcarded Addresses. Intended for use with NTS traffic, with TO = ZIPCode - + // We forward to the BBS with the most specific match - ie minimum *'s in match if (ForwardingInfo->TOCalls) @@ -1848,7 +1876,7 @@ int CheckBBSToForNTS(struct MsgInfo * Msg, struct BBSForwardingInfo * Forwarding else { //no star - just do a normal compare - + if (strcmp(Msg->to, Call) == 0) { if (Invert) @@ -1877,7 +1905,7 @@ int CheckBBSATListWildCarded(struct MsgInfo * Msg, struct BBSForwardingInfo * Fo // Look for Matches on AT using Wildcarded Addresses. Only applied after all other checks fail. Intended mainly // for setting a default route, but could have other uses - + // We forward to the BBS with the most specific match - ie minimum *'s in match if (ForwardingInfo->ATCalls) @@ -1890,7 +1918,7 @@ int CheckBBSATListWildCarded(struct MsgInfo * Msg, struct BBSForwardingInfo * Fo ptr = strchr(Call, '*'); // only look if * present - we have already tried routing on the full AT - + if (ptr) { MatchLen = ptr - Call; @@ -1930,7 +1958,7 @@ struct ALIAS * CheckForNTSAlias(struct MsgInfo * Msg, char * ATFirstElement) break; ptr = strchr(Call, '*'); - + if (ptr) { MatchLen = ptr - Call; @@ -1941,7 +1969,7 @@ struct ALIAS * CheckForNTSAlias(struct MsgInfo * Msg, char * ATFirstElement) else { //no star - just do a normal compare - + if (strcmp(Msg->to, Call) == 0) return(Alias[0]); } @@ -2016,7 +2044,7 @@ VOID ReRouteMessages() if (check_fwd_bit(Msg->fbbs, user->BBSNumber)) // for this BBS? { if (check_fwd_bit(Msg->forw, user->BBSNumber)) // Already sent? - clear_fwd_bit(Msg->fbbs, user->BBSNumber); + clear_fwd_bit(Msg->fbbs, user->BBSNumber); } } diff --git a/Versions.h b/Versions.h index 38a03fb..2fd8eb3 100644 --- a/Versions.h +++ b/Versions.h @@ -10,8 +10,8 @@ #endif -#define KVers 6,0,24,38 -#define KVerstring "6.0.24.38\0" +#define KVers 6,0,24,40 +#define KVerstring "6.0.24.40\0" #ifdef CKernel diff --git a/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user b/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/WinRPRHelper.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/WinmorControl.vcproj.LAPTOP-Q6S4RP5Q.johnw.user b/WinmorControl.vcproj.LAPTOP-Q6S4RP5Q.johnw.user deleted file mode 100644 index 0cd9a72..0000000 --- a/WinmorControl.vcproj.LAPTOP-Q6S4RP5Q.johnw.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/WinmorControl.vcproj.NOTTSDESKTOP.John.user b/WinmorControl.vcproj.NOTTSDESKTOP.John.user deleted file mode 100644 index fa82c00..0000000 --- a/WinmorControl.vcproj.NOTTSDESKTOP.John.user +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - diff --git a/bpqmail.h b/bpqmail.h index 0071261..7b72ea4 100644 --- a/bpqmail.h +++ b/bpqmail.h @@ -43,7 +43,7 @@ #define NEWROUTING - +extern int FOURCHARCONT; // Standard __except handler for try/except diff --git a/templatedefs.c b/templatedefs.c index 94f69e8..b532031 100644 --- a/templatedefs.c +++ b/templatedefs.c @@ -101,7 +101,7 @@ char * FwdPagetxt() "{" "position: absolute;" "width:290px;" - "height:510px;" + "height:550px;" "border:0px solid;" "overflow: auto;" "}" @@ -109,7 +109,7 @@ char * FwdPagetxt() "{" "position: absolute;" "width:180px;" - "height:500px;" + "height:540px;" "border:2px solid;" "overflow: auto;" "}" @@ -118,7 +118,7 @@ char * FwdPagetxt() "position: absolute;" "width:95px;" "left:190px;" - "height:500px;" + "height:540px;" "border:2px solid;" "overflow: auto;" "}" @@ -255,6 +255,7 @@ char * FwdPagetxt() " Welcome Msgs & Prompts" " Housekeeping" " WP Update" + "WebMail" " Node Menu" " " " " @@ -279,7 +280,8 @@ char * FwdPagetxt() "
" "Send P Msgs to more than one BBS 
" "
" - + "Use 4 Char Continent Codes 
" + "
" "Aliases
" "
" "

" @@ -400,6 +402,7 @@ char * WebMailPagetxt() "Auto Refresh\r\n" "Send Message\r\n" "Logout\r\n" + "Mail Mgmt\r\n" "Node Menu\r\n" "
\r\n" "
\r\n" @@ -452,6 +455,7 @@ char * MainConfigtxt() " Welcome Msgs & Prompts\r\n" " Housekeeping\r\n" " WP Update\r\n" + "WebMail" " Node Menu\r\n" "\r\n" "
\r\n" @@ -701,6 +705,7 @@ char * MsgPagetxt() " Welcome Msgs & Prompts\r\n" " Housekeeping\r\n" " WP Update\r\n" + "WebMail" " Node Menu\r\n" " \r\n" " \r\n" @@ -1060,6 +1065,7 @@ char * UserPagetxt() "Welcome Msgs & Prompts\r\n" "Housekeeping\r\n" "WP Update\r\n" + "WebMail" "Node Menu\r\n" "
\r\n" "
\r\n" @@ -1116,6 +1122,7 @@ char * Housekeepingtxt() "Welcome Msgs & Prompts\r\n" "Housekeeping\r\n" "WP Update\r\n" + "WebMail" "Node Menu\r\n" "
\r\n" "
Housekeeping
\r\n" @@ -1364,6 +1371,7 @@ char * WPtxt() " Welcome Msgs & Prompts\r\n" " Housekeeping\r\n" " WP Update\r\n" + "WebMail" " Node Menu\r\n" " \r\n" " \r\n"