Re: email header in message body

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

 



I did quite some testing and come up with some interesting results, shown further down.


On Thu, 26 Jan 2023 23:54:54 -0000, "Paul Lesniewski" <paul@xxxxxxxxxxxxxxxx> wrote:
>
>
>
>On Thu, January 26, 2023 7:37 pm, rtc--- via squirrelmail-users wrote:
>> Hello All,
>> I am new here on the list but not new to SM. Using SM 1.4.4 with php5.4
> on
>> Win
>> with Apache is working just fine.  Thought is time for a new install, d
>id
>> that
>> and ran into one major problem. Working and looking into it for a few
>> days,
>> but can't solve the problem. Config test shows my current install and
>> results.
>> Webserver is Sambar with php running as/under cgi.IMAP server is Sambar
>..
>
>There's a good chance the problem is to do with this IMAP server, for
>which SquirrelMail has no default settings given it is shareware that
>stopped development 15 years(!) ago.

I have no shareware version running, it is the full fletched Sambar All-in-One Pro version.
The shareware runs only the webserver. I have this running since 2005. And yes, there is no development. But it's still a good product.

>There's every reason in the world
>that you should run something more up to date.  You could enable the
>"info" plugin and inspect how the server responds to some standard
>commands.

I did install SM 1.4.23 and installed the "info" plugin.
Here is the output. Just shortened the list of emails to 2.

Server Capability response:
* CAPABILITY IMAP4 IMAP4rev1 QUOTA IDLE X-MOVE X-EXPN AUTH=CRAM-MD5 STARTTLS
folder_prefix =
default_charset = ISO-8859-1

TEST_0
Request:
A003 SELECT INBOX
Response:
* 93 EXISTS
* 0 RECENT
* OK [UNSEEN 48] Message 2 is first unseen
* OK [UIDVALIDITY 1449535965] UIDs valid
* OK [UIDNEXT 1449536359]
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen \Recent)
[READ-WRITE] SELECT completed

TEST_1
Request:
A004 STATUS INBOX (MESSAGES RECENT)
Response:
* STATUS INBOX (MESSAGES 93 RECENT 0)
STATUS completed

TEST_2
Request:
A005 EXAMINE INBOX
Response:
* 93 EXISTS
* 0 RECENT
* OK [UNSEEN 48] Message 2 is first unseen
* OK [UIDVALIDITY 1449535965] UIDs valid
* OK [UIDNEXT 1449536359]
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen \Recent)
[READ-ONLY] EXAMINE completed

TEST_3
Request:
A006 SEARCH CHARSET "ISO-8859-1" ALL *
Response:
Invalid search criteria.

TEST_4
Request:
A007 THREAD REFERENCES ISO-8859-1 ALL
Response:
command: 'THREAD'

TEST_5
Request:
A008 SORT (DATE) ISO-8859-1 ALL
Response:
------ does not support SORT

TEST_6
Request:
A009 FETCH 1:* (FLAGS BODY[HEADER.FIELDS (FROM DATE TO)])
Response:
* 1 FETCH (FLAGS (\Seen) BODY[HEADER.FIELDS (FROM DATE TO)] {121}
From: "Johannes Prost" <xxxxx@xxxxxxxx>
To: rtc@xxxxxxxxxxxxxxxxx
Date: Fri, 22 Feb 2019 11:44:47 -0600

)
* 2 FETCH (FLAGS (\Seen) BODY[HEADER.FIELDS (FROM DATE TO)] {176}
Date: Thu, 26 Jan 2023 23:54:54 -0000
From: "Paul Lesniewski" <xxxxx@xxxxxxxxxxx>
To: "Squirrelmail User Support Mailing List" <squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx>


)
FETCH completed

TEST_7
Request:
A010 LSUB "" "*%"
Response:
* LSUB (\Unmarked) "/" "Drafts"
* LSUB (\Unmarked) "/" "facebook"
* LSUB (\Unmarked) "/" "INBOX"
* LSUB (\Unmarked) "/" "others"
* LSUB (\Unmarked) "/" "parts"
* LSUB (\Unmarked) "/" "sent"
* LSUB (\Unmarked) "/" "spam"
* LSUB (\Unmarked) "/" "sprinter"
* LSUB (\Unmarked) "/" "sprinterforum"
* LSUB (\Unmarked) "/" "squirrel"
* LSUB (\Unmarked) "/" "trash"
* LSUB (\Unmarked) "/" "videos"
LSUB completed

