summaryrefslogtreecommitdiff
path: root/Mailman/aliases.py
diff options
context:
space:
mode:
authorbwarsaw2002-03-16 06:58:32 +0000
committerbwarsaw2002-03-16 06:58:32 +0000
commit8747f471e2421c46800f1e0dd23e0a2c01ca2aa4 (patch)
tree8e563d3f2512ce86a03daf3f5bf522320887f2ef /Mailman/aliases.py
parent01c676cad87625f667c3cc5b0c3fcbf19e15a518 (diff)
downloadmailman-8747f471e2421c46800f1e0dd23e0a2c01ca2aa4.tar.gz
mailman-8747f471e2421c46800f1e0dd23e0a2c01ca2aa4.tar.zst
mailman-8747f471e2421c46800f1e0dd23e0a2c01ca2aa4.zip
Remove obsolete files.
Diffstat (limited to 'Mailman/aliases.py')
-rw-r--r--Mailman/aliases.py58
1 files changed, 0 insertions, 58 deletions
diff --git a/Mailman/aliases.py b/Mailman/aliases.py
deleted file mode 100644
index a89dad812..000000000
--- a/Mailman/aliases.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (C) 1998,1999,2000 by the Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-# This is mailman's interface to the alias database.
-
-# TODO:
-# - fix this file! /etc/alias hacking no longer works
-
-# Write a wrapper program w/ root uid that allows the mailman user
-# only to update the alias database.
-
-import string
-_file = open('/etc/aliases', 'r')
-_lines = _file.readlines()
-aliases = {}
-_cur_line = None
-
-def _AddAlias(line):
- line = string.strip(line)
- if not line:
- return
- colon_index = string.find(line, ":")
- if colon_index < 1:
- raise "SyntaxError", "Malformed /etc/aliases file"
- alias = string.lower(string.strip(line[:colon_index]))
- rest = string.split(line[colon_index+1:], ",")
- rest = map(string.strip, rest)
- aliases[alias] = rest
-
-for _line in _lines:
- if _line[0] == '#':
- continue
- if _line[0] == ' ' or _line[0] == '\t':
- _cur_line = _cur_line + _line
- continue
- if _cur_line:
- _AddAlias(_cur_line)
- _cur_line = _line
-
-def GetAlias(str):
- str = string.lower(str)
- if not aliases.has_key(str):
- raise KeyError, "No such alias"
- return aliases[str]
-