Closed moko-als closed 4 years ago
I can see why that commit would break reading from a pipe.
That said, GMime does have a GMimeStreamPipe which is what I specifically designed for this purpose. Unfortunately, it uses int
file descriptors rather than FILE*
pointers, so it's not a drop-in replacement for your purpose.
Is it possible for you to use GMimeStreamPipe? If so, we can close this. Otherwise we might want a gboolean option on GMimeStreamFIle that toggles it in/out of "PIPE" mode.
Thanks, we can use GMimeStreamPipe, so let's close this.
After this commit it is no longer possible to parse emails from stdin, as a seek on stdin returns error 29. Using stdin is necessary for use with .forward, where the syntax allows you to specify a program to pipe email to (|/receive_mail.sh). Am I right that the easiest workaround is to replace the read function? The code demonstrates the issue and workaround. Note that without patching ./test-parser empty2.msg works, while cat empty2.msg | ./test-parser does not work.