2009-07-28 22:51:29 UTC
So I poked around some more in the SMTPDKIMMessage class and figured out how to change the order of the headers by adding this code:
String[] DKIMHeader = getHeader("DKIM-Signature");
for (int i = 0; i < DKIMHeader.length; i++) {
DKIMHeader[i] = "DKIM-Signature: " + DKIMHeader[i];
los.writeln(DKIMHeader[i]);
}
while (hdrLines.hasMoreElements()) {
String hdrString = (String) hdrLines.nextElement();
if (!hdrString.startsWith("DKIM-Signature"))
los.writeln(hdrString);
}
and I tested it out and sure enough, after changing the order to put the DKIM-Signature block on top, Yahoo passed the message. I know this code is pretty rough, but do you think that a nicer version of this could be implemented? Or at least implemented with an option?
Thanks!