@@ -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) {
0 commit comments