This commit is contained in:
2022-09-06 16:04:17 +00:00
parent 715cb183a0
commit d6e7e9d6b7
5 changed files with 222 additions and 224 deletions

View File

@@ -74,69 +74,69 @@ namespace rockfishCore.Controllers
} }
[HttpPost("isspam/{account}/{id}")] // [HttpPost("isspam/{account}/{id}")]
public JsonResult IsSpam([FromRoute] string account, [FromRoute] uint id) // public JsonResult IsSpam([FromRoute] string account, [FromRoute] uint id)
{ // {
RfMail.rfMailAccount acct = RfMail.rfMailAccount.support; // RfMail.rfMailAccount acct = RfMail.rfMailAccount.support;
if (account.Contains("sales")) // if (account.Contains("sales"))
{ // {
acct = RfMail.rfMailAccount.sales; // acct = RfMail.rfMailAccount.sales;
} // }
try // try
{ // {
RfMail.HandleSpamMessage(id, acct); // RfMail.HandleSpamMessage(id, acct);
return Json(new { msg = "message processed as spam", ok = 1 }); // return Json(new { msg = "message processed as spam", ok = 1 });
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
return Json(new { msg = ex.Message, error = 1 }); // return Json(new { msg = ex.Message, error = 1 });
} // }
} // }
[HttpPost("movetosub/{account}/{id}")] // [HttpPost("movetosub/{account}/{id}")]
public JsonResult MoveToSub([FromRoute] string account, [FromRoute] uint id) // public JsonResult MoveToSub([FromRoute] string account, [FromRoute] uint id)
{ // {
RfMail.rfMailAccount acct = RfMail.rfMailAccount.support; // RfMail.rfMailAccount acct = RfMail.rfMailAccount.support;
if (account.Contains("sales")) // if (account.Contains("sales"))
{ // {
acct = RfMail.rfMailAccount.sales; // acct = RfMail.rfMailAccount.sales;
} // }
try // try
{ // {
RfMail.MoveAndMarkRead(id, acct, true); // RfMail.MoveAndMarkRead(id, acct, true);
return Json(new { msg = "message processed as spam", ok = 1 }); // return Json(new { msg = "message processed as spam", ok = 1 });
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
return Json(new { msg = ex.Message, error = 1 }); // return Json(new { msg = ex.Message, error = 1 });
} // }
} // }
[HttpPost("movetonotsub/{account}/{id}")] // [HttpPost("movetonotsub/{account}/{id}")]
public JsonResult MoveToNotSub([FromRoute] string account, [FromRoute] uint id) // public JsonResult MoveToNotSub([FromRoute] string account, [FromRoute] uint id)
{ // {
RfMail.rfMailAccount acct = RfMail.rfMailAccount.support; // RfMail.rfMailAccount acct = RfMail.rfMailAccount.support;
if (account.Contains("sales")) // if (account.Contains("sales"))
{ // {
acct = RfMail.rfMailAccount.sales; // acct = RfMail.rfMailAccount.sales;
} // }
try // try
{ // {
RfMail.MoveAndMarkRead(id, acct, false); // RfMail.MoveAndMarkRead(id, acct, false);
return Json(new { msg = "message processed as spam", ok = 1 }); // return Json(new { msg = "message processed as spam", ok = 1 });
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
return Json(new { msg = ex.Message, error = 1 }); // return Json(new { msg = ex.Message, error = 1 });
} // }
} // }
// //------------------------------------------------------ // //------------------------------------------------------

View File

