Created
May 31, 2011 14:45
-
-
Save codyaray/1000619 to your computer and use it in GitHub Desktop.
The authentication section of Mailman's private.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Authorization confirmed... output the desired file | |
try: | |
ctype = content_type(path) | |
if mboxfile: | |
f = open(os.path.join(mlist.archive_dir() + '.mbox', | |
mlist.internal_name() + '.mbox')) | |
ctype = 'text/plain' | |
elif true_filename[-3:] == '.gz': | |
import gzip | |
f = gzip.open(true_filename, 'r') | |
else: | |
f = open(true_filename, 'r') | |
except IOError: | |
msg = _('Private archive file not found') | |
doc.SetTitle(msg) | |
doc.AddItem(Header(2, msg)) | |
print doc.Format() | |
syslog('error', 'Private archive file not found: %s', true_filename) | |
else: | |
print 'Content-type: %s\n' % ctype | |
sys.stdout.write(f.read()) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment