-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Thanks for this reference code. It was a great starting point for creating an small SMTP forwarding server.
One thing to note about the Celluloid Evented version is that it will create problems since it uses Celluloid's ducktyped Socket IO method "readpartial". The problem is that it reads in chunks, which are then parsed line-by-line using "each_line" At the end of each readpartial chunk, the each_line method assumes the end of the chunk is an end of line, even though it is in an arbitrary location with no regard to the location of LF characters. This results in newlines ending up in odd places, which can screw up parsing of the data.
This isn't really a problem with your code, since all it does is dump the data into an array, however if people add code to try to parse the data it will cause random breakage depending on length of the email.
You'll be happy to know Celluloid 0.13 was recently released, and adds in a lot (all?) of the missing methods from the standard Socket IO, including readline and gets, which fix the problem when used in place or readpartial.