This commit is contained in:
2019-07-04 18:49:05 +00:00
parent d799c3dee2
commit edceae6557
2 changed files with 45 additions and 5 deletions

View File

@@ -200,7 +200,7 @@ namespace rockfishCore.Util
#endregion
#region handle read and move message
#region handle read and move message
@@ -228,10 +228,14 @@ namespace rockfishCore.Util
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
}
//AyaNovaReceivedNOTSUB
//AyaNovaReceivedSubscribed
//AyaNovaReceivedNOTSUB
//AyaNovaReceivedSubscribed
var newFolder = client.GetFolder(toSubscribed?"AyaNovaReceivedSubscribed":"AyaNovaReceivedNOTSUB");
//Flag as read
//flag the message as having been replied to
FlagMessageSeen(moveMessageId, replyFromAccount);
var newFolder = client.GetFolder(toSubscribed ? "AyaNovaReceivedSubscribed" : "AyaNovaReceivedNOTSUB");
if (newFolder != null)
{
@@ -443,6 +447,39 @@ namespace rockfishCore.Util
}//get message
//Flag message as seen
public static bool FlagMessageSeen(uint uid, rfMailAccount inAccount = rfMailAccount.support)
{
using (var client = new ImapClient())
{
// Accept all SSL certificates
client.ServerCertificateValidationCallback = (s, c, h, e) => true;
client.Connect(MAIL_IMAP_ADDRESS, MAIL_IMAP_PORT);
// Note: since we don't have an OAuth2 token, disable
// the XOAUTH2 authentication mechanism.
client.AuthenticationMechanisms.Remove("XOAUTH2");
if (inAccount == rfMailAccount.support)
{
client.Authenticate(MAIL_ACCOUNT_SUPPORT, MAIL_ACCOUNT_PASSWORD_SUPPORT);
}
else
{
client.Authenticate(MAIL_ACCOUNT_SALES, MAIL_ACCOUNT_PASSWORD_SALES);
}
var inbox = client.Inbox;
inbox.Open(FolderAccess.ReadWrite);
inbox.AddFlags(new UniqueId(uid), MessageFlags.Seen, true);
// inbox.AddFlags(new UniqueId(uid), MessageFlags.Answered, true);
client.Disconnect(true);
return true;
}
}//get message
////////////////////////////////////////////////////
//Put a message in the drafts folder of support
//