"Jason R. Mastaler" <[EMAIL PROTECTED]> writes:

> Tim Legant <[EMAIL PROTECTED]> writes:
>
>> Therefore, the email address can be a maximum of 255 - 22 or 233
>> characters.  Then, to preserve as much as possible, make the local
>> and host parts relative lengths:
>
> I think it's more straightforward to just chop off the tail if it
> exeeds 233 chars,

Yeah, I was thinking about preserving the domain for later
blacklisting either through TMDA or at the MTA.  But you can derive
that from a couple of other places (mail log, TMDA incoming log), so
this is simplest and therefore best.

> so this is the patch I propose:
>
> Index: Util.py
> ===================================================================
> RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
> retrieving revision 1.110.2.1
> diff -u -r1.110.2.1 Util.py
> --- Util.py   9 Jan 2004 19:21:50 -0000       1.110.2.1
> +++ Util.py   25 Jan 2004 17:31:11 -0000
> @@ -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):

Looks right to me!


Tim

_________________________________________________
tmda-workers mailing list ([EMAIL PROTECTED])
http://tmda.net/lists/listinfo/tmda-workers

Reply via email to