diff --git a/Documentation/man5/remail.config.rst b/Documentation/man5/remail.config.rst index c08dc6b..43a3843 100644 --- a/Documentation/man5/remail.config.rst +++ b/Documentation/man5/remail.config.rst @@ -257,6 +257,7 @@ The list base configuration for each list consists of the following items: listname: enabled: True moderated: True + listid: ... archive: ... listaccount: @@ -286,6 +287,11 @@ The list base items: with a subscriber. Mails from non-subscribers are not delivered to the list, they are delivered to the list administrator + listid: + + Optional item to override the default list-id with a custom value. + Default: list address with the "@" replaced by a period. + The archive section: """""""""""""""""""" diff --git a/remail/config.py b/remail/config.py index a0bf7f8..d58b88c 100644 --- a/remail/config.py +++ b/remail/config.py @@ -120,10 +120,10 @@ def list_account_config(cfgdict, base): raise RemailListConfigException(txt) return laccs.pop() -def build_listheaders(mailaddr): +def build_listheaders(mailaddr, listid): addr, domain = mailaddr.split('@') headers = {} - headers['List-Id'] = mailaddr + headers['List-Id'] = '<%s>' % listid headers['List-Owner'] = '' % (addr, domain) headers['List-Post'] = '' % mailaddr return headers @@ -280,7 +280,8 @@ class list_config(object): self.listaccount = list_account_config(acc, base + '.listaccount') self.listaddrs = listaddrs(self.listaccount.addr) - self.listheaders = build_listheaders(self.listaccount.addr) + listid = cfgdict.get('listid', self.listaccount.addr.replace('@', '.')) + self.listheaders = build_listheaders(self.listaccount.addr, listid) self.smime = smime_config(self.listdir, None) self.gpg = gpg_config(self.listdir, None)