Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
553cb07
Fix "decoding str is not supported" errors
Jun 17, 2024
c9240a9
Replace raw_input with input
Jun 17, 2024
87f9622
Add .gitignore for files that got generated during ./configure and make.
Sep 10, 2024
85a31bf
Fix TypeError that trings must be encoded before hashing.
Sep 10, 2024
adc04db
Bump version number
Sep 10, 2024
8575009
Add workaround to removing `cmp` and remove python 2 imports.
Sep 10, 2024
172166f
Update gitignore
Sep 11, 2024
8a86623
Updated during build
Sep 11, 2024
22e88c0
Fix missing apostrophe
Sep 11, 2024
6124fd4
Fixes to string interpolation
Sep 11, 2024
53c24d8
Needed modifications for functionality
cpanel-jared Oct 4, 2024
72080ea
Downgrade autoconf
cPJason Oct 4, 2024
6e8dd6e
Update version to 2.2.0-alpha1
cPJason Oct 4, 2024
1dda22c
fix type detection
cPJason Oct 8, 2024
634277a
Fix format strings
cPJason Oct 8, 2024
bf3569b
fix mod tools
cpanel-jared Oct 8, 2024
c188b28
send archiving fixes
cPJason Oct 15, 2024
fe81945
fix list member login
cPJason Oct 15, 2024
434cf2e
fix password remind interface/email
cPJason Oct 15, 2024
83f3c3a
fix csrf checker, unquote moved
cPJason Oct 15, 2024
edd1c65
fix xfer webmail login
cPJason Oct 16, 2024
72df62f
fix csrf checks
cPJason Oct 16, 2024
9e16d81
fix some of the cron processes
cPJason Oct 17, 2024
cce0f55
fix roundtrip encoding
cPJason Oct 17, 2024
d76493a
fix other UnicodeType usages
cPJason Oct 17, 2024
1212fd6
keep the guard against byte strings
cPJason Oct 17, 2024
068dc70
fix !=
cPJason Oct 17, 2024
3fed0fb
execfile was removed
cPJason Oct 17, 2024
90233cd
HB-7996: Sleep 1s instead of 15m in RetryRunner to ensure TERM signal…
cpanelrikus Oct 17, 2024
143373c
Merge pull request #1 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman2…
cPJason Oct 17, 2024
75a7365
HB-7996: Allow RetryRunner to sleep 15m but still exit correctly
cpanelrikus Oct 18, 2024
3753686
fix cron/checkdbs
cPJason Oct 18, 2024
c38e037
Merge pull request #2 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman2…
cPJason Oct 18, 2024
1a2e8da
Allow non-ascii characters to be used in posts.
cpanel-jared Oct 18, 2024
c269ff0
Merge pull request #3 in ~JASON/mailman2 from HB-7992 to hb_main
cPJason Oct 18, 2024
91c0fcf
fix warning on alma9 and ubuntu
Oct 18, 2024
5703139
fix calling cgi-bins from cli
cPJason Oct 18, 2024
dd8fe84
fix cron/senddigests
cPJason Oct 21, 2024
54787e2
Merge pull request #4 in ~JASON/mailman2 from senddigests to hb_main
cPJason Oct 23, 2024
bec3a26
Updated locale files to UTF-8
cpanel-jared Oct 23, 2024
9ced894
Merge pull request #5 in ~JASON/mailman2 from HB-8027 to hb_main
cPJason Oct 23, 2024
e6c13cc
Revert "Updated locale files to UTF-8"
cpanel-jared Oct 24, 2024
5c53ea3
Convert templates and lc files to UTF-8 during build
cpanel-jared Oct 24, 2024
ab79365
Merge pull request #6 in ~JASON/mailman2 from HB-8027_2 to hb_main
cPJason Oct 24, 2024
43bda82
fix formatting
cPJason Oct 25, 2024
5bfacf6
Fix byte prefix when reading header values from emails
cpanel-jared Oct 25, 2024
6f759e2
Merge pull request #8 in ~JASON/mailman2 from HB-8030 to hb_main
cPJason Oct 25, 2024
0030dd3
archiver fixes
cPJason Oct 29, 2024
a121ad2
Merge pull request #9 in ~JASON/mailman2 from archiver_fixes_sq to hb…
cPJason Oct 29, 2024
abf01a0
fix upload
cPJason Oct 29, 2024
3545ef3
Merge pull request #10 in ~JASON/mailman2 from HB-8041 to hb_main
cpanel-jared Oct 29, 2024
07bf702
Fix empty attachment and raw byte emails.
cpanel-jared Oct 29, 2024
c8aedcd
Merge pull request #12 in ~JASON/mailman2 from HB-8042 to hb_main
cPJason Oct 29, 2024
6a34fed
fix exception invocations and upload box
cPJason Oct 29, 2024
87437d5
Merge pull request #11 in ~JASON/mailman2 from exception_fix to hb_main
cPJason Oct 29, 2024
2ee505d
Fix sending replies to users in certain contexts.
cpanel-jared Dec 2, 2024
bc8b4e3
Merge pull request #13 in ~JASON/mailman2 from HB-8044 to hb_main
Dec 2, 2024
a9a7b5b
Fixes a crash rejecting messages
cPJason Dec 4, 2024
e15d93f
Merge pull request #14 in ~JASON/mailman2 from HB-8081 to hb_main
cpanel-jared Dec 5, 2024
f8818a1
fix encoding issue printing temp file in archiver
Dec 11, 2024
2eaffb2
Fix attribute error in pending moderator requests page
Dec 11, 2024
af28d0e
Merge pull request #16 in ~JASON/mailman2 from ~DARREN/mailman2:HB-80…
cPanelBenjamin Dec 12, 2024
cab1fa0
Merge pull request #15 in ~JASON/mailman2 from fix_archiver_temp_prin…
cPanelBenjamin Dec 12, 2024
8342eb9
fix encoding issue printing temp file in archiver
Dec 11, 2024
91c4232
Merge branch 'fix_archiver_temp_print' into hb_main
Dec 12, 2024
b8ca4c1
Load pickles as latin1
cpanel-jared Dec 13, 2024
eee05ae
Merge pull request #17 in ~JASON/mailman2 from HB-8117 to hb_main
cPJason Dec 13, 2024
e847c88
Fix on-the-fly archiving.
cpanel-jared Dec 16, 2024
da806ed
Merge pull request #19 in ~JASON/mailman2 from HB-8103 to hb_main
cPJason Dec 16, 2024
7076aa1
Fix on-the-fly archving with non-ascii characters.
cpanel-jared Dec 16, 2024
9c0d013
Merge pull request #20 in ~JASON/mailman2 from HB-8103_2 to hb_main
cPJason Dec 16, 2024
a1487f3
Fix set help/show commands
Dec 16, 2024
21b181b
Merge pull request #21 in ~JASON/mailman2 from ~DARREN/mailman2:HB-80…
cPJason Dec 16, 2024
382fe2e
Fix on-the-fly archiving on python 3.9 and higher.
cpanel-jared Dec 17, 2024
9a364ac
Fix html archive format on nested replies.
cpanel-jared Dec 17, 2024
a275658
Merge pull request #22 in ~JASON/mailman2 from HB-8103_3 to hb_main
cPJason Dec 17, 2024
7a6d84e
Merge pull request #23 in ~JASON/mailman2 from HB-8111 to hb_main
cPJason Dec 17, 2024
e4e4d3f
Fix loading custom templates that are not utf-8
cpanel-jared Dec 18, 2024
86f21fb
Merge pull request #24 in ~JASON/mailman2 from HB-8092 to hb_main
cPJason Dec 18, 2024
4733566
HB-8110: Fix subscribe command (via email message)
cpanelrikus Dec 23, 2024
4cd9ad5
Merge pull request #25 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman…
Dec 23, 2024
0ad1885
HB-8101: Fix unsubscribe
cpanelrikus Dec 23, 2024
e0e5920
Merge pull request #26 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman…
cPJason Dec 23, 2024
6a9128b
Fix error resulting in user disclosure in some circumstances
Dec 23, 2024
0977b66
Merge pull request #27 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cPJason Dec 23, 2024
7062a1b
locale map info
Dec 26, 2024
a9f9a2f
dont execute this makefile in parallel now
Dec 26, 2024
27d66d3
Fix byte and string handling in auth handling for commands
Dec 26, 2024
a6bdcf2
Merge pull request #29 in ~JASON/mailman2 from debug_locales to hb_main
cpanelrikus Dec 26, 2024
081a505
Make sure the payload is a string
Dec 26, 2024
b123323
Merge pull request #30 in ~JASON/mailman2 from fix_plaintext_digest t…
cPanelBenjamin Dec 26, 2024
33906a8
Merge pull request #28 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cPJason Dec 26, 2024
45e6eba
UTF-8 is the way
Dec 27, 2024
4ae5338
Merge pull request #31 in ~JASON/mailman2 from fix_digests to hb_main
cPanelBenjamin Dec 27, 2024
4c3e481
Fix various issues related to content filtering
Dec 27, 2024
a0fe619
Merge pull request #32 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cPJason Dec 27, 2024
641eeef
email.Iterators is now email.iterators.
cpanelrikus Dec 30, 2024
8588e2d
Fix catch expression
Dec 31, 2024
76bb185
Merge pull request #33 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman…
cPJason Dec 31, 2024
5c7221e
Merge pull request #34 in ~JASON/mailman2 from restore_fix_archive_cr…
cPJason Dec 31, 2024
ca7add4
Hotfix for digests not showing text of messages
Dec 31, 2024
0f14796
Merge pull request #35 in ~JASON/mailman2 from ~DARREN/mailman2:inden…
cPJason Dec 31, 2024
e9a9fb6
Ensure cron scripts are working
Dec 31, 2024
2d5ae75
Merge pull request #36 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cpanelrikus Dec 31, 2024
47ec941
HB-8147: Fix oversize message detection for messages with attachments.
cpanelrikus Jan 2, 2025
471fda2
Merge pull request #37 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman…
cpanel-jared Jan 2, 2025
9aaf1e3
Fix all scripts in mailman/bin
Jan 2, 2025
a4acd09
Fix attachments saved to public and private archives.
cpanel-jared Jan 2, 2025
4e41b11
Merge pull request #39 in ~JASON/mailman2 from HB-8149 to hb_main
cPJason Jan 2, 2025
da065d8
Merge pull request #38 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cPJason Jan 2, 2025
cc2c91d
Fix headers sent through private.py
cpanel-jared Jan 3, 2025
8f595a9
Fix dict/list conflict in bin/clone_member
Jan 3, 2025
3459bf1
Fix encoding from safe()
Jan 3, 2025
91451ed
HB-8151: Fix change_pw
cpanelrikus Jan 3, 2025
6eb4de8
Merge pull request #42 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cpanelrikus Jan 3, 2025
ad49f80
HB-8155: Fix msgfmt.py usage output
cpanelrikus Jan 3, 2025
3a3bc75
remove whitespace
Jan 3, 2025
38ea23c
Merge pull request #45 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cPJason Jan 3, 2025
97800a4
Merge pull request #41 in ~JASON/mailman2 from ~DARREN/mailman2:HB-81…
cpanelrikus Jan 3, 2025
40c8b63
Merge pull request #40 in ~JASON/mailman2 from HB-8150 to hb_main
cpanelrikus Jan 3, 2025
309ac30
Merge pull request #44 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman…
Jan 3, 2025
7dd8d33
Fix for export.py
Jan 3, 2025
ac017e7
Merge branch 'hb_main' into fix_export
Jan 3, 2025
20ba7d2
Merge pull request #43 in ~JASON/mailman2 from ~RIKUS.GOODELL/mailman…
cPJason Jan 3, 2025
a6c348c
Remove suffix from version string
cPanelBenjamin Jan 9, 2025
f6d0664
Fix membership list links when using pagination.
cpanel-jared Jan 9, 2025
7c36e6f
Silence the warnings on restart
cPJason Jan 14, 2025
8b0349f
Merge pull request #2 from cpanel/HB-8107
cPJason Jan 22, 2025
7faa7b0
Merge pull request #3 from cpanel/HB-8126
cpanel-jared Jan 22, 2025
746d82d
Fix DMARC record handling.
Feb 6, 2025
be55072
Fix readline from suffixes file.
Feb 10, 2025
d93c60f
Merge pull request #4 from cpanel/fixes_from_HB
cpanelrikus Feb 18, 2025
fd2713a
Fix problems from old archives.
Feb 19, 2025
b704fc7
Upgrade unpickled Message object for Python 3 compatibility.
Feb 21, 2025
ef65bb0
Merge pull request #6 from cpanel/HB-8200
cpanel-jared Feb 25, 2025
0136772
Merge pull request #5 from cpanel/HB-8201
cpanelrikus Mar 3, 2025
bfab3a2
Fix Compuserve bounce module imports.
Feb 27, 2025
9476bc3
Fix rare dmarc dns query failure.
Feb 27, 2025
443c9a1
Fixed GroupWise Bouncer
Mar 4, 2025
d08a82b
Merge pull request #7 from cpanel/HB-8199_HB-8189
cpanel-jared Mar 10, 2025
441fd9e
Move module import out of config file.
Mar 18, 2025
93987bd
Merge pull request #8 from cpanel/HB-8228
cpanel-jared Mar 26, 2025
ec25c17
Fix UnicodeDecodeError error when sending digests
Mar 27, 2025
184d354
Fix messages with a rfc822 attachment.
Mar 27, 2025
ad3cb4b
Fix string encoding problem in admin notification email.
Mar 28, 2025
990daeb
Merge pull request #11 from cpanel/CPANEL-46551
cpanel-jared Mar 31, 2025
8951048
Merge pull request #10 from cpanel/hb_integration
cpanel-jared Apr 17, 2025
a9bbd1b
Update various parts of mailman to handle older pickle files
Apr 8, 2025
f73f1e2
Updates from peer review
Apr 9, 2025
c716576
Hotfix for patch-breaking newline
Apr 9, 2025
e9ea841
Make sure IDs are integers for sort
cPJason Apr 17, 2025
8aadb6e
Updates from testing and extended review
Apr 18, 2025
e9fdca9
Merge pull request #12 from cpanel/CPANEL-46543_2
cpanelrikus Apr 24, 2025
d36f890
Fix issues with NNTP bridge with Mailman
Apr 24, 2025
c6e45cd
Merge pull request #13 from cpanel/CPANEL-46609
cpanelrikus Apr 28, 2025
7cd4303
Fix double str conversion on empty subject
cPJason Apr 28, 2025
8690585
Merge pull request #14 from cpanel/CPANEL-46537
cpanelrikus Apr 28, 2025
8e318cf
Better handle encoding for message decoration
cPJason Apr 30, 2025
7329679
Properly encode the subscribe form secret for hashing
cPJason Apr 30, 2025
7e4b176
Merge pull request #15 from cpanel/CPANEL-46545
cpanelrikus May 9, 2025
91ebd6f
Merge pull request #16 from cpanel/CPANEL-46945
cpanelrikus May 12, 2025
d4c3e3f
Filter out email headers that are not strings.
May 7, 2025
d09813b
Merge pull request #17 from cpanel/CPANEL-47096
cpanelrikus May 15, 2025
8747afa
Fix bug calling Utils.load_pickle preventing list signups
May 13, 2025
58f8a45
Merge pull request #18 from cpanel/CPANEL-47240
cpanelrikus May 16, 2025
8be0550
Fix the usage of '%d' in the 'subject_prefix' option.
May 28, 2025
b41dc3c
Fall back to utf-8 if we encounter unsupported encodings during archive.
May 29, 2025
31575d5
Merge pull request #19 from cpanel/CPANEL-47080
cpanelrikus May 29, 2025
465e756
Merge pull request #20 from cpanel/CPANEL-47266
cpanelrikus Jun 2, 2025
e3ee85b
Additional encoding fix for use with formataddr() in subscription app…
May 29, 2025
38b406e
Merge pull request #21 from cpanel/CPANEL-47086
cpanel-jared Jul 29, 2025
8702a48
sync in cpanel fixes as of 38b406e7b3b3ed1106d83c82479636a79bc5a9f5
jaredmauch Jul 29, 2025
83c8543
Merge branch 'main' of github.com:jaredmauch/mailman2-python3
jaredmauch Jul 30, 2025
8df31c3
- implement cgi replacement for python 3.13 and later
jaredmauch Jul 30, 2025
4fa0384
python3 fixes
jaredmauch Aug 1, 2025
812b0cc
python3
jaredmauch Aug 1, 2025
23def7a
nntplib
jaredmauch Aug 1, 2025
750069b
python3
jaredmauch Aug 1, 2025
b982ccc
add logging to trace problem
jaredmauch Aug 1, 2025
80fdeed
tls fix
jaredmauch Aug 1, 2025
107fe28
round robin
jaredmauch Aug 1, 2025
e572022
archiver
jaredmauch Aug 1, 2025
6c6d41c
archiver
jaredmauch Aug 1, 2025
a2b8af0
archiver
jaredmauch Aug 2, 2025
a6bc036
archiver
jaredmauch Aug 2, 2025
c131f8c
archiver
jaredmauch Aug 2, 2025
aac2f5b
archiver
jaredmauch Aug 2, 2025
4b6de5f
archiver
jaredmauch Aug 2, 2025
549cc3b
logging
jaredmauch Aug 2, 2025
5ef2750
debug archiver
jaredmauch Aug 2, 2025
6973f9a
debug archiver
jaredmauch Aug 2, 2025
7a8ec11
debug archiver
jaredmauch Aug 2, 2025
19b6e5b
debug archiver
jaredmauch Aug 2, 2025
8b5730e
mm_cfg circular import issue
jaredmauch Aug 2, 2025
d0d983e
mm_cfg circular import issue
jaredmauch Aug 2, 2025
1a0530c
mm_cfg possible breaking change test
jaredmauch Aug 2, 2025
e59c277
fixup default issues
jaredmauch Aug 2, 2025
a64d318
improve mm_cfg handler
jaredmauch Aug 2, 2025
ea3bb96
cleanup
jaredmauch Aug 2, 2025
98623d5
Fix to cgidata[property]
AntonMcClure Oct 21, 2025
d45e4d2
Various message/template changes that happened with make
AntonMcClure Oct 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 56 additions & 36 deletions Mailman/Archiver/Archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import errno
import traceback
import re
from io import StringIO
import tempfile

