Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions classes/emailmessage.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,4 +462,34 @@ protected function IsNewPartLine($sLine, $aDelimiterPatterns)
}
return null;
}

/**
* Check whether the message is an auto reply
* @return bool
* @since 3.5.1
*/
public function IsAutoReplyEmail()
{
$aAutoReplyHeaderPatterns = array(
'auto-submitted' => '/^auto-replied.*$/i',
);
if (class_exists('MetaModel'))
{
$aAutoReplyHeaderPatterns = MetaModel::GetModuleSetting('combodo-email-synchro', 'auto_reply_header_patterns', $aAutoReplyHeaderPatterns);
}
foreach ($aAutoReplyHeaderPatterns as $sHeader => $sPattern) {
if(array_key_exists(strtolower($sHeader), $this->aHeaders))
{
IssueLog::Debug("Header \"$sHeader\" exists with the value: \"" . $this->aHeaders[strtolower($sHeader)] . "\"");
if (preg_match($sPattern, $this->aHeaders[strtolower($sHeader)]))
{
// Current mail is an auto reply
IssueLog::Debug("Given mail is an autoreply!");
return true;
}
}
}

return false;
}
}
3 changes: 3 additions & 0 deletions module.combodo-email-synchro.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
'images_minimum_size' => '100x20', // Images smaller that these dimensions will be ignored (signatures...)
'images_maximum_size' => '', // Images bigger that these dimensions will be resized before uploading into iTop
'recommended_max_allowed_packet' => 10*1024*1024, // MySQL parameter for attachments
'auto_reply_header_patterns' => array (
'auto-submitted' => '/^auto-replied.*$/i',
),
),
)
);
Expand Down