Skip to content

Commit

Permalink
Merge pull request #3 from ko31/develop
Browse files Browse the repository at this point in the history
👍 #2 Change the way forwarded mail is judged
  • Loading branch information
ko31 authored Jun 9, 2021
2 parents 2ca8b1c + 0de4603 commit 1c53778
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mail2linenotify.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class MailToLineNotify {
*/
const MAX_MESSAGE_LENGTH = 1000;

/**
* Return path set in forwarded mail.
*/
const TRANSFERD_RETURN_PATH = 'MAILER-DAEMON';

/**
* LINE Notify access token.
*
Expand Down Expand Up @@ -82,7 +87,7 @@ public function parseMailContent() {

// Detect whether to send a forwarded mail.
if ( ! $this->is_send_forwarded_email ) {
if ( $message->getHeaderValue( HeaderConsts::TO ) !== $message->getHeaderValue( 'Delivered-To' ) ) {
if ( self::TRANSFERD_RETURN_PATH === $message->getHeaderValue( 'Return-Path' ) ) {
return;
}
}
Expand Down

0 comments on commit 1c53778

Please sign in to comment.