diff --git a/msg.go b/msg.go index 5ef84eb..0e1aca3 100644 --- a/msg.go +++ b/msg.go @@ -360,9 +360,9 @@ func (m *Msg) SetMessageID() { ct := time.Now().UnixNano() r := rand.New(rand.NewSource(ct)) rn := r.Int63() - pid := os.Getpid() + pid := os.Getpid() * (r.Intn(10000) + 1) cts := fmt.Sprintf("%d", ct) - mid := fmt.Sprintf("%d.%d.%s@%s", pid, rn, cts[:15], hn) + mid := fmt.Sprintf("%d.%d.%s@%s", pid, rn, cts[:16], hn) m.SetMessageIDWithValue(mid) } diff --git a/msg_test.go b/msg_test.go index 2f27e39..dc55eca 100644 --- a/msg_test.go +++ b/msg_test.go @@ -710,7 +710,7 @@ func TestMsg_SetMessageIDRandomness(t *testing.T) { } for k, v := range c { if v > 1 { - t.Errorf("MessageID randomness not give. MessageID %q was generated %d times", k, v) + t.Errorf("MessageID randomness not given. MessageID %q was generated %d times", k, v) } } }