LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-19-2012, 03:41 AM   #1
larvel
LQ Newbie
 
Registered: Jun 2012
Posts: 29

Rep: Reputation: Disabled
Serving files with special characters. Apache/Mailscanner


We are serving the quarantined files of Mailscanner. Files are often sent with special characters, and mailscanner are messing them up.

An example is this filname: Resume_ R%E5dsm.doc
This file has both white space (which is ok) and %, which is not ok.

This is the presented url: (yes it has a whitespace, but the browser can handle that)
http://someserver/somedirectory/Referat_ R%E5dsm.doc

When I navigate to the url i get 404, and the url looks like this:
http://someserver/somedirectory/Referat_%20R%E5dsm.doc

If i manually substitute the last % with %25 it works fine.
http://someserver/somedirectory/Refe...0R%25E5dsm.doc

Any suggestions to both changes in mailscanner and apache is appreciated!
 
Old 07-19-2012, 11:39 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I'd be interested to know where you are (geographically) or your users at least.
When I mouse over the one that gets 404, then where it actually looks like the 'R%E5dsm', the %E5 becomes a lowercase 'a' with a small circle over the top ie a-circle https://en.wikipedia.org/wiki/Diacritic
See http://tlt.its.psu.edu/suggestions/i...ge/nordic.html for details ...
In other words, its a locale issue.

You need to decide how you want to handle this eg make whichever Scandinavian locale your locale in mailscanner/apache, or use a translation table/regex to reduce to std English 26 char alphabet.
To reduce, I would probably use Perl, which has a very powerful regex engine.

HTH
 
Old 07-20-2012, 12:53 AM   #3
larvel
LQ Newbie
 
Registered: Jun 2012
Posts: 29

Original Poster
Rep: Reputation: Disabled
The a with a ring is a scandinavian scpecial character, which is the reaseon this isn`t working.

http://www.utf8-chartable.de/
U+00C5 Å c3 85 LATIN CAPITAL LETTER A WITH RING ABOVE
U+00E5 å c3 a5 LATIN SMALL LETTER A WITH RING ABOVE

The users will be satisfied as long as the url are working, and they can download the attachement.

We have tried specifying utf8 and ISO-8859-1 in apache, as for how to change locale in mailscanner we have found no way to do this.
 
Old 07-21-2012, 08:27 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Yeah, I realised later I should have mentioned UTF-xxx etc also this may be useful http://linux.die.net/man/1/iconv.

You may or may not be able to change locale within the mailscanner prog cfg itself; try asking the people who wrote it.
You could try setting (& exporting) the locale setting eg http://tldp.org/LDP/lfs/LFS-BOOK-6.1...7/profile.html for the owning user's login.

To be honest I've never actually had to get into it at this level, so I'm probably going to leave it at that & hope a locale guru comes by.
Maybe you can edit (or ask Mods) the qn text to include the phrase 'locale issues/UTF'?

Good Luck
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
renaming files with spaces and special characters. bowens44 Linux - Newbie 8 06-29-2009 06:52 PM
Replacing lines in files that contain special characters arizonagroovejet Linux - General 3 06-22-2009 09:19 PM
Copying files with special characters cornish Linux - Newbie 13 12-21-2007 11:22 AM
Searching for files with special characters Yig Linux - Newbie 4 11-08-2007 05:53 PM
How to support special characters in the URI with Apache 2.0.52 in Slack fmordhorst Linux - General 3 05-26-2006 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration