[GH-ISSUE #223] [BUG][Display?] @mail.world.org behind every entity in To and CC Field #186

Closed
opened 2026-02-25 21:34:22 +03:00 by kerem · 9 comments
Owner

Originally created by @ulfgebhardt on GitHub (Aug 29, 2017).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/223

Originally assigned to: @jasonmunro on GitHub.

When inspecting an EMail under "Sent" The "To" and "CC"-Field contain

"Peter"@mail.world.org, peter@world.org
<"some@address.com"@mail.world.org>
This seems to apply to Addresses in the local Address book

This might be an Serverproblem - i cannot tell yet. If you like I can make a seperate Issue for that.

Looking at is_email_address this could be caused by an "is-local-detection" false positiv

This is an Issue described in #218 and seperated from that thread

Grüße Ulf

<3

Originally created by @ulfgebhardt on GitHub (Aug 29, 2017). Original GitHub issue: https://github.com/cypht-org/cypht/issues/223 Originally assigned to: @jasonmunro on GitHub. When inspecting an EMail under "Sent" The "To" and "CC"-Field contain > "Peter"@mail.world.org, peter@world.org > &lt;"some@address.com"@mail.world.org> > This seems to apply to Addresses in the local Address book This might be an Serverproblem - i cannot tell yet. If you like I can make a seperate Issue for that. > Looking at [is_email_address](https://github.com/jasonmunro/cypht/blob/master/modules/core/functions.php#L166) this could be caused by an "is-local-detection" false positiv This is an Issue described in #218 and seperated from that thread Grüße Ulf <3
kerem 2026-02-25 21:34:22 +03:00
  • closed this issue
  • added the
    bug
    imap
    labels
Author
Owner

@jasonmunro commented on GitHub (Sep 12, 2017):

we don't use enable local addresses in the code, so I don't think that's the issue. Can you use the "raw" link when viewing the message and show me what the actual header line for these address fields looks like? The "raw" view does not reformat the message at all except to make it safe to view in the browser. Thanks!

<!-- gh-comment-id:328974987 --> @jasonmunro commented on GitHub (Sep 12, 2017): we don't use enable local addresses in the code, so I don't think that's the issue. Can you use the "raw" link when viewing the message and show me what the actual header line for these address fields looks like? The "raw" view does not reformat the message at all except to make it safe to view in the browser. Thanks!
Author
Owner

@ulfgebhardt commented on GitHub (Sep 13, 2017):

Hey,
you are right - the Header contains the malformed Address already:

Return-Path: <peter@world.org>
Delivered-To: peter@world.org
Received: from world.org (world.org [123.456.789.123])
    by mail.world.org (Postfix) with ESMTPSA id ABCDEFG
    for <peter@world.org>; Mon, 15 Dec 2017 14:23:54 +0200 (CEST)
X-Mailer: Cypht
MIME-Version: 1.0
From: "Peter World" <peter@world.org>
Reply-To: peter@world.org
To: "Petra World"@mail.world.org, petra@world.org
Subject: Fwd: Re: Bla
Date: Mon, 19 Jan 2017 14:23:54 +0200
Message-Id: <123@world.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Auto-Bcc: cypht

As you can see the To Field in the Header contains the malformed address.

"Petra World"@mail.world.org, petra@world.org

The reason for this is Postfix, which appends the @mail.world.org part on incomplete Addresses

Transform an incomplete address into a complete address. For example, transform "username" into "username@example.com", or transform "username@hostname" into "username@hostname.example.com".

source

Since this EMail was sent by Cypht I think it is still a Cypht-Problem, but on sending rather then on displaying an EMail. An incomplete Address is sent to the Mailserver, which appends the local domain to try making it a valid EMail-Address. Cypht should not send incomplete Recipients to the Server.

Note: Those EMails are from the old Version - therefor I cannot tell, if the Problem remains in the latest. I will give Feedback as soon as I see it again or report after a while when it doesn't.

Another thing is: If i try to send an EMail to peter@mail.world.org i get an

An error occurred during the RCPT command

since the Mailserver does not recognize the EMail-Address (local sending within the same Server).
If I try this from an external EMail Server I get an EMail with:

Mail delivery failed: returning message to sender
SMTP error from remote server for RCPT TO command, host: mail.world.org (123.456.789.123) reason: 550 5.1.1 peter@mail.world.org: Recipient address rejected: User
unknown in local recipient table

If I try to send an EMail to

"Petra World"@mail.world.org

like shown in the Header, I get:

No valid receipts found

from Cypht and the EMail is not sent at all.
The same applies if I try to send to:

"Petra World"

But I get neither of those responses when the @mail.world.org Address appears in the EMail To-Field in Cypht. The EMail properly delivers without any notification of failure only the malformed Address is displayed in the Sent Folder.

UPDATE

I can reproduce the behaviour! Send an EMail to

"Petra World", validemail@world.org

and you can see the described behaviour.

This results in

Return-Path: <fromemail@world.org>
Delivered-To: validemail@world.org
Received: from world.org (world.org [123.456.789.123])
    by mail.world.org (Postfix) with ESMTPSA id ABCDEF
    for <validemail@world.org>; Wed, 13 Sep 2017 11:28:10 +0200 (CEST)
X-Mailer: Cypht
MIME-Version: 1.0
From: "Peter World" <fromemail@world.org>
Reply-To: fromemail@world.org
To: "Petra World"@mail.world.org, validemail@world.org
Subject: test
Date: Wed, 99 Feb 2017 15:28:10 +0200
Message-Id: <ABCDEF@world.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Auto-Bcc: cypht

The Postfix log does not show any sign of a delivery attempt to

"Petra World"@mail.world.org

The same behaviour can be produced by sending to:

"Peter World" peter@world.org
Result: "Peter World"@mail.world.org, peter@world.org

The EMail is not sent successfully when sending to

"Peter World | Organisation" p.world@world-org.org
Result: Peter World \| Organisation" <p.world@world-org.org>@mail.world.org
Note the missing Quote ", The | is escaped with a slash - the slash is not displayed itself
The Header contains an utf8 escaped To Field: =?UTF-8?B?ABCDEFG....XYZ==?=@mail.world.org

References:

Thunderbird searches for the comma: https://dxr.mozilla.org/comm-central/source/mailnews/mime/src/mimeJSComponents.js#411
Docu Reference: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMsgHeaderParser#extractHeaderAddressMailboxes()

There is a php function to parse EMail-Addresses by RFC822

http://php.net/manual/en/function.mailparse-rfc822-parse-addresses.php & Source
There is a test, which propably utilizes this function
http://sphinx.mythic-beasts.com/~pdw/cgi-bin/emailvalidate
The Above EMails are valid by RFC822

The common use-case when this behaviour occurs is by replying to an EMail(with multiple Recipients). For those cases a RFC822-compilant Header is available (else the Mailserver prob. would have failed to deliver). The Header can be used as input for the TO-Field in Compose(or combined to & cc Fields). When sending the EMail the PHP-Function can be used to parse the TO and CC Fields and check for errors. Should the user append an EMail-Address to the Recipient-list in a non-RFC822-compilant way he can be warned(maybe he missed a comma).

This could be relevant and/or interlinked with the remaining Problems of #218

Rev: 26a3870e58

Grüße Ulf

<3

<!-- gh-comment-id:329086767 --> @ulfgebhardt commented on GitHub (Sep 13, 2017): Hey, you are right - the Header contains the malformed Address already: ``` Return-Path: <peter@world.org> Delivered-To: peter@world.org Received: from world.org (world.org [123.456.789.123]) by mail.world.org (Postfix) with ESMTPSA id ABCDEFG for <peter@world.org>; Mon, 15 Dec 2017 14:23:54 +0200 (CEST) X-Mailer: Cypht MIME-Version: 1.0 From: "Peter World" <peter@world.org> Reply-To: peter@world.org To: "Petra World"@mail.world.org, petra@world.org Subject: Fwd: Re: Bla Date: Mon, 19 Jan 2017 14:23:54 +0200 Message-Id: <123@world.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Auto-Bcc: cypht ``` As you can see the To Field in the Header contains the malformed address. `"Petra World"@mail.world.org, petra@world.org` The reason for this is Postfix, which appends the @mail.world.org part on incomplete Addresses > Transform an incomplete address into a complete address. For example, transform "username" into "username@example.com", or transform "username@hostname" into "username@hostname.example.com". [source](http://www.postfix.org/ADDRESS_REWRITING_README.html) Since this EMail was sent by Cypht I think it is still a Cypht-Problem, but on sending rather then on displaying an EMail. An incomplete Address is sent to the Mailserver, which appends the local domain to try making it a valid EMail-Address. Cypht should not send incomplete Recipients to the Server. ~~Note: Those EMails are from the old Version - therefor I cannot tell, if the Problem remains in the latest. I will give Feedback as soon as I see it again or report after a while when it doesn't.~~ Another thing is: If i try to send an EMail to peter@mail.world.org i get an > An error occurred during the RCPT command since the Mailserver does not recognize the EMail-Address (local sending within the same Server). If I try this from an external EMail Server I get an EMail with: > Mail delivery failed: returning message to sender > SMTP error from remote server for RCPT TO command, host: mail.world.org (123.456.789.123) reason: 550 5.1.1 <peter@mail.world.org>: Recipient address rejected: User unknown in local recipient table If I try to send an EMail to > "Petra World"@mail.world.org like shown in the Header, I get: > No valid receipts found from Cypht and the EMail is not sent at all. The same applies if I try to send to: > "Petra World" But I get neither of those responses when the @mail.world.org Address appears in the EMail To-Field in Cypht. The EMail properly delivers without any notification of failure only the malformed Address is displayed in the Sent Folder. ## **UPDATE** I can reproduce the behaviour! Send an EMail to > "Petra World", validemail@world.org and you can see the described behaviour. This results in ``` Return-Path: <fromemail@world.org> Delivered-To: validemail@world.org Received: from world.org (world.org [123.456.789.123]) by mail.world.org (Postfix) with ESMTPSA id ABCDEF for <validemail@world.org>; Wed, 13 Sep 2017 11:28:10 +0200 (CEST) X-Mailer: Cypht MIME-Version: 1.0 From: "Peter World" <fromemail@world.org> Reply-To: fromemail@world.org To: "Petra World"@mail.world.org, validemail@world.org Subject: test Date: Wed, 99 Feb 2017 15:28:10 +0200 Message-Id: <ABCDEF@world.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Auto-Bcc: cypht ``` The Postfix log does not show any sign of a delivery attempt to > "Petra World"@mail.world.org The same behaviour can be produced by sending to: > "Peter World" peter@world.org > Result: "Peter World"@mail.world.org, peter@world.org The EMail is ~~not~~ sent successfully when sending to > "Peter World | Organisation" <p.world@world-org.org> > Result: Peter World \\| Organisation" &lt;p.world@world-org.org>@mail.world.org > Note the missing Quote ", The | is escaped with a slash - the slash is not displayed itself > The Header contains an utf8 escaped To Field: =?UTF-8?B?ABCDEFG....XYZ==?=@mail.world.org References: > Thunderbird searches for the comma: https://dxr.mozilla.org/comm-central/source/mailnews/mime/src/mimeJSComponents.js#411 > Docu Reference: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMsgHeaderParser#extractHeaderAddressMailboxes() There is a php function to parse EMail-Addresses by [RFC822](https://www.w3.org/Protocols/rfc822/) > http://php.net/manual/en/function.mailparse-rfc822-parse-addresses.php & [Source](https://github.com/php/pecl-mail-mailparse/blob/374a940991a26acde4c49de381d0fa65cf35b914/mailparse.c#L845) There is a test, which propably utilizes this function > http://sphinx.mythic-beasts.com/~pdw/cgi-bin/emailvalidate The Above EMails are valid by RFC822 The common use-case when this behaviour occurs is by replying to an EMail(with multiple Recipients). For those cases a RFC822-compilant Header is available (else the Mailserver prob. would have failed to deliver). The Header can be used as input for the TO-Field in Compose(or combined to & cc Fields). When sending the EMail the PHP-Function can be used to parse the TO and CC Fields and check for errors. Should the user append an EMail-Address to the Recipient-list in a non-RFC822-compilant way he can be warned(maybe he missed a comma). This could be relevant and/or interlinked with the remaining Problems of #218 Rev: 26a3870e58702787c0b8356863b8c4108a9bf1d7 Grüße Ulf <3
Author
Owner

@jasonmunro commented on GitHub (Sep 21, 2017):

Thanks for the update! I tested sending to the following:

"Jason Munro", jason@cypht.org

it worked as expected. A message was sent to jason@cypht.org, and the first invalid address was ignored. The To: header of the E-mail was not changed in any way, unlike your results. Cypht parses the To/Cc/Bcc lines, pulls out all the addresses, and uses those in the SMTP conversation. Then it sets the To: address header to exactly what you entered - it does not append any domains or attempt to clean it up.

So in this case Cypht did the "right" thing I think, except that it did no notify the user that the address line was malformed. I did not know about the php function to parse addresses, looks like that is a pecl package now. I'm not too keen on adding that as a requirement to run Cypht, but I will look into it. I would prefer to enhance our existing parsing path to notice malformed address lines and optionally notify the user if something does not look right.

<!-- gh-comment-id:331267832 --> @jasonmunro commented on GitHub (Sep 21, 2017): Thanks for the update! I tested sending to the following: "Jason Munro", <jason@cypht.org> it worked as expected. A message was sent to jason@cypht.org, and the first invalid address was ignored. The To: header of the E-mail was not changed in any way, unlike your results. Cypht parses the To/Cc/Bcc lines, pulls out all the addresses, and uses those in the SMTP conversation. Then it sets the To: address header to exactly what you entered - it does not append any domains or attempt to clean it up. So in this case Cypht did the "right" thing I think, except that it did no notify the user that the address line was malformed. I did not know about the php function to parse addresses, looks like that is a pecl package now. I'm not too keen on adding that as a requirement to run Cypht, but I will look into it. I would prefer to enhance our existing parsing path to notice malformed address lines and optionally notify the user if something does not look right.
Author
Owner

@ulfgebhardt commented on GitHub (Sep 21, 2017):

Ok - so I guess its a Postfix thingy... maybe mine is misconfigured or hacked :(

Could you try to send to

"Jason Munro" jason@cypht.org
without the comma - that makes Problems aswell for me.

Grüße Ulf

<3

<!-- gh-comment-id:331277421 --> @ulfgebhardt commented on GitHub (Sep 21, 2017): Ok - so I guess its a Postfix thingy... maybe mine is misconfigured or hacked :( Could you try to send to > "Jason Munro" jason@cypht.org without the comma - that makes Problems aswell for me. Grüße Ulf <3
Author
Owner

@jasonmunro commented on GitHub (Sep 21, 2017):

works fine without the comma for me

<!-- gh-comment-id:331280530 --> @jasonmunro commented on GitHub (Sep 21, 2017): works fine without the comma for me
Author
Owner

@ulfgebhardt commented on GitHub (Sep 21, 2017):

Thanks for the Feedback. If you don't mind I would keep the Issue open for a bit longer, maybe i find the cause - if I don't I guess it should be closed. But its your call - if you can't reproduce the Problem, your obviously cant fix it.

Grüße Ulf

<3

<!-- gh-comment-id:331281309 --> @ulfgebhardt commented on GitHub (Sep 21, 2017): Thanks for the Feedback. If you don't mind I would keep the Issue open for a bit longer, maybe i find the cause - if I don't I guess it should be closed. But its your call - if you can't reproduce the Problem, your obviously cant fix it. Grüße Ulf <3
Author
Owner

@jasonmunro commented on GitHub (Sep 21, 2017):

I'm fine with keeping the issue open as long as you like. Just because I can't reproduce it does not mean there is not a bug in the code. Looks like Postfix earlier than 2.2 always does header rewrites, and after that it is something you can disable. I'm running a pretty default 3.1 postfix for cypht.org and I don't recall doing anything to disable header rewriting (but it's been a while since I set it up).

<!-- gh-comment-id:331282710 --> @jasonmunro commented on GitHub (Sep 21, 2017): I'm fine with keeping the issue open as long as you like. Just because I can't reproduce it does not mean there is not a bug in the code. Looks like Postfix earlier than 2.2 always does header rewrites, and after that it is something you can disable. I'm running a pretty default 3.1 postfix for cypht.org and I don't recall doing anything to disable header rewriting (but it's been a while since I set it up).
Author
Owner

@ulfgebhardt commented on GitHub (Sep 27, 2017):

Sorry for making you read all my stuff - Problem was Postfix

https://serverfault.com/questions/250855/postfix-disable-address-rewrite

local_header_rewrite_clients =

Solves this with Postfix 2.2

Grüße Ulf

<3

PS: Thanks for the great work, fast response time and all that effort you put into this awesome project!

<!-- gh-comment-id:332674147 --> @ulfgebhardt commented on GitHub (Sep 27, 2017): Sorry for making you read all my stuff - Problem was Postfix https://serverfault.com/questions/250855/postfix-disable-address-rewrite `local_header_rewrite_clients =` Solves this with Postfix 2.2 Grüße Ulf <3 PS: Thanks for the great work, fast response time and all that effort you put into this awesome project!
Author
Owner

@jasonmunro commented on GitHub (Sep 27, 2017):

I'm always happy to help. Not only did you help me by finding some bugs that have since been corrected, but others coming here with similar problems can benefit from the resolution even if it was not a cypht specific issue. Thanks again!

<!-- gh-comment-id:332679454 --> @jasonmunro commented on GitHub (Sep 27, 2017): I'm always happy to help. Not only did you help me by finding some bugs that have since been corrected, but others coming here with similar problems can benefit from the resolution even if it was not a cypht specific issue. Thanks again!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#186
No description provided.