You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ji...@apache.org on 2004/04/01 23:45:44 UTC

[jira] Updated: (JAMES-160) AttachmentFileNameIs can't handle national characters in filename

The following issue has been updated:

    Updater: Noel J. Bergman (mailto:noel@devtech.com)
       Date: Thu, 1 Apr 2004 1:45 PM
    Comment:
assigned to component
    Changes:
             Component changed to Matchers/Mailets (bundled)
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/JAMES-160?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAMES-160

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAMES-160
    Summary: AttachmentFileNameIs can't handle national characters in filename
       Type: Bug

     Status: Unassigned
   Priority: Minor

    Project: James
 Components: 
             Matchers/Mailets (bundled)
   Versions:
             2.2.0a17

   Assignee: 
   Reporter: Christian Andersson

    Created: Tue, 16 Mar 2004 3:59 AM
    Updated: Thu, 1 Apr 2004 1:45 PM
Environment: James running on Suse Linux 8
JDK version 1.4.2_02-b03


Description:
AttachmentFileNameIs is not matching on files with national characters in it.

I have added this configuration in the james configuration (Thanks to Noel for showing this)

<mailet match="AttachmentFileNameIs=*.bat,*.com,*.dll,*.exe,*.lnk,*.pif,*.scr,*.vbe,*.vbs,*.wsh"
          onMatchException="noMatch"
          class="Bounce">
    <notice>550 Rejected - Banned type of attachment.  Please contact
intended recipient.</notice>
    <attachment>none</attachment>
    <passThrough>false</passThrough>
  </mailet> 

The problem is that it does not Match on files with national characters in them, the reson for this is that if there are national characters in the filename, the filename gets encoded and the matcher therefore gets in trouble since it matches against the encoded filename and not an unencoded filename.

Example:
I sent a file called 'øyenblikksfoto1.exe' with mozilla to myself (using an other mail-account)
this message came through even though it should have been stopped by the matcher.  Here is what the e-mail code for this attachement looked like.

Content-Type: application/octet-stream;
 name="=?ISO-8859-1?Q?=F8yeblikksfoto1=2Eexe?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="=?ISO-8859-1?Q?=F8yeblikksfoto1=2Eexe?="

and since the matcher matches for *.exe this file gets through, since there is NO *.exe in that filename  (mozzilla parsed this filename correctly)

I then had a friend send me an "exe" file through hotmail (I don't have that myself) the file was called "nånting.exe"  and here is what came to me in the mime-encapsulating...

Content-Type: application/octet-stream;
    name="=?iso-8859-1?B?buVudGluZy5leGU= ?="
Content-Disposition: attachment; filename="=?iso-8859-1?B?buVudGluZy5leGU= ?="
Content-Transfer-Encoding: base64

This file also got through to me, but this time not even mozilla could parse that filename...




---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org