check for debug

master
Christopher 2020-07-01 18:56:15 +02:00
parent 0821d12685
commit 517cd8c56e
1 changed files with 15 additions and 6 deletions

View File

@ -150,23 +150,31 @@ namespace OpenSim.Modules.EMail
if (IMAP_SERVER_SSL == true) if (IMAP_SERVER_SSL == true)
{ {
if (m_debug)
m_log.Info("[" + Name + "] Connect SSL"); m_log.Info("[" + Name + "] Connect SSL");
client.Connect(IMAP_SERVER_HOSTNAME, IMAP_SERVER_PORT, SecureSocketOptions.Auto); client.Connect(IMAP_SERVER_HOSTNAME, IMAP_SERVER_PORT, SecureSocketOptions.Auto);
} }
else if (IMAP_SERVER_TLS == true) else if (IMAP_SERVER_TLS == true)
{ {
if (m_debug)
m_log.Info("[" + Name + "] Connect TLS"); m_log.Info("[" + Name + "] Connect TLS");
client.Connect(IMAP_SERVER_HOSTNAME, IMAP_SERVER_PORT, SecureSocketOptions.StartTlsWhenAvailable); client.Connect(IMAP_SERVER_HOSTNAME, IMAP_SERVER_PORT, SecureSocketOptions.StartTlsWhenAvailable);
} }
else else
{ {
if (m_debug)
m_log.Info("[" + Name + "] Connect None"); m_log.Info("[" + Name + "] Connect None");
client.Connect(IMAP_SERVER_HOSTNAME, IMAP_SERVER_PORT, SecureSocketOptions.None); client.Connect(IMAP_SERVER_HOSTNAME, IMAP_SERVER_PORT, SecureSocketOptions.None);
} }
if (IMAP_SERVER_LOGIN != String.Empty && IMAP_SERVER_PASSWORD != String.Empty) if (IMAP_SERVER_LOGIN != String.Empty && IMAP_SERVER_PASSWORD != String.Empty)
{ {
if (m_debug)
m_log.Info("[" + Name + "] Login with " + IMAP_SERVER_LOGIN + ";" + IMAP_SERVER_PASSWORD); m_log.Info("[" + Name + "] Login with " + IMAP_SERVER_LOGIN + ";" + IMAP_SERVER_PASSWORD);
client.Authenticate(IMAP_SERVER_LOGIN, IMAP_SERVER_PASSWORD); client.Authenticate(IMAP_SERVER_LOGIN, IMAP_SERVER_PASSWORD);
} }
@ -174,7 +182,9 @@ namespace OpenSim.Modules.EMail
IMailFolder IMAPInbox = client.Inbox; IMailFolder IMAPInbox = client.Inbox;
IMAPInbox.Open(FolderAccess.ReadWrite); IMAPInbox.Open(FolderAccess.ReadWrite);
if (m_debug)
m_log.Info("[" + Name + "] Found " + IMAPInbox.Count + " messages."); m_log.Info("[" + Name + "] Found " + IMAPInbox.Count + " messages.");
for (int i = 0; i < IMAPInbox.Count; i++) for (int i = 0; i < IMAPInbox.Count; i++)
{ {
MimeMessage message = IMAPInbox.GetMessage(i); MimeMessage message = IMAPInbox.GetMessage(i);
@ -188,7 +198,6 @@ namespace OpenSim.Modules.EMail
m_log.Info("[" + Name + "] Objekt ID: " + adress.Address.Split('@')[0]); m_log.Info("[" + Name + "] Objekt ID: " + adress.Address.Split('@')[0]);
} }
String UUIDString = adress.Address.Split('@')[0].Trim(); String UUIDString = adress.Address.Split('@')[0].Trim();
if(isUUID(UUIDString)) if(isUUID(UUIDString))