AnsweredAssumed Answered

POP3 with UFL Interface runs but does not receive data (experimental)

Question asked by ManuDB on Jul 8, 2019
Latest reply on Aug 14, 2019 by ManuDB



I was playing around with the POP3 interface as an option to mail files to our UFL Interfaces (in some reporting cases I have to manually set them in folders now). As you'll see I did some quite experimental things (like linking my personal inbox), but I was hoping an expert could already point out from the logs whether I am doing something clearly wrong, or a firewall setting or similar might be the issue. I'll share the output below. I based my INI and mail content on the example in the UFL interface manual, so this should be correct. To be honest it already did more than I expected (as UFL runs on a server you can't even copy files from, unless going via the disk of another server, so I don't just expect mail to be allowed in, I'm really surprised it actually connected to the office365 server).



Here I filled in the POP3 settings that seem to be right for Office365 according to the internet. As you can see it waits a minute and closes with a socket exception.

27-Jun-2019 18:08:04 [PI_UFL] [Info] PI UFL Interface start. 
27-Jun-2019 18:08:04 [PI_UFL] [Info] Interface Initialization Parameters, (from command line).
27-Jun-2019 18:08:04 [PI_UFL] [Info] AM 5.
27-Jun-2019 18:08:04 [PI_UFL] [Info] CF C:\Program Files (x86)\PIPC\Interfaces\PI_UFL\INI\V2\TEST_UFL_POP3.ini.
27-Jun-2019 18:08:04 [PI_UFL] [Info] DES 290.
27-Jun-2019 18:08:04 [PI_UFL] [Info] DISABLECOUNTERS false.
27-Jun-2019 18:08:04 [PI_UFL] [Info] EC 0.
27-Jun-2019 18:08:04 [PI_UFL] [Info] F 00:00:05.00,00:00:00.
27-Jun-2019 18:08:04 [PI_UFL] [Info] HOST DA:port.
27-Jun-2019 18:08:04 [PI_UFL] [Info] UHT_ID 0.
27-Jun-2019 18:08:04 [PI_UFL] [Info] IMT false.
27-Jun-2019 18:08:04 [PI_UFL] [Info] LB false.
27-Jun-2019 18:08:04 [PI_UFL] [Info] LBS false.
27-Jun-2019 18:08:04 [PI_UFL] [Info] PERF 8.000000.
27-Jun-2019 18:08:04 [PI_UFL] [Info] PS L-PIwebAPI.
27-Jun-2019 18:08:04 [PI_UFL] [Info] RBO false.
27-Jun-2019 18:08:04 [PI_UFL] [Info] ServiceID 666.
27-Jun-2019 18:08:04 [PI_UFL] [Info] TM .
27-Jun-2019 18:08:04 [PI_UFL] [Info] UTC true.
27-Jun-2019 18:08:04 [PI_UFL] [Info] WD 10.
27-Jun-2019 18:08:04 [PI_UFL] [Info] WS 10240.
27-Jun-2019 18:08:04 [PI_UFL] [Info] Interface Initialization Parameters, (from INI file).
27-Jun-2019 18:08:04 [PI_UFL] [Info] DEB 6.
27-Jun-2019 18:08:04 [PI_UFL] [Info] MAXLOG 10.
27-Jun-2019 18:08:04 [PI_UFL] [Info] MAXLOGSIZE 10.
27-Jun-2019 18:08:04 [PI_UFL] [Info] MSGINERROR E:\Logs\interfaces\POP3.err.
27-Jun-2019 18:08:04 [PI_UFL] [Info] LOCALE English - United States.
27-Jun-2019 18:08:04 [PI_UFL] [Info] OUTPUT E:\Logs\interfaces\POP3.out.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] PLugIn Initialization Parameters:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] POP3_SERVER
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] POP3_PORT 995.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] POP3_USER NAME@COMPANY.COM.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] SMTP_SERVER
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] SMTP_PORT 587.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] SMTP_USER NAME@COMPANY.COM.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] FORWARD_TO NAME@COMPANY.COM.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] FORWARD_AS_UFLSTREAM False.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] FILTER_FROM NAME@PRIVATE.COM;.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] MAIL_FROM False.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] FROM_PREFIX [From]:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] MAIL_DATE False.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] DATE_PREFIX [Date]:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] MAIL_SUBJECT False.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] SUBJECT_PREFIX [Subject]:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] MAIL_BODY True.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] BODY_PREFIX [Body]:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] MAIL_ATTACHMENT False.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] ATTACHMENT_PREFIX [Attachment]:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] PFN False.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] PFN_PREFIX [Attached File Name]:.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] POP3_COMMAND_WAIT 500.
27-Jun-2019 18:08:04 [PI_UFL] [PL_Info] Pop3 PlugIn version initialized.
27-Jun-2019 18:09:05 [PI_UFL] [Error] PL_InitReport() Error -1.
27-Jun-2019 18:09:05 [PI_UFL] [PL_Error] recv 10053 : see the 'Windows Sockets Error Codes' for description.
27-Jun-2019 18:09:05 [PI_UFL] [Error] Exiting...