from Mailman import mm_cfg
from Mailman import Mailbox
Expand Down Expand Up @@ -88,17 +88,21 @@ def InitVars(self):
# symbolic links.
omask = os.umask(0)
try:
# Create mbox directory with proper permissions
mbox_dir = self.archive_dir() + '.mbox'
os.makedirs(mbox_dir, mode=0o02775, exist_ok=True)

# Create archive directory with proper permissions
archive_dir = self.archive_dir()
os.makedirs(archive_dir, mode=0o02775, exist_ok=True)

try:
os.mkdir(self.archive_dir()+'.mbox', 0o02775)
except OSError as e:
if e.errno != errno.EEXIST: raise
# We also create an empty pipermail archive directory into
# which we'll drop an empty index.html file into. This is so
# that lists that have not yet received a posting have
# /something/ as their index.html, and don't just get a 404.
try:
os.mkdir(self.archive_dir(), 0o02775)
except OSError as e:
if e.errno != errno.EEXIST: raise
# See if there's an index.html file there already and if not,
# write in the empty archive notice.
indexfile = os.path.join(archive_dir, 'index.html')
indexfile = os.path.join(self.archive_dir(), 'index.html')
fp = None
try:
fp = open(indexfile)
Expand Down Expand Up @@ -132,7 +136,8 @@ def GetBaseArchiveURL(self):
if self.archive_private:
return url
else:
hostname = re.match(r'[^:]*://([^/]*)/.*', url, re.IGNORECASE).group(1)
hostname = re.match('[^:]*://([^/]*)/.*', url).group(1)\
or mm_cfg.DEFAULT_URL_HOST
url = mm_cfg.PUBLIC_ARCHIVE_URL % {
'listname': self.internal_name(),
'hostname': hostname
Expand All @@ -145,7 +150,7 @@ def __archive_file(self, afn):
"""Open (creating, if necessary) the named archive file."""
omask = os.umask(0o002)
try:
return Mailbox.Mailbox(open(afn, 'a+'))
return Mailbox.Mailbox(open(afn, 'a+b'))
finally:
os.umask(omask)

Expand All @@ -157,9 +162,11 @@ def __archive_to_mbox(self, post):
"""Retain a text copy of the message in an mbox file."""
try:
afn = self.ArchiveFileName()
syslog('debug', 'Archiver: Writing to mbox file: %s', afn)
mbox = self.__archive_file(afn)
mbox.AppendMessage(post)
mbox.fp.close()
mbox.close()
syslog('debug', 'Archiver: Successfully wrote message to mbox file: %s', afn)
except IOError as msg:
syslog('error', 'Archive file access failure:\n\t%s %s', afn, msg)
raise
Expand All @@ -169,55 +176,68 @@ def ExternalArchive(self, ar, txt):
'hostname': self.host_name,
})
cmd = ar % d
try:
with os.popen(cmd, 'w') as extarch:
extarch.write(txt)
except OSError as e:
syslog('error', 'Failed to execute external archiver: %s\nError: %s',
cmd, str(e))
return
extarch = os.popen(cmd, 'w')
extarch.write(txt)
status = extarch.close()
if status:
syslog('error', 'External archiver non-zero exit status: %d\nCommand: %s',
(status & 0xff00) >> 8, cmd)
syslog('error', 'external archiver non-zero exit status: %d\n',
(status & 0xff00) >> 8)

