Skip to content

Commit 9f7641a

Browse files
committed
Version jPskmail-3.1.8.4-20230830-Beta (unpublished)
- Bug fix: When listening in CW mode for unproto exchanges, would reply to a connect request in CW mode. - Improvement: when listening in CW mode, disable the Fldigi Squelch as it creates characters dropouts - Bug fix: "I don't understand "~SEND" reply when requesting Grib files - Bug fix: When using virtual mail boxes, grib file replies would not be visible to the requester due to the reply coming from a different email address. - Bug fix: Endless reties of some data frames due to the presence of control characters not processed on the Rx side ("0x0D" is ignored). This also resulted in corrupted multibytes UTF-8 characters in emails and web pages. - Bug fix: When transmitting multibytes UTF-8 frames, Fldigi would be killed and restarted due to a Tx timeout. Now counts the number of bytes instead of characters for calculating the timeout.
1 parent 3e7f432 commit 9f7641a

6 files changed

Lines changed: 34 additions & 10 deletions

File tree

src/javapskmail/Arq.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,8 @@ public boolean send_ack(String server) {
550550
//VK2ETA not automatically, decided elsewhere
551551
//send_txrsid_command("ON");
552552
//test Thread.sleep(1000);
553+
//Ensure we don't leave an old status here like a CW ack status
554+
this.txserverstatus = TxStatus.TTYConnect_ack;
553555
info = connect_ack(server);
554556
outstring = make_block(info);
555557
if (Main.ttyConnected.equals("Connecting")) { //I am a TTY server

src/javapskmail/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
public class Main {
3535

3636
//VK2ETA: Based on "jpskmail 1.7.b";
37-
static String version = "3.1.8.1";
37+
static String version = "3.1.8.4";
3838
static String application = "jPskmail " + version;// Used to preset an empty status
39-
static String versionDate = "20230826";
39+
static String versionDate = "20230830";
4040
static String host = "localhost";
4141
static int port = 7322; //ARQ IP port
4242
static String xmlPort = "7362"; //XML IP port

src/javapskmail/MainPskmailUi.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,8 @@ public void actionPerformed(ActionEvent e) {
638638
//Squelch fully open when actively listening
639639
if (Main.connected || Main.m.BlockActive
640640
|| Main.receivingRadioMsg || Main.possibleRadioMsg != 0L
641-
|| Main.modemTestMode) {
641+
|| Main.modemTestMode
642+
|| Main.configuration.getPreference("LISTENINCWMODE").equals("yes")) {
642643
Main.sql = Main.SQL_FLOOR;
643644
RigCtrl.setSquelchOn(false); //OFF
644645
} else {

src/javapskmail/Modem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ public void Sendln(String outLine) {
682682
Main.justReceivedRSID = false;
683683
//Calculate the expected return time to Rx (to prevent TX lockups). Add 50% margin.
684684
//expectedReturnToRxTime = System.currentTimeMillis() + (3000 * (long) (getTxTimeEstimate(Main.txModem, outLine.length()))) / 2;
685-
long txTime = (3000 * (long)(getTxTimeEstimate(Main.txModem, outLine.length())))/2;
685+
long txTime = (3000 * (long)(getTxTimeEstimate(Main.txModem, outLine.getBytes("UTF-8").length)));
686686
System.out.println("txTime: " + txTime);
687687
expectedReturnToRxTime = System.currentTimeMillis() + txTime;
688688
}
@@ -727,7 +727,7 @@ public void Sendln(String outLine, String modemString, String TxRsidString) {
727727
Main.justReceivedRSID = false;
728728
ModemModesEnum txMode = Main.convmodem(modemString);
729729
//Calculate the expected return time to Rx (to prevent TX lockups). Add 50% margin.
730-
long txTime = (3000 * (long)(getTxTimeEstimate(txMode, outLine.length())))/2;
730+
long txTime = (3000 * (long)(getTxTimeEstimate(txMode, outLine.getBytes("UTF-8").length)));
731731
System.out.println("txTime: " + txTime);
732732
expectedReturnToRxTime = System.currentTimeMillis() + txTime;
733733
}

src/javapskmail/ServerMail.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class ServerMail {
7373
2nd line
7474
3rd line
7575
4th line.
76+
.
7677
.
7778
*/
7879
public static String sendMail(String fromCallsign, String toStr, String subjectStr,
@@ -268,6 +269,11 @@ public static String getHeaderList(int fromNumber) {
268269
String fromString = msg.getFrom()[0].toString();
269270
//Remove name and only keep email address proper
270271
fromString = RMsgProcessor.extractEmailAddress(fromString);
272+
//Special case for GRIB files replies: grib requests are sent to "query@saildocs.com" but
273+
// replies are coming from "query-reply@saildocs.com", thereby never matching the filter
274+
if (fromString.equals("query-reply@saildocs.com")) {
275+
fromString = "query@saildocs.com";
276+
}
271277
String[] tos;
272278
//boolean forAll = false;
273279
//if (forAll) {
@@ -310,7 +316,7 @@ public static String getHeaderList(int fromNumber) {
310316
//VK2ETA UTF-8 full support now
311317
//String subjectStr = msg.getSubject().replaceAll("\u2013", "-");
312318
//subjectStr = subjectStr.replaceAll("[^a-zA-Z0-9\\n\\s\\<\\>\\!\\[\\]\\{\\}\\:\\;\\\\\'\"\\/\\?\\=\\+\\-\\_\\@\\#\\+\\$\\%\\^\\&\\*,\\.\\(\\)\\|]", "~");
313-
String subjectStr = msg.getSubject();
319+
String subjectStr = msg.getSubject().replaceAll("\r", ""); //Remove carriage returns
314320
//JavaMail .getSize() is not accurate. Get body size and add to the header size
315321
String emailBody = getEmailTextFromMessage(msg);
316322
int mSize = emailBody.length() + fromString.length() + subjectStr.length();
@@ -371,9 +377,9 @@ public static String getHeaderList(int fromNumber) {
371377
//VK2ETA UTF-8 full support now
372378
//String subjectStr = messages[i].getSubject().replaceAll("\u2013", "-");
373379
//subjectStr = subjectStr.replaceAll("[^a-zA-Z0-9\\n\\s\\<\\>\\!\\[\\]\\{\\}\\:\\;\\\\\'\"\\/\\?\\=\\+\\-\\_\\@\\#\\+\\$\\%\\^\\&\\*,\\.\\(\\)\\|]", "~");
374-
String subjectStr = messages[i].getSubject();
380+
String subjectStr = messages[i].getSubject().replaceAll("\r", ""); //Remove carriage returns;
375381
//JavaMail .getSize() is not accurate. Get body size and add to the header size
376-
String emailBody = getEmailTextFromMessage(messages[i]);
382+
String emailBody = getEmailTextFromMessage(messages[i]).replaceAll("\r", ""); //Remove carriage returns;;
377383
int mSize = emailBody.length() + fromString.length() + subjectStr.length();
378384
//VK2ETA: check if Perl server adds a space before the email number
379385
mailHeaders += "" + (i + 1) + " " + fromString + " " + subjectStr + " " + mSize + "\n";
@@ -474,6 +480,11 @@ public static int getMailCount(String reqCallSign) {
474480
String fromString = msg.getFrom()[0].toString();
475481
//Remove name and only keep email address proper
476482
fromString = RMsgProcessor.extractEmailAddress(fromString);
483+
//Special case for GRIB files replies: grib requests are sent to "query@saildocs.com" but
484+
// replies are coming from "query-reply@saildocs.com", thereby never matching the filter
485+
if (fromString.equals("query-reply@saildocs.com")) {
486+
fromString = "query@saildocs.com";
487+
}
477488
String[] tos;
478489
//boolean forAll = false;
479490
//if (forAll) {
@@ -759,6 +770,11 @@ public static String readMail(int emailNumber, boolean compressedMail) {
759770
String fromString = msg.getFrom()[0].toString();
760771
//Remove name and only keep email address proper
761772
fromString = RMsgProcessor.extractEmailAddress(fromString);
773+
//Special case for GRIB files replies: grib requests are sent to "query@saildocs.com" but
774+
// replies are coming from "query-reply@saildocs.com", thereby never matching the filter
775+
if (fromString.equals("query-reply@saildocs.com")) {
776+
fromString = "query@saildocs.com";
777+
}
762778
String[] tos;
763779
//boolean forAll = false;
764780
//if (forAll) {
@@ -823,7 +839,7 @@ public static String readMail(int emailNumber, boolean compressedMail) {
823839
//VK2ETA full UTF-8 support
824840
//returnString = getEmailTextFromMessage(storedMessage).replaceAll("\u2013", "-");
825841
//returnString = returnString.replaceAll("[^a-zA-Z0-9\\n\\s\\<\\>\\!\\[\\]\\{\\}\\:\\;\\\\\'\"\\/\\?\\=\\+\\-\\_\\@\\#\\+\\$\\%\\^\\&\\*,\\.\\(\\)\\|]", "~");
826-
returnString = getEmailTextFromMessage(storedMessage);
842+
returnString = getEmailTextFromMessage(storedMessage).replaceAll("\r", ""); //Remove carriage returns;
827843
//Provide lead, size and end marker
828844
returnString = "Your msg: " + returnString.length() + "\n"
829845
+ returnString + "\n-end-\n";
@@ -1004,6 +1020,11 @@ public static String deleteMail(int emailNumber) {
10041020
String fromString = msg.getFrom()[0].toString();
10051021
//Remove name and only keep email address proper
10061022
fromString = RMsgProcessor.extractEmailAddress(fromString);
1023+
//Special case for GRIB files replies: grib requests are sent to "query@saildocs.com" but
1024+
// replies are coming from "query-reply@saildocs.com", thereby never matching the filter
1025+
if (fromString.equals("query-reply@saildocs.com")) {
1026+
fromString = "query@saildocs.com";
1027+
}
10071028
String[] tos;
10081029
//boolean forAll = false;
10091030
//if (forAll) {

src/javapskmail/Session.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ public void parseInput(String str) throws NoClassDefFoundError, FileNotFoundExce
10191019
}
10201020

10211021
//send mail (~SEND)
1022-
Pattern SMp = Pattern.compile("^(~SEND)$");
1022+
Pattern SMp = Pattern.compile("^\\s*(~SEND)$");
10231023
Matcher smm = SMp.matcher(str);
10241024
if (Main.ttyConnected.equals("Connected") & smm.lookingAt()) {
10251025
foundMatchingCommand = true;

0 commit comments

Comments
 (0)