Skip to content

Commit b7c2ff9

Browse files
authored
Merge pull request #6 from b1-systems/add-option-mail-received-header
Adds an option to toggle the `Received` headers for HTTP connections in Compose.
2 parents ce0b55a + bd7e1aa commit b7c2ff9

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

config/conf.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
<configinteger name="htmlsig_img_size" desc="The maximum cumulative size of
6161
image data that can be contained within the signature. 0 will disable
6262
this limit (NOT RECOMMENDED).">30000</configinteger>
63+
<configheader>Add Received header</configheader>
64+
<configboolean name="add_received_header" desc="Adds a header to the mail to
65+
indicate that Horde received the mail via HTTPS, and exposes the client IP
66+
address.">true</configboolean>
6367
</configsection>
6468
</configtab>
6569

lib/Compose.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ public function buildAndSendMessage(
745745
$body, $header, IMP_Prefs_Identity $identity, array $opts = array()
746746
)
747747
{
748-
global $injector, $prefs, $registry, $session;
748+
global $injector, $prefs, $registry, $session, $conf;
749749

750750
/* Set up defaults. */
751751
$opts = array_merge(array(
@@ -798,9 +798,11 @@ public function buildAndSendMessage(
798798
$headers = $this->_prepareHeaders($header, $opts);
799799

800800
/* Add a Received header for the hop from browser to server. */
801-
$headers->addHeaderOb(
802-
Horde_Core_Mime_Headers_Received::createHordeHop()
803-
);
801+
if (!isset($conf['compose']['add_received_header']) || ($conf['compose']['add_received_header'] === true)) {
802+
$headers->addHeaderOb(
803+
Horde_Core_Mime_Headers_Received::createHordeHop()
804+
);
805+
}
804806

805807
/* Add the 'User-Agent' header. */
806808
$headers->addHeaderOb(new Horde_Mime_Headers_UserAgent(

0 commit comments

Comments
 (0)