CVS: tmda/TMDA Util.py,1.112,1.113

"Jason R. Mastaler" <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23128/TMDA

Modified Files:
	Util.py 
Log Message:
bugfix from release-1-0 branch

Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- Util.py	9 Jan 2004 19:23:15 -0000	1.112
+++ Util.py	25 Jan 2004 18:30:11 -0000	1.113
@@ -48,6 +48,7 @@
 MODE_READ = 04
 MODE_WRITE = 02
 NL = '\n'
+POSIX_NAME_MAX = 255                    # maximum length of a file name
 
 
 def gethostname():
@@ -449,10 +450,14 @@
       outside the directory.
     - Spaces are replaced with underscores.
     - The address is lowercased.
+    - Truncate sender at 233 chars to insure the full filename
+    (including time, pid, and two dots) fits within the POSIX limit of
+    255 chars for a filename.
     """
     sender = sender.replace(' ', '_')
     sender = sender.replace('/', ':')
-    return sender.lower()
+    sender = sender.lower()
+    return sender[:POSIX_NAME_MAX - 22]
 
 
 def confirm_append_address(xp, rp):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.