Now I changed the POP3 setting to those of SMTP (although otherwise instructed in the manual, just experimenting) and this time it really seems to connect to my inbox, the DA and 'scan' as it mentions. That was the only thing that happens however, if I send a mail from mentioned filter_from with a body it should process, nothing happens.

27-Jun-2019 18:03:39 [PI_UFL] [Info] PI UFL Interface start. 
27-Jun-2019 18:03:40 [PI_UFL] [Info] Interface Initialization Parameters, (from command line).
27-Jun-2019 18:03:40 [PI_UFL] [Info] AM 5.
27-Jun-2019 18:03:40 [PI_UFL] [Info] CF C:\Program Files (x86)\PIPC\Interfaces\PI_UFL\INI\V2\TEST_UFL_POP3.ini.
27-Jun-2019 18:03:40 [PI_UFL] [Info] DES 290.
27-Jun-2019 18:03:40 [PI_UFL] [Info] DISABLECOUNTERS false.
27-Jun-2019 18:03:40 [PI_UFL] [Info] EC 0.
27-Jun-2019 18:03:40 [PI_UFL] [Info] F 00:00:05.00,00:00:00.
27-Jun-2019 18:03:40 [PI_UFL] [Info] HOST DA:port.
27-Jun-2019 18:03:40 [PI_UFL] [Info] UHT_ID 0.
27-Jun-2019 18:03:40 [PI_UFL] [Info] IMT false.
27-Jun-2019 18:03:40 [PI_UFL] [Info] LB false.
27-Jun-2019 18:03:40 [PI_UFL] [Info] LBS false.
27-Jun-2019 18:03:40 [PI_UFL] [Info] PERF 8.000000.
27-Jun-2019 18:03:40 [PI_UFL] [Info] PS L-PIwebAPI.
27-Jun-2019 18:03:40 [PI_UFL] [Info] RBO false.
27-Jun-2019 18:03:40 [PI_UFL] [Info] ServiceID 666.
27-Jun-2019 18:03:40 [PI_UFL] [Info] TM .
27-Jun-2019 18:03:40 [PI_UFL] [Info] UTC true.
27-Jun-2019 18:03:40 [PI_UFL] [Info] WD 10.
27-Jun-2019 18:03:40 [PI_UFL] [Info] WS 10240.
27-Jun-2019 18:03:40 [PI_UFL] [Info] Interface Initialization Parameters, (from INI file).
27-Jun-2019 18:03:40 [PI_UFL] [Info] DEB 6.
27-Jun-2019 18:03:40 [PI_UFL] [Info] MAXLOG 10.
27-Jun-2019 18:03:40 [PI_UFL] [Info] MAXLOGSIZE 10.
27-Jun-2019 18:03:40 [PI_UFL] [Info] MSGINERROR E:\Logs\interfaces\POP3.err.
27-Jun-2019 18:03:40 [PI_UFL] [Info] LOCALE English - United States.
27-Jun-2019 18:03:40 [PI_UFL] [Info] OUTPUT E:\Logs\interfaces\POP3.out.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] PLugIn Initialization Parameters:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] POP3_SERVER
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] POP3_PORT 587.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] POP3_USER NAME@COMPANY.COM.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] SMTP_SERVER
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] SMTP_PORT 587.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] SMTP_USER NAME@COMPANY.COM.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] FORWARD_TO NAME@COMPANY.COM.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] FORWARD_AS_UFLSTREAM False.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] FILTER_FROM NAME@PRIVATE.COM;.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] MAIL_FROM False.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] FROM_PREFIX [From]:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] MAIL_DATE False.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] DATE_PREFIX [Date]:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] MAIL_SUBJECT False.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] SUBJECT_PREFIX [Subject]:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] MAIL_BODY True.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] BODY_PREFIX [Body]:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] MAIL_ATTACHMENT False.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] ATTACHMENT_PREFIX [Attachment]:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] PFN False.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] PFN_PREFIX [Attached File Name]:.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] POP3_COMMAND_WAIT 500.
27-Jun-2019 18:03:58 [PI_UFL] [PL_Info] Pop3 PlugIn version initialized.
27-Jun-2019 18:04:09 [PI_UFL] [PL_Info] Successfully connected and logged to as NAME@COMPANY.COM.
27-Jun-2019 18:04:09 [PI_UFL] [Info] API ( connected to PI Server : DA:port (3.4.425.1435).
27-Jun-2019 18:04:10 [PI_UFL] [Info] PI point : 00TEST-PIwebAPI.POST.TEXT.Value : Added to cache.
27-Jun-2019 18:04:10 [PI_UFL] [Info] PI point : 00TEST-PIwebAPI.POST.NUMBER.Value : Added to cache.
27-Jun-2019 18:04:10 [PI_UFL] [Info] PI point : SYS.DQ.Monitor.Pibufss.PowerShellGuard.MESSAGE.Value : Added to cache.
27-Jun-2019 18:04:10 [PI_UFL] [Info] PI point : SYS.DQ.Monitor.Pibufss.DATFile.SIZE.Value : Added to cache.
27-Jun-2019 18:04:10 [PI_UFL] [Info] PI point : 00TEST-BonnyPING1 : Added to cache.
27-Jun-2019 18:04:10 [PI_UFL] [Info] PI point : 00TEST-BonnyPING2 : Added to cache.
27-Jun-2019 18:04:10 [PI_UFL] [Info] 6 point(s) with point source : L-PIwebAPI : Cached.
27-Jun-2019 18:04:10 [PI_UFL] [Info] Scheduler PI UFL Scheduler is starting...
27-Jun-2019 18:04:10 [PI_UFL] [Info] Scheduler PI UFL Scheduler started.
27-Jun-2019 18:04:15 [PI_UFL] [Info] Begin reading PI point updates.
27-Jun-2019 18:04:15 [PI_UFL] [Info] End reading PI point updates.
27-Jun-2019 18:04:15 [PI_UFL] [Info] Begin scan.
*After closing the window*:
27-Jun-2019 18:04:24 [PI_UFL] [Info] CTRL_CLOSE_EVENT received.
27-Jun-2019 18:04:25 [PI_UFL] [Info] PL_Stop().

PLUG-IN = POP3.dll
POP3_SERVER = outlook. OR
POP3_PORT = 995 OR 587
POP3_PASSWORD = [Generated Outlook app password to bypass 2-factor]
POP3_SASL = false
MAIL_FROM = false
MAIL_DATE = false
MAIL_BODY = true
PFN = false
PFN_PREFIX = [Attached File Name]:
DEB = 6
MSGINERROR = E:\Logs\interfaces\POP3.err
OUTPUT = E:\Logs\interfaces\POP3.out
FIELD(1).NAME = "Tagname"
FIELD(1).TYPE = "String"
FIELD(2).NAME = "Value"
FIELD(2).TYPE = "String"
FIELD(3).NAME = "Timestamp"
FIELD(3).TYPE = "DateTime"
FIELD(3).FORMAT = "yyyy-MM-dd hh:mm:ss"
' Only one message type
MSG(1).NAME = "DataLine"
' Any line that contains the Tagname: pattern is considered a
' valid message
DataLine.Filter = C1=="*Tagname:* "
' Parse out three variables:
Tagname = ["*Tagname: (*),*"]
Timestamp = ["*Timestamp: (*),*"]
Value= ["*Value: (*),*"]
' Send the events to PI Archive

' Example
' Tagname: 00TEST-PIwebAPI.POST.TEXT.Value, Timestamp: 2019-06-27 17:00:00, Value: Testing POP3, END



Thanks for reading this, and any feedback is appreciated, as I don't know what the log is supposed to say when working correctly. But for DEB at 6 it's suspiciously quiet if it would still be doing anything.