#
# archiving in real time this is called from list.post(msg)
#
def ArchiveMail(self, msg):
"""Store postings in mbox and/or pipermail archive, depending."""
from Mailman.Logging.Syslog import syslog
syslog('debug', 'Archiver: Starting ArchiveMail for list %s', self.internal_name())

# Fork so archival errors won't disrupt normal list delivery
if mm_cfg.ARCHIVE_TO_MBOX == -1:
syslog('debug', 'Archiver: ARCHIVE_TO_MBOX is -1, archiving disabled')
return

syslog('debug', 'Archiver: ARCHIVE_TO_MBOX = %s', mm_cfg.ARCHIVE_TO_MBOX)
#
# We don't need an extra archiver lock here because we know the list
# itself must be locked.
if mm_cfg.ARCHIVE_TO_MBOX in (1, 2):
try:
mbox = self.__archive_file(self.ArchiveFileName())
mbox.AppendMessage(msg)
mbox.fp.close()
except IOError as msg:
syslog('error', 'Archive file access failure:\n\t%s %s',
self.ArchiveFileName(), msg)
raise
syslog('debug', 'Archiver: Writing to mbox archive')
self.__archive_to_mbox(msg)
if mm_cfg.ARCHIVE_TO_MBOX == 1:
# Archive to mbox only.
syslog('debug', 'Archiver: ARCHIVE_TO_MBOX = 1, mbox only, returning')
return
txt = str(msg)