TEST_8
Request:
A011 LIST "*" "*"
Response:
* LIST (\Unmarked) "/" "Drafts"
* LIST (\Unmarked) "/" "facebook"
* LIST (\Unmarked) "/" "INBOX"
* LIST (\Unmarked) "/" "others"
* LIST (\Unmarked) "/" "parts"
* LIST (\Unmarked) "/" "sent"
* LIST (\Unmarked) "/" "spam"
* LIST (\Unmarked) "/" "sprinter"
* LIST (\Unmarked) "/" "sprinterforum"
* LIST (\Unmarked) "/" "squirrel"
* LIST (\Unmarked) "/" "trash"
* LIST (\Unmarked) "/" "videos"
LIST completed



>
>>  SquirrelMail version:1.4.22 Config file version:1.4.0 Config file last
>> modified:24 January 2023 19:41:26
>>   Checking PHP configuration...
>>      PHP version 5.6.40-0+deb8u12 OK.
>>      Running as sambar(1002) / sambar(1002)
>>      display_errors:
>>      error_reporting: 22527
>>      variables_order OK: GPCS.
>>      PHP extensions OK. Dynamic loading is disabled.
>>  Checking IMAP service....
>>      IMAP server ready (* OK IMAP4 Server ready )
>>      Capabilities: * CAPABILITY IMAP4 IMAP4rev1 QUOTA IDLE X-MOVE X-EXP
>N
>> AUTH=CRAM-MD5 STARTTLS
>>
>> My problem:
>> email headers are shown in the message body, either in html or plain-te
>xt
>> view.Sample from the Welcome message of this list:
>>
>> X-UID32: 1449536338 X-DATE: 1674576292 Return-path:
>> squirrelmail-users-bounces@xxxxxxxxxxxxxxxxxxxxx X-Spam-Checker-Version
>:
>> SpamAssassin 3.4.2 (2018-09-13) on         mars.yorktondigital.ca
>> X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0
>> tests=ALL_TRUSTED,BAYES_00,
>> MAILING_LIST_MULTI,TVD_RCVD_IP,TVD_RCVD_IP4 shortcircuit=no
>> autolearn=ham autolearn_force=no version=3.4.2 Received: from 216
>..105.38.7
>> by
>> mail.xxxxxxxxx.ca (SMTPD);         id s20230124100451.1798; Tue, 24 Jan
>> 2023
>> 10:04:51 Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge
>..com)
>>     by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95)
>> (envelope-from )         id 1pKLmv-0000Dg-1p         for user@xxxxxxxx.
>ca;
>>     Tue, 24 Jan 2023 16:04:44 +0000 MIME-Version: 1.0 Content-Type:
>> text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subjec
>t:
>> Welcome to the "squirrelmail-users" mailing list From:
>> squirrelmail-users-request@xxxxxxxxxxxxxxxxxxxxx To: user@xxxxxxxxxx
>> X-No-Archive: yes Message-ID:  Date: Tue, 24 Jan 2023 16:04:42 +0000
>> Precedence: bulk X-BeenThere: squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx
>> X-Mailman-Version: 2.1.21 List-Id: Squirrelmail User Support Mailing Li
>st
>> X-List-Administrivia: yes Errors-To:
>> squirrelmail-users-bounces@xxxxxxxxxxxxxxxxxxxxx Status: R   Welcome to
>> the
>> squirrelmail-users@xxxxxxxxxxxxxxxxxxxxx mailing list! Thank you for
>> joining
>> the SquirrelMail community.    If you have a question, you should check
> if
>> it's already answered in our documentation:
>>
>> ------
>> And here are the php error messages when viewing:
>>
>> PHP Warning: Variable passed to each() is not an array or object in
>> /home/sambar/sambar/vhosts/dev2/functions/mime.php on line 1594
>
>There is at least one fix related to this in version 1.4.23-svn, which is
>available to download and which I recommend.  However, it is questionable
>whether this would solve the problem of headers being shown in the
>message.
>
>> PHP Warning: Creating default object from empty value in
>> /home/sambar/sambar/vhosts/dev2/class/mime/Message.class.php on line 36
>7
>

Since SM1.4.23 those php-error messages are not shown.


>This is probably where SquirrelMail is choking on an unexpected
>BODYSTRUCTURE response.  You can inspect it using the IMAP info plugin --
>for example, I created a new folder called "test" and put a single messag
>e
>in the folder.  In the "IMAP server information" (found under "Options") 
>
>I
>enabled the SELECT command and changed it to "SELECT test" and enabled a
>new test (the first blank space) and filled in the command as "FETCH 1
>(FLAGS BODYSTRUCTURE)" (since the single message in that folder is ID 1).
> 
>Your commands may differ depending on the folder structure and ID
>assignment of your server... you'll have to look at the commands yourself
>,
>though the URLs of the message view page will give you a good indication
>of what they should be.
>
>A typical response to that command will look like:
>
>* 1 FETCH (FLAGS (\Seen) BODYSTRUCTURE (("text" "plain" ("charset"
>
>"us-ascii") NIL NIL "quoted-printable" 2040 54 NIL NIL NIL NIL)("text"
>
>"html" ("charset" "us-ascii") NIL NIL "quoted-printable" 
>9059 254 NIL NIL
>NIL NIL) "alternative" ("boundary" "gpcjbbGTVCmBXtPBPDUX") NIL 
>NIL NIL))

I did also this test with 2 different emails. Fetch1 is my problematic (header in body) email  and Fetch2 is an proper email. The result is

TEST_0
Request:
A003 SELECT test
Response:
* 2 EXISTS
* 2 RECENT
* OK [UIDVALIDITY 1449535965] UIDs valid
* OK [UIDNEXT 1449536361]
* FLAGS (\Answered \Flagged \Draft \Deleted \Seen \Recent)
[READ-WRITE] SELECT completed

TEST_6
Request:
A004 FETCH 1,2:* (FLAGS BODYSTRUCTURE)
Response:
* 1 FETCH (FLAGS (\Seen) BODYSTRUCTURE ("text" "plain" ("charset" "iso-8859-1") NIL NIL "8bit" 42 1 NIL NIL NIL))
* 2 FETCH (FLAGS (\Seen) BODYSTRUCTURE (("text" "plain" NIL NIL NIL {5}
7bit
483 1 NIL NIL NIL)("text" "html" NIL NIL NIL {5}
7bit
332 1 NIL NIL NIL) "alternative" NIL NIL NIL))
FETCH completed

I hope I did understand it correctly.

>
>> I really would appreciate some help, as I had tried already 2 different
>> installs 1.4.20, 1.4.21  and all have the same issue.
>
>I'd recommend you stick with 1.4.23-svn

Did install that on both on my test systems, (a: WIN,Apache b: Debian 8 ,Sambar) to have a proper comparison. There is no difference when contacting the same IMAP Server.
There is a difference when contacting Sambar IMAP and Mercury/32 IMAP
With Mercury/32 I have not these problems as I have with Sambar.

Said that, I have a difference in presenting the email when contacting Sambar IMAP, and that depends on email client and mostly ? content-type of email sent. Here are my findings:

Thunderbird > text/plain > header in body
Pegasus Mail > text/plain > header in body
Sambar Mail > text/html > header in body
Zimbra Mail > multipart/alternative > no problem
Java Mail > multipart/mixed > no problem
Canadian Tire promo email > multipart/alternative > no problem
JES2Mail listemail client > multipart/mix > no problem
Canada Post > text/html > header in body
Source Forge > text/plain > header in body

and here really strange with both IMAP servers, Sambar and/or Mercury/32
Samsung Android > Squirrel > message source
Sambar mail client > no problem

As you can see I did quite some tests to circle the source of the problem. I still think it is somewhere in the code of the mime-php files in folder /class/mime. 
Depending on the client but mostly on the content-type messages are shown proper or with header in the body.

I know I have an "outdated" system, but if you are willing to spent some time, I can setup an account on my test system for you if this will help. If you give me some advise what I can do from my end, as a non programmer :), I try to dig-in further. Just let me know

Thank you for your patience

Hans

>
>-- 
>Paul Lesniewski
>SquirrelMail Team
>Please support Open Source Software by donating to SquirrelMail!
>http://squirrelmail.org/donate_paul_lesniewski.php
>
>
>> What else on information would be needed ?
>> Where/what should I look for ?
>>
>> Emails created with the Zimbra client and received don't have this
>> problem.
>> Emails created by a shopping cart (shopify) don't show this problem.I c
>an
>> provide images if it is easier to understand. Images are better than
>> words. :)
>>
>> My old WIN install mentioned at the beginning does not have this, no
>> matter
>> which email client was used.
>> I really would like to get this fixed to be able to use SM with this ne
>w
>> install. Thank you for reading this long post, as I wanted to give as m
>uch
>> detail as possible.
>>
>> Hans
>
>
>
>
	





-----
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