Am 08.12.2012 23:17, schrieb Michael Heydekamp:
> I'll try again to find a way to support both Envelope-to: and Delivered-To:
> for our own purpose by using copy&paste techniques ;-) , but due to lack of
> PHP skills, I'll not be able to safely support Received: as well.
I'm providing the diffs/patches attached, which now work for me with
0.9-git-master. When replying to a message in the Roundcube lists, the
correct identity will be chosen automatically (in our case based on the
"Envelope-to:" header).
Feel free to use/commit them.
Notes:
------
1) Typo in compose.inc corrected ("amtches" -> "matches")
2) Both "Envelope-to:" (Exim) and "Delivered-To:" (qmail, Postfix) should
be supported, although I could just test "Envelope-to:". The headers of the
messages in the Roundcube mailing lists do in our case look like this:
> Envelope-to: [email protected]
> Delivered-To: [email protected]
I'm not sure what would happen if it would be vice versa and the
"Delivered-To:" header would contain the recipient's address rather than the
"Envelope-to:" header. But it should work, IMO.
3) I'm also not sure what would happen if more than one "Envelope-to:"
and/or Delivered-to:" header would exist.
4) The "Received:" header is not (yet) supported, as my PHP skills are not
sufficient for this purpose. But in the long run it should be supported,
IMO.
> And again: Even if this all will work at the end of the day, it still
> doesn't help for new messages. So an identity option in the addressbook
> would still be a good idea IMO.
>
> Although I can very well imagine that this may get a bit complex, as all
> addressbook entries need to be checked and probably get updated if an
> identity is being changed or deleted.
Just a reminder. ;)
Cheers,
--
Michael Heydekamp
Co-Admin freexp.de
Düsseldorf/Germany--- compose.inc.original 2012-12-08 00:20:04.000000000 +0100
+++ compose.inc.new 2012-12-09 01:40:02.000000000 +0100
@@ -436,7 +436,7 @@
}
}
- // If matching by name+address doesn't found any amtches, get first found address (identity)
+ // If matching by name+address doesn't found any matches, get first found address (identity)
if ($from_idx === null) {
$from_idx = $found_idx;
}
@@ -451,7 +451,17 @@
}
}
- // Fallback using Delivered-To
+ // Fallback using Envelope-to (Exim)
+ if ($from_idx === null && ($envelope_to = $MESSAGE->headers->others['envelope-to'])) {
+ foreach ($identities as $idx => $ident) {
+ if (in_array($ident['email_ascii'], (array)$envelope_to)) {
+ $from_idx = $idx;
+ break;
+ }
+ }
+ }
+
+ // Fallback using Delivered-To (qmail, Postfix)
if ($from_idx === null && ($delivered_to = $MESSAGE->headers->others['delivered-to'])) {
foreach ($identities as $idx => $ident) {
if (in_array($ident['email_ascii'], (array)$delivered_to)) {
--- rcube_storage.php.original 2012-11-29 00:20:04.000000000 +0100
+++ rcube_storage.php.new 2012-12-09 01:32:52.000000000 +0100
@@ -64,6 +64,7 @@
'MAIL-FOLLOWUP-TO',
'MAIL-REPLY-TO',
'RETURN-PATH',
+ 'ENVELOPE-TO',
'DELIVERED-TO',
);
_______________________________________________
Roundcube Development discussion mailing list
[email protected]
http://lists.roundcube.net/mailman/listinfo/dev