@@ -29,16 +29,16 @@ namespace rockfishCore.Controllers
{ {
switch (service) switch (service)
{ {
case "MailMirror": // case "MailMirror":
Ret.Status = RfMail.MailIsMirroringProperly(); // Ret.Status = RfMail.MailIsMirroringProperly();
{ // {
DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://mail.ayanova.com/"); // DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://mail.ayanova.com/");
if (sslExpiry != null) // if (sslExpiry != null)
{ // {
Ret.ServiceCheckError += "Mail server SSL expires: " + sslExpiry.ToString(); // Ret.ServiceCheckError += "Mail server SSL expires: " + sslExpiry.ToString();
} // }
} // }
break; // break;
case "AyaNovaSite": case "AyaNovaSite":
Ret.Status = OpsDiagnostics.CheckWebsite("https://www.ayanova.com/", "Ground Zero Tech-Works Inc."); Ret.Status = OpsDiagnostics.CheckWebsite("https://www.ayanova.com/", "Ground Zero Tech-Works Inc.");
{ {
@@ -67,17 +67,17 @@ namespace rockfishCore.Controllers
case "Forum": case "Forum":
Ret.Status = OpsDiagnostics.CheckWebsite("http://forum.ayanova.com/", "<title>AyaNova forum</title>");//changed july 2021 but unreleased yet Ret.Status = OpsDiagnostics.CheckWebsite("http://forum.ayanova.com/", "<title>AyaNova forum</title>");//changed july 2021 but unreleased yet
break; break;
case "DevOps": // case "DevOps":
Ret.Status = OpsDiagnostics.CheckWebsite("https://test.helloayanova.com/api/v8/", "AyaNova server"); // Ret.Status = OpsDiagnostics.CheckWebsite("https://test.helloayanova.com/api/v8/", "AyaNova server");
//devops https check url is https://www.helloayanova.com/ // //devops https check url is https://www.helloayanova.com/
{ // {
DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://www.helloayanova.com/"); // DateTime? sslExpiry = OpsDiagnostics.SSLCertExpiryDate("https://www.helloayanova.com/");
if (sslExpiry != null) // if (sslExpiry != null)
{ // {
Ret.ServiceCheckError += "DEVOPS SSL expires: " + sslExpiry.ToString(); // Ret.ServiceCheckError += "DEVOPS SSL expires: " + sslExpiry.ToString();
} // }
} // }
break; // break;
case "Backup": case "Backup":
Ret.Status = OpsDiagnostics.VerifyBackups(); Ret.Status = OpsDiagnostics.VerifyBackups();
break; break;

View File

@@ -26,21 +26,19 @@ namespace rockfishCore.Util
public static class RfMail public static class RfMail
{ {
public const string MAIL_MIRROR_SMPT_ADDRESS = "mail2.ayanova.com"; // public const string MAIL_MIRROR_SMPT_ADDRESS = "mail2.ayanova.com";
public const string MAIL_MIRROR_IMAP_ADDRESS = "mail2.ayanova.com"; // public const string MAIL_MIRROR_IMAP_ADDRESS = "mail2.ayanova.com";
public const string MAIL_SMPT_ADDRESS = "mail.ayanova.com"; public const string MAIL_SMPT_ADDRESS = "smtp.fastmail.com";
public const int MAIL_SMPT_PORT = 465; public const int MAIL_SMPT_PORT = 465;
public const string MAIL_IMAP_ADDRESS = "mail.ayanova.com"; public const string MAIL_IMAP_ADDRESS = "imap.fastmail.com";
//public const int MAIL_IMAP_PORT = 993; public const int MAIL_IMAP_PORT = 993;
//testing
public const int MAIL_IMAP_PORT = 143; public const string FASTMAIL_ACCOUNT_SUPPORT = "support@onayanova.com";
public const string FASTMAIL_ACCOUNT_PASSWORD_SUPPORT = "rxwdlv4dm6kz3mhr";
public const string MAIL_ACCOUNT_SUPPORT = "support@ayanova.com"; // public const string MAIL_ACCOUNT_SALES = "sales@ayanova.com";
public const string MAIL_ACCOUNT_PASSWORD_SUPPORT = "e527b6c5a00c27bb61ca694b3de0ee178cbe3f1541a772774762ed48e9caf5ce"; // public const string MAIL_ACCOUNT_PASSWORD_SALES = "6edbae5eb616a975abf86bcd9f45616f5c70c4f05189af60a1caaa62b406149d";
public const string MAIL_ACCOUNT_SALES = "sales@ayanova.com";
public const string MAIL_ACCOUNT_PASSWORD_SALES = "6edbae5eb616a975abf86bcd9f45616f5c70c4f05189af60a1caaa62b406149d";
public enum rfMailAccount public enum rfMailAccount
{ {
@@ -92,7 +90,7 @@ namespace rockfishCore.Util
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
// Note: only needed if the SMTP server requires authentication // Note: only needed if the SMTP server requires authentication
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
client.Send(message); client.Send(message);
client.Disconnect(true); client.Disconnect(true);
@@ -112,7 +110,7 @@ namespace rockfishCore.Util
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
// Note: only needed if the SMTP server requires authentication // Note: only needed if the SMTP server requires authentication
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
client.Send(message); client.Send(message);
client.Disconnect(true); client.Disconnect(true);
@@ -144,7 +142,7 @@ namespace rockfishCore.Util
} }
//send with optional tracking //send with optional tracking
DoSend(message, MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT, trackDeliveryStatus); DoSend(message, FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT, trackDeliveryStatus);
// using (var client = new SmtpClient()) // using (var client = new SmtpClient())
// { // {
@@ -170,42 +168,42 @@ namespace rockfishCore.Util
/// <summary> // /// <summary>
/// Forward a message to the isspam@ayanova.com address and then erase it // /// Forward a message to the isspam@ayanova.com address and then erase it
/// </summary> // /// </summary>
/// <param name="spamMessageId"></param> // /// <param name="spamMessageId"></param>
/// <param name="replyFromAccount"></param> // /// <param name="replyFromAccount"></param>
public static void HandleSpamMessage(uint spamMessageId, rfMailAccount replyFromAccount) // public static void HandleSpamMessage(uint spamMessageId, rfMailAccount replyFromAccount)
{ // {
using (var client = new ImapClient()) // using (var client = new ImapClient())
{ // {
// Accept all SSL certificates // // Accept all SSL certificates
client.ServerCertificateValidationCallback = (s, c, h, e) => true; // client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT); // client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT);
// Note: since we don't have an OAuth2 token, disable // // Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism. // // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); // client.AuthenticationMechanisms.Remove("XOAUTH2");
if (replyFromAccount == rfMailAccount.support) // if (replyFromAccount == rfMailAccount.support)
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); // client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
else // else
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
var spamFolder = client.GetFolder("Spam"); // var spamFolder = client.GetFolder("Spam");
if (spamFolder != null) // if (spamFolder != null)
{ // {
client.Inbox.Open(FolderAccess.ReadWrite); // client.Inbox.Open(FolderAccess.ReadWrite);
client.Inbox.MoveTo(new UniqueId(spamMessageId), spamFolder); // client.Inbox.MoveTo(new UniqueId(spamMessageId), spamFolder);
} // }
client.Disconnect(true); // client.Disconnect(true);
} // }
}//spaminator // }//spaminator
#endregion #endregion
@@ -213,49 +211,49 @@ namespace rockfishCore.Util
/// <summary> // /// <summary>
/// Move to sub or unsub mail folder and mark as read // /// Move to sub or unsub mail folder and mark as read
/// </summary> // /// </summary>
/// <param name="moveMessageId"></param> // /// <param name="moveMessageId"></param>
/// <param name="replyFromAccount"></param> // /// <param name="replyFromAccount"></param>
public static void MoveAndMarkRead(uint moveMessageId, rfMailAccount replyFromAccount, bool toSubscribed) // public static void MoveAndMarkRead(uint moveMessageId, rfMailAccount replyFromAccount, bool toSubscribed)
{ // {
using (var client = new ImapClient()) // using (var client = new ImapClient())
{ // {
// Accept all SSL certificates // // Accept all SSL certificates
client.ServerCertificateValidationCallback = (s, c, h, e) => true; // client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT); // client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT);
// Note: since we don't have an OAuth2 token, disable // // Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism. // // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); // client.AuthenticationMechanisms.Remove("XOAUTH2");
if (replyFromAccount == rfMailAccount.support) // if (replyFromAccount == rfMailAccount.support)
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); // client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
else // else
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
//AyaNovaReceivedNOTSUB // //AyaNovaReceivedNOTSUB
//AyaNovaReceivedSubscribed // //AyaNovaReceivedSubscribed
//Flag as read // //Flag as read
//flag the message as having been replied to // //flag the message as having been replied to
FlagMessageSeen(moveMessageId, replyFromAccount); // FlagMessageSeen(moveMessageId, replyFromAccount);
var newFolder = client.GetFolder(toSubscribed ? "AyaNovaReceivedSubscribed" : "AyaNovaReceivedNOTSUB"); // var newFolder = client.GetFolder(toSubscribed ? "AyaNovaReceivedSubscribed" : "AyaNovaReceivedNOTSUB");
if (newFolder != null) // if (newFolder != null)
{ // {
client.Inbox.Open(FolderAccess.ReadWrite); // client.Inbox.Open(FolderAccess.ReadWrite);
client.Inbox.MoveTo(new UniqueId(moveMessageId), newFolder); // client.Inbox.MoveTo(new UniqueId(moveMessageId), newFolder);
} // }
client.Disconnect(true); // client.Disconnect(true);
} // }
}//spaminator // }//spaminator
#endregion #endregion
@@ -276,19 +274,19 @@ namespace rockfishCore.Util
MailboxAddress from = null; MailboxAddress from = null;
string from_account = ""; string from_account = "";
string from_account_password = ""; string from_account_password = "";
switch (replyFromAccount) // switch (replyFromAccount)
{ // {
case rfMailAccount.sales: // case rfMailAccount.sales:
from_account = MAIL_ACCOUNT_SALES; // from_account = MAIL_ACCOUNT_SALES;
from_account_password = MAIL_ACCOUNT_PASSWORD_SALES; // from_account_password = MAIL_ACCOUNT_PASSWORD_SALES;
// from = new MailboxAddress("", from_account);
// break;
// default:
from_account = FASTMAIL_ACCOUNT_SUPPORT;
from_account_password = FASTMAIL_ACCOUNT_PASSWORD_SUPPORT;
from = new MailboxAddress("", from_account); from = new MailboxAddress("", from_account);
break; // break;
default: // }
from_account = MAIL_ACCOUNT_SUPPORT;
from_account_password = MAIL_ACCOUNT_PASSWORD_SUPPORT;
from = new MailboxAddress("", from_account);
break;
}
reply.From.Add(from); reply.From.Add(from);
// reply to the sender of the message // reply to the sender of the message
@@ -412,14 +410,14 @@ namespace rockfishCore.Util
// Note: since we don't have an OAuth2 token, disable // Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism. // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
if (fromAccount == rfMailAccount.support) // if (fromAccount == rfMailAccount.support)
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
else // else
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
var inbox = client.Inbox; var inbox = client.Inbox;
inbox.Open(FolderAccess.ReadOnly); inbox.Open(FolderAccess.ReadOnly);
@@ -443,7 +441,7 @@ namespace rockfishCore.Util
// Note: since we don't have an OAuth2 token, disable // Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism. // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
var inbox = client.Inbox; var inbox = client.Inbox;
inbox.Open(FolderAccess.ReadOnly); inbox.Open(FolderAccess.ReadOnly);
@@ -469,14 +467,14 @@ namespace rockfishCore.Util
// the XOAUTH2 authentication mechanism. // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
if (inAccount == rfMailAccount.support) // if (inAccount == rfMailAccount.support)
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
else // else
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
var inbox = client.Inbox; var inbox = client.Inbox;
inbox.Open(FolderAccess.ReadWrite); inbox.Open(FolderAccess.ReadWrite);
@@ -501,14 +499,14 @@ namespace rockfishCore.Util
// the XOAUTH2 authentication mechanism. // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
if (inAccount == rfMailAccount.support) // if (inAccount == rfMailAccount.support)
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
else // else
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
var inbox = client.Inbox; var inbox = client.Inbox;
inbox.Open(FolderAccess.ReadWrite); inbox.Open(FolderAccess.ReadWrite);
@@ -571,7 +569,7 @@ namespace rockfishCore.Util
// Note: since we don't have an OAuth2 token, disable // Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism. // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
var draftFolder = client.GetFolder("Drafts");//Our surgemail server works with this other servers in future might not var draftFolder = client.GetFolder("Drafts");//Our surgemail server works with this other servers in future might not
@@ -601,8 +599,8 @@ namespace rockfishCore.Util
{ {
List<rfMessageSummary> ret = new List<rfMessageSummary>(); List<rfMessageSummary> ret = new List<rfMessageSummary>();
ret.AddRange(getInboxSummariesFor(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT)); ret.AddRange(getInboxSummariesFor(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT));
ret.AddRange(getInboxSummariesFor(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES)); // ret.AddRange(getInboxSummariesFor(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES));
return ret; return ret;
} }
@@ -715,14 +713,14 @@ namespace rockfishCore.Util
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
//TODO: make accounts reside in dictionary in future //TODO: make accounts reside in dictionary in future
if (mailAccount == "support@ayanova.com") // if (mailAccount == "support@ayanova.com")
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
if (mailAccount == "sales@ayanova.com") // if (mailAccount == "sales@ayanova.com")
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
var fldr = client.GetFolder(mailFolder); var fldr = client.GetFolder(mailFolder);
fldr.Open(FolderAccess.ReadOnly); fldr.Open(FolderAccess.ReadOnly);
@@ -807,22 +805,22 @@ namespace rockfishCore.Util
//https://github.com/jstedfast/MailKit/issues/515#issuecomment-439438242 //https://github.com/jstedfast/MailKit/issues/515#issuecomment-439438242
client.CheckCertificateRevocation = false; client.CheckCertificateRevocation = false;
//client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT, true); //client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT, true);
if (mirrorServer) // if (mirrorServer)
client.Connect(MAIL_MIRROR_IMAP_ADDRESS, MAIL_IMAP_PORT); // client.Connect(MAIL_MIRROR_IMAP_ADDRESS, MAIL_IMAP_PORT);
else // else
client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT); client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT);
// Note: since we don't have an OAuth2 token, disable // Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism. // the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2"); client.AuthenticationMechanisms.Remove("XOAUTH2");
if (mailAccount == "support@ayanova.com") // if (mailAccount == "support@ayanova.com")
{ // {
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT); client.Authenticate(FASTMAIL_ACCOUNT_SUPPORT, FASTMAIL_ACCOUNT_PASSWORD_SUPPORT);
} // }
if (mailAccount == "sales@ayanova.com") // if (mailAccount == "sales@ayanova.com")
{ // {
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES); // client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
} // }
var fldr = client.GetFolder(mailFolder); var fldr = client.GetFolder(mailFolder);
fldr.Open(FolderAccess.ReadOnly); fldr.Open(FolderAccess.ReadOnly);

View File

@@ -74,13 +74,13 @@ app.ops = (function() {
//Context menu //Context menu
app.nav.contextClear(); app.nav.contextClear();
checkService("MailMirror"); //checkService("MailMirror");
checkService("AyaNovaSite"); checkService("AyaNovaSite");
checkService("Backup"); checkService("Backup");
checkService("ContactForm"); checkService("ContactForm");
checkService("Forum"); checkService("Forum");
checkService("Subversion"); checkService("Subversion");
checkService("DevOps"); //checkService("DevOps");
checkService("APISite"); checkService("APISite");
}; };

View File

@@ -2,13 +2,13 @@
<h3>Operations status</h3> <h3>Operations status</h3>
<pre id="rf-ops-error" class="text-danger"></pre> <pre id="rf-ops-error" class="text-danger"></pre>
<div id="rf-ops-status"> <div id="rf-ops-status">
<div> {{!-- <div>
<h5> <h5>
<i id="MailMirror" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i> <i id="MailMirror" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i>
Mail / mirror Mail / mirror
</h5> </h5>
<pre id="MailMirror-error" class="text-danger"></pre> <pre id="MailMirror-error" class="text-danger"></pre>
</div> </div> --}}
<div> <div>
<h5> <h5>
<i id="AyaNovaSite" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i> <i id="AyaNovaSite" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i>
@@ -44,13 +44,13 @@
</h5> </h5>
<pre id="Subversion-error" class="text-danger"></pre> <pre id="Subversion-error" class="text-danger"></pre>
</div> </div>
<div> {{!-- <div>
<h5> <h5>
<i id="DevOps" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i> <i id="DevOps" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i>
DevOps server DevOps server
</h5> </h5>
<pre id="DevOps-error" class="text-danger"></pre> <pre id="DevOps-error" class="text-danger"></pre>
</div> </div> --}}
<div> <div>
<h5> <h5>
<i id="APISite" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i> <i id="APISite" class="mdi mdi-36px mdi-help-circle-outline text-warning"></i>