Problems forwarding attachments with iso-8859-1 encoded filenames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

With my current setup, when I forward mails with attachments that have iso-8859-1 encoded names, the attachments aren't sent (only the email body).

While viewing the original message, the attachment names are shown correctly (norwegian letters are working), but after pressing "Forward" (which leads to compose.php), they are shown wrong (norwegian letters gets replaced with '�' (\xfffd). I guess somewhere in the code, it gets converted to utf-8. After pressing "Send", I can see that the attachments aren't sent.

I've found out exactly where squirrelmail decides to trash the attachments, it's in src/compose.php at line 370:

if (!empty($attachments)) {
     $attachments = unserialize($attachments); // line 370
     if (!empty($attachments) && is_array($attachments))
         $composeMessage->entities = $attachments;
}

$attachments comes from a hidden field in the previous step (composing of the forwarded email), which contains a hidden field with the serialized version of the attachments with the invalid names. A small test that changes the serialized output to make room for two extra bytes on the invalid filenames (i.e. changing s:36 to s:38 manually) makes squirrelmail _not_ ditch the attachments on line 370. I know this is probably irrelevant, since it seems to be incorrectly encoded to utf-8 before being serialized anyway.

Is this a problem with my setup, or squirrelmail's code?
The filename is clearly marked as being encoded in iso-8859-1 in the original email:

------=_NextPart_000_0010_01CB0C02.CA280780
Content-Type: application/pdf;
     name="=?iso-8859-1?Q?Skatteetaten_moms_p=E5_ishall-leie.pdf?="

.. which makes me think something isn't handled correctly by sqiurrelmail, but I got a headache trying to find that out myself, so I would love if someone more familiar with the code base could take a look :)

Some info:
>SquirrelMail version: 1.4.19 (NutsMail 3.3)
>PHP version: 5.2.6
>Apache: apache2-mpm-itk 2.2.6-02-1+lenny2+b2
>OS: Debian 5.0 lenny
>$squirrelmail_default_language = 'nb_NO'; (utf-8)


configtest.php:
>SquirrelMail configtest
>
>This script will try to check some aspects of your SquirrelMail configuration and point you to errors whereever it can find them. You need to go run conf.pl in the config/ directory first before you run this script.
>
>SquirrelMail version:   1.4.19
>Config file version:    1.4.15
>Config file last modified:  10 February 2010 07:16:19
>Checking PHP configuration...
>    PHP version 5.2.6-1+lenny4 OK.
>    display_errors: 1
>    error_reporting: 6135
>    variables_order OK: EGPCS.
>    PHP extensions OK. Dynamic loading is disabled.
>Checking paths...
>    Data dir OK.
>    Attachment dir OK.
>    Plugins OK.
>    Themes OK.
>    Default language OK.
>    Base URL detected as: https://mysite.no/src (location base autodetected)
>Checking outgoing mail service....
>    SMTP server OK (220 mysite.no ESMTP Postfix)
>Checking IMAP service....
>    IMAP server ready (* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.)
>    Capabilities: * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH QUOTA STARTTLS AUTH=PLAIN AUTH=LOGIN
>Checking internationalization (i18n) settings...
>     gettext - Gettext functions are available. On some systems you must have appropriate system locales compiled.
>     mbstring - Mbstring functions are available.
>     recode - Recode functions are unavailable.
>     iconv - Iconv functions are available.
>     timezone - Webmail users can change their time zone settings.
>Checking database functions...
>    not using database functionality.
>
>Congratulations, your SquirrelMail setup looks fine to me!

List of plugins:
>abook_group
>abook_take
>bookmarks
>bug_report
>calendar
>compatibility
>delete_move_next
>filters
>fortune
>html_mail
>listcommands
>login_auto
>mail_fetch
>message_details
>msg_flags
>newmail
>notes
>preview_pane
>sent_subfolders
>show_user_and_ip
>spamcop
>squirrelspell
>todo
>translate
>view_as_html
>calendar_sql_backend
>abook_group_pagination
>smallcal
>tbaddr

-- 
Helge Milde, 69701808
www.monsternett.no


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
-----
squirrelmail-users mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
List archives: http://news.gmane.org/gmane.mail.squirrelmail.user
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-users



[Index of Archives]     [Video For Linux]     [Yosemite News]     [Yosemite Photos]     [gtk]     [KDE]     [Cyrus SASL]     [Gimp on Windows]     [Steve's Art]     [Webcams]

  Powered by Linux