On Sun, Oct 3, 2010 at 1:10 PM, Arno Garrels <arno.garr...@gmx.de> wrote:
> Angus Robertson - Magenta Systems Ltd wrote: > > Has anyone built a component to queue email until an SMTP relay > > server is available? > > Not yet, but it's probably no big deal to write one. > It could be a simple two files per item approach. > One email file written to the queue directory with method > SendToFile so it can be resent as is with OwnHeaders and > TIcsStreamReader or from a TStringList later on, and one > info file containing related properties including MxIPs, > Port.. as well as a next retry value, last error etc.. > Both files would share the same filename with different > extensions. > > -- > Arno Garrels > > We use a similar approach in our disk cache--two same named files with different extensions. One of the files is the binary data file and other one is a TMemIniFile. If you are dealing with URLs and want to convert URL to a file name, don't bother with all the 8 Windows' non-file name characters--just SHA1-hash the url to consturct the file name. We also tried an ini file for writing the name of the files (index) to disk but this turned out to be a real pain/slow after a few thousand files since it scans all the previous records for the same name in name=value format of inis as it does not assume there are no duplicate names. So I wrote my own very simple format such as: [DiskCacheObjects] DiskCacheLastSize=5002345 ObjectsCount=3 ObjectURI-0=<CProxy:Default>http://www.iqproxyserver.com ObjectURI-1=<CProxy:Default>http://www.fastream.com/IQProxyServer.exe ObjectURI-2=<CProxy:Default>http://www.intel.com So it's gotten quite mature now. Just FYI. Best Regards, SZ www.iqproxyserver.com -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be