Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Will this work?
Message
From
31/05/2023 09:57:48
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01686685
Message ID:
01686695
Views:
34
>>>Hi there,
>>>
>>>one functionality of my application ist to receive emails and process them. Sometimes the provider sends these mails twice and I want to prevent that these are processed.
>>>I think about saving to values in a table, the first line of the mail and a checksum of the mail body calculates by sys(2007).
>>>Before processing the content I would look up these values in the table and if found, skip this mail.
>>>Does this make sense or are there better ways?
>>>
>>>Thanks in advance
>>>
>>>Thomas
>>
>>>>As long as you use CRC32, there is a good chance that it will work. At least the chance for a >>doublet is not very high. Possibly you should limit this comparison to a time window, so that a >>years old mail will not have the same checksum by accident. Some Hours?
>>
>>Unfortunately I have no usable value to because the mail, containing formatted data, there is only a data-value when the mail enters the users inbox.
>
>I>>f you check mail against mail, you need to notify the old CRC somehow. I guess you will not >>un through all mail each times. DBX guy would use a table. There you can put your own >>timestamp, and delete old entries after a while? Each day those older 24h or so.
>
>That's what I'm doing.

I'm confused, but if the mails are the same - as Al pointed out - it will work. CRC32 is not safe against doublets, but it should be rare enough.
If you are in doubt, you can always first run CRC for speed, and if this is equal, compare the strings too (assuming you have access, what might be a different problem. I would not store the mail to a table, because of the GDPR).
Or do a second CRC of a part of the mail, just like the header or something you can identify, and do a two step approach. To have two doublets is more rare.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform