Symptom: using nnimap with gssapi authentication (with external imtest program), unable to upload messages. Problem: the APPEND command needs to know the exact size of the message to be uplaoded, which should be calculated using two-byte line terminator size. Unlike other transports, imtest requires "\n" as line the terminator instead of "\r\n". Gnus calculates the size after changing the line terminator to "\n", causing wrong result. Solution: in imap-gssapi-open, set imap-calculate-literal-size-first to the correct value, besides imap-client-eol, as seen in imap-kerberos4-open. Other possible occurrence: imap-shell-open also sets imap-client-eol but not imap-calculate-literal-size-first. As I'm unable to test this, not included in the patch. Patch: