Hi, I found tools/hook-scripts/mailer/mailer.py can produce very long subject header line without folding. It can be easily over 1000 characters [1] if some large source tree is imported in a repository and truncate_subject config value is not specified appropriately. The mailer.py script send it without regard if server can accept over 1000 octets line [2], and don't have way of recovery when received response like "500 line too long" (of course, as this response code doesn't show the reason, it is no wonder).
I also found similar suggestion for commit-email.pl in users@ list archive [3], but on mailer.py we can avoid it by setting apropriate truncate_value, such as 200 (, which is shown as comment in mailer.conf.example). Is it succifient? (1) It is suffient because this is a code example and setting example, and not to use as is. (2) We should change the default value not to violate them. (3) We should change the default value and ignore if larger values is set. (4) We should implement line folding ... By the way, it seems another issue about truncate_subject that current implementation of truncate_subject may break utf-8 multi-bytes character sequence, but I didn't reproduce it(because I always use ascii characters only for file names...). [1] RFC 5322 Internet Message Format 2.1.1 Line Length Limits https://tools.ietf.org/html/rfc5322#section-2.1.1 [2] RFC 5321 Simple Maile Transfer Protocol 4.5.3.1 SizeLimits and Minimums - 4.5.3.1.6 Text Line https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 [3] usrs@ thread "commit-email.pl violates rfc2822" https://svn.haxx.se/users/archive-2011-04/0203.shtml Cheers, -- Yasuhito FUTATSUKI <futat...@poem.co.jp>