My messages post via Mailman doesn't appear in my Gmail Inbox

$Id$ (2019-06-14)

When you post a message via Mailman, and your dropbox is on Google Gmail, your own post doesn't appear in your Inbox; only remains in your "Sent Messages" box. You always had to add Cc:/Bcc: <yourself> when sending.

This is because Gmail coalesces messages having a same Message-ID, so it thinks the Mailman delivered message is duplicate of your Sent Messages, and discards the message arriving at Inbox. Mailman, by default, preserves Message-ID.

Patch

A solution is to attach different Message-ID by Mailman. This patch is already existing in Japanese version of Mailman version 2.1.14+j7.

The following setting will be available in mm_cfg.py:


# Gmail treats Message-ID as uniqness of messages and discard later messages.
# If we set this to Yes, then Gmail can show your original post and delivered
# message as separate ones.  It will then help you to know if the mail has
# been safely delivered.
USE_MAILMAN_MESSAGE_ID = No

Set USE_MAILMAN_MESSAGE_ID = Yes to deliver your own message to Inbox. Bonus: You will get a customized Subject:, just like the others are receiving.

The following patch just adds this USE_MAILMAN_MESSAGE_ID function to vanilla Mailman-2.1.15 (one provided for RHEL/CentOS 7).

References


kabe at sra-tohoku.co.jp

--- mailman/Mailman/Handlers/CookHeaders.py 2018-03-14 01:33:29.000000000 +0900 +++ mailman/Mailman/Handlers/CookHeaders.py 2012-09-30 04:56:14.000000000 +0900 @@ -90,6 +67,14 @@ fasttrack = msgdata.get('_fasttrack') if not msgdata.get('isdigest') and not fasttrack: try: + # put new message id for regular posting, because Gmail treats + # them as idential message and discard. + mid = msg.get('message-id', '') + if mm_cfg.USE_MAILMAN_MESSAGE_ID and mid: + msg['X-Mailman-Original-Message-ID'] = mid + del msg['message-id'] + msg['Message-ID'] = Utils.unique_message_id(mlist) + # and then, cook prefix. prefix_subject(mlist, msg, msgdata) except (UnicodeError, ValueError): # TK: Sometimes subject header is not MIME encoded for 8bit --- mailman/Mailman/Defaults.py 2018-03-14 01:33:29.000000000 +0900 +++ mailman/Mailman/Defaults.py 2012-09-30 04:56:13.000000000 +0900 @@ -531,6 +536,12 @@ # may wish to remove these headers by setting this to Yes. REMOVE_DKIM_HEADERS = No +# Gmail treats Message-ID as uniqness of messages and discard later messages. +# If we set this to Yes, then Gmail can show your original post and delivered +# message as separate ones. It will then help you to know if the mail has +# been safely delivered. +USE_MAILMAN_MESSAGE_ID = No + # All `normal' messages which are delivered to the entire list membership go # through this pipeline of handler modules. Lists themselves can override the # global pipeline by defining a `pipeline' attribute.