-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "ignore deny list" option when sending an email #360
Conversation
It doesn't do anything or get populated properly
" charset=UTF-8", | ||
"Content-Transfer-Encoding: 7bit", | ||
"", | ||
"Hello!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Content-Type: text/plain;", | ||
" charset=UTF-8", | ||
"Content-Transfer-Encoding: 7bit", | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Mime-Version: 1.0", | ||
"Content-Type: text/plain;", | ||
" charset=UTF-8", | ||
"Content-Transfer-Encoding: 7bit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Subject: Hello", | ||
"Mime-Version: 1.0", | ||
"Content-Type: text/plain;", | ||
" charset=UTF-8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Message-ID: <1.mail>", | ||
"Subject: Hello", | ||
"Mime-Version: 1.0", | ||
"Content-Type: text/plain;", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
end | ||
|
||
it do | ||
connection.receive_recipient("<wibble@wobble.com>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
" charset=UTF-8", | ||
"Content-Transfer-Encoding: 7bit", | ||
"", | ||
"Hello!" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Content-Type: text/plain;", | ||
" charset=UTF-8", | ||
"Content-Transfer-Encoding: 7bit", | ||
"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Mime-Version: 1.0", | ||
"Content-Type: text/plain;", | ||
" charset=UTF-8", | ||
"Content-Transfer-Encoding: 7bit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Subject: Hello", | ||
"Mime-Version: 1.0", | ||
"Content-Type: text/plain;", | ||
" charset=UTF-8", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -29,7 +30,7 @@ def send? | |||
# If there is no team there is no deny list | |||
# In concrete terms the internal cuttlefish app doesn't have a deny | |||
# list and isn't part of a team | |||
app.team.nil? || address.deny_lists.find_by(team_id: app.team.id).nil? | |||
app.team.nil? || email.ignore_deny_list || address.deny_lists.find_by(team_id: app.team.id).nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [100/80]
@@ -50,6 +52,6 @@ def call | |||
|
|||
private | |||
|
|||
attr_reader :app_id, :from, :to, :cc, :subject, :text_part, :html_part | |||
attr_reader :app_id, :from, :to, :cc, :subject, :text_part, :html_part, :ignore_deny_list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [93/80]
@@ -3,7 +3,7 @@ | |||
module EmailServices | |||
class Create < ApplicationService | |||
# rubocop:disable Naming/MethodParameterName | |||
def initialize(app_id:, from:, to:, cc:, subject:, text_part:, html_part:) | |||
def initialize(app_id:, from:, to:, cc:, subject:, text_part:, html_part:, ignore_deny_list:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/ParameterLists: Avoid parameter lists longer than 5 parameters. [8/5]
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.
Metrics/LineLength: Line is too long. [97/80]
# Now check for special headers | ||
m = Mail.new(current.data) | ||
h = m.header[IGNORE_DENY_LIST_HEADER] | ||
ignore_deny_list = (!h.nil? && h.value == "true") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
@@ -165,17 +165,28 @@ def process_data_line(line) | |||
end | |||
end | |||
|
|||
IGNORE_DENY_LIST_HEADER = "X-Cuttlefish-Ignore-Deny-List" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"X-Cuttlefish-Ignore-Deny-List: true", | ||
"Message-ID: <1.mail>", | ||
"Subject: Hello", | ||
"Mime-Version: 1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"To: wibble@wobble.com", | ||
"X-Cuttlefish-Ignore-Deny-List: true", | ||
"Message-ID: <1.mail>", | ||
"Subject: Hello", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"From: foo@bar.com", | ||
"To: wibble@wobble.com", | ||
"X-Cuttlefish-Ignore-Deny-List: true", | ||
"Message-ID: <1.mail>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
"Date: Wed, 12 Aug 2020 06:25:22 +0000", | ||
"From: foo@bar.com", | ||
"To: wibble@wobble.com", | ||
"X-Cuttlefish-Ignore-Deny-List: true", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
[ | ||
"Date: Wed, 12 Aug 2020 06:25:22 +0000", | ||
"From: foo@bar.com", | ||
"To: wibble@wobble.com", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
…st"" This reverts commit 489a589.
No description provided.