Skip to content

Commit 7a7b8e7

Browse files
authored
Use actual prefix length
1 parent 382590a commit 7a7b8e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/mail/fields/unstructured_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def fold(prepend = 0) # :nodoc:
112112
encoding = normalized_encoding
113113
encoding_overhead = "=?#{encoding}?Q??=".length
114114
# The encoded string goes here ^ (between the ??)
115-
max_safe_word = 78 - encoding_overhead - 10 # allow for encoding overhead + prefix
115+
max_safe_word = 78 - encoding_overhead - prepend # allow for encoding overhead + prefix
116116
decoded_string = decoded.to_s
117117
words = decoded_string.split(/[ \t]/)
118118
should_encode = !decoded_string.ascii_only? || words.any? {|word| word.length > max_safe_word}

0 commit comments

Comments
 (0)