static void EncodeDkimHeaderList (FormatOptions format, StringBuilder encoded, ref int lineLength, string value, char delim)
{
var tokens = value.Split (delim);
for (int i = 0; i < tokens.Length; i++) {
if (i > 0) {
encoded.Append (delim);
lineLength++;
}
if (lineLength + tokens[i].Length + 1 > format.MaxLineLength) {
encoded.Append (format.NewLine);
encoded.Append ('\t');
lineLength = 1;
if (tokens[i].Length + 1 > format.MaxLineLength) {
EncodeDkimLongValue (format, encoded, ref lineLength, tokens[i]);
} else {
lineLength += tokens[i].Length;
encoded.Append (tokens[i]);
}
} else {
lineLength += tokens[i].Length;
encoded.Append (tokens[i]);
}
}
}