Advertisement
Guest User

Untitled

a guest
Jul 8th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. 07/07/2015 12:02:56.85 OWSTIMER.EXE (0x13A4) 0x07F0 SharePoint Foundation E-Mail 6873 Warning An error occurred while processing the incoming e-mail file C:inetpubmailrootDrop15ed460901d0b89c00000008.eml. The error was: Object reference not set to an instance of an object.. ca05878c-e64b-4a32-bdf0-1916a8e8464a
  2.  
  3. using System;
  4. using System.Security.Permissions;
  5. using Microsoft.SharePoint;
  6. using Microsoft.SharePoint.Utilities;
  7. using Microsoft.SharePoint.Workflow;
  8.  
  9. namespace incomail_proxylist.incomail
  10. {
  11. public class incomail : SPEmailEventReceiver
  12. {
  13. public override void EmailReceived(SPList list, SPEmailMessage emailMessage, String receiverData)
  14. {
  15. base.EmailReceived(list, emailMessage, receiverData);
  16. string str = emailMessage.PlainTextBody;
  17. string booli = emailMessage.Headers["subject"];
  18.  
  19. if (booli.Contains("COMPLETE_LIST"))
  20. {
  21. string[] entries = str.Split('~'); //new string[] { "rn", "n" }, StringSplitOptions.None
  22. for (int i = 0; i <= entries.Length; i++)
  23. {
  24. SPListItem newItem = list.Items.Add();
  25. string[] arr = entries[i].Split(';');
  26.  
  27. newItem["Title"] = arr[0];
  28. newItem["Host"] = arr[1];
  29. newItem["Internal_IP"] = arr[2];
  30. newItem["External_IP"] = arr[3];
  31. newItem["Incoming_URL"] = arr[4];
  32. newItem["Forwarding_URL"] = arr[5];
  33. newItem["SSL"] = arr[6];
  34. newItem["Status"] = arr[7];
  35. newItem["ConfigPath"] = arr[8];
  36.  
  37. newItem.Update();
  38. }
  39. }
  40. else
  41. {
  42. SPListItem newItem = list.Items.Add();
  43. string[] arr = str.Split(';');
  44.  
  45. newItem["Title"] = emailMessage.Headers["subject"];
  46. newItem["Host"] = arr[0];
  47. newItem["Internal_IP"] = arr[1];
  48. newItem["External_IP"] = arr[2];
  49. newItem["Incoming_URL"] = arr[3];
  50. newItem["Forwarding_URL"] = arr[4];
  51. newItem["SSL"] = arr[5];
  52. newItem["Status"] = arr[6];
  53. newItem["ConfigPath"] = arr[7];
  54.  
  55. newItem.Update();
  56. }
  57. }
  58. }
  59. }
  60.  
  61. x-sender: server-a@domain.com
  62. x-receiver: server-b@domain.com
  63. Received: from exchange.domain.com ([ip of server]) by sharepoint.domain.com over TLS secured channel with Microsoft SMTPSVC(7.5.7600.16385);
  64. Tue, 7 Jul 2015 10:53:37 +0200
  65. Received: from exchange2.domain.com (ip of server) by
  66. exchange.domain.com (ip of server) with Microsoft SMTP Server (TLS) id
  67. 14.3.224.2; Tue, 7 Jul 2015 10:53:32 +0200
  68. Received: from server-a.domain.com (ip of server) by
  69. exchange2.domain.com (ip of server) with Microsoft SMTP Server id
  70. 14.3.224.2; Tue, 7 Jul 2015 10:53:32 +0200
  71. Message-ID: <686044.912410097-sendEmail@server-a>
  72. From: Server-A <server-a@domain.com>
  73. To: "server-b@domain.com" <server-b@domain.com>
  74. Subject: COMPLETE_LIST
  75. Date: Tue, 7 Jul 2015 08:53:32 +0000
  76. X-Mailer: sendEmail-1.56
  77. MIME-Version: 1.0
  78. Content-Type: multipart/related;
  79. boundary="----MIME delimiter for sendEmail-943467.83247693"
  80. Return-Path: server-a@domain.com
  81. X-OriginalArrivalTime: 07 Jul 2015 08:53:37.0598 (UTC) FILETIME=[69F27DE0:01D0B892]
  82.  
  83. ------MIME delimiter for sendEmail-943467.83247693
  84. Content-Type: text/plain; charset="iso-8859-1"
  85. Content-Transfer-Encoding: 7bit
  86.  
  87. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  88. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  89. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  90. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  91. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  92. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  93. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  94. title;server-a.domain.com;ip1;ip2;incomingURL;forwardingURL;active;/path/to/config-file~
  95.  
  96. ------MIME delimiter for sendEmail-943467.83247693--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement