mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-30 23:00:09 -05:00
Switch to UUIDs for message-id generation. They're just as unique and lighter weight to calculate
This commit is contained in:
parent
95159d8121
commit
dc61614443
@ -11,6 +11,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.apache.james.mime4j.BodyDescriptor;
|
import org.apache.james.mime4j.BodyDescriptor;
|
||||||
import org.apache.james.mime4j.ContentHandler;
|
import org.apache.james.mime4j.ContentHandler;
|
||||||
@ -343,17 +344,7 @@ public class MimeMessage extends Message
|
|||||||
|
|
||||||
private String generateMessageId()
|
private String generateMessageId()
|
||||||
{
|
{
|
||||||
StringBuffer sb = new StringBuffer();
|
return "<"+UUID.randomUUID().toString()+"@email.android.com>";
|
||||||
sb.append("<");
|
|
||||||
for (int i = 0; i < 24; i++)
|
|
||||||
{
|
|
||||||
sb.append(Integer.toString((int)(Math.random() * 35), 36));
|
|
||||||
}
|
|
||||||
sb.append(".");
|
|
||||||
sb.append(Long.toString(System.currentTimeMillis()));
|
|
||||||
sb.append("@email.android.com>");
|
|
||||||
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessageId(String messageId)
|
public void setMessageId(String messageId)
|
||||||
|
Loading…
Reference in New Issue
Block a user