txt = msg.as_string()
unixfrom = msg.get_unixfrom()
# Handle case where unixfrom is None (Python 3 compatibility)
if unixfrom and not txt.startswith(unixfrom):
txt = unixfrom + '\n' + txt

# should we use the internal or external archiver?
private_p = self.archive_private
syslog('debug', 'Archiver: archive_private = %s', private_p)

if mm_cfg.PUBLIC_EXTERNAL_ARCHIVER and not private_p:
syslog('debug', 'Archiver: Using public external archiver')
self.ExternalArchive(mm_cfg.PUBLIC_EXTERNAL_ARCHIVER, txt)
elif mm_cfg.PRIVATE_EXTERNAL_ARCHIVER and private_p:
syslog('debug', 'Archiver: Using private external archiver')
self.ExternalArchive(mm_cfg.PRIVATE_EXTERNAL_ARCHIVER, txt)
else:
# use the internal archiver
with StringIO(txt) as f:
from . import HyperArch
h = HyperArch.HyperArchive(self)
h.processUnixMailbox(f)
h.close()
syslog('debug', 'Archiver: Using internal HyperArch archiver')
f = tempfile.NamedTemporaryFile()
if isinstance(txt, str):
txt = txt.encode('utf-8')
f.write(txt)
f.flush()
from . import HyperArch
h = HyperArch.HyperArchive(self)
h.processUnixMailbox(f)
h.close()
f.close()
syslog('debug', 'Archiver: Completed internal archiving')

#
# called from MailList.MailList.Save()
Expand Down
Loading