Closed (fixed)
Project:
Inmail
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Reporter:
Created:
28 Jun 2016 at 20:53 UTC
Updated:
15 Nov 2016 at 22:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
miro_dietikerPromoting to major since this could be a great value from inmail and removes complexity from custom solutions.
Comment #3
miro_dietikerSure, we need to discuss if this is debug only, if handlers could modify / enrich the response, or suppress / replace it at all.
Comment #4
mbovan commentedYes, it seems it can be a setting in Inmail settings... Becuase of the mentioned reasons (bounce messages), I think handlers should be able to disable replies too.
There are log messages on the processor result object. Those messages are used to create event arguments. We could think to use them for reply reports.
Comment #5
miro_dietikerYeah a simple first version could to send all the log lines to the source.
Still not sure about the exact additional interface we should define.
The response could have some response object on it.
And the response could have a flag if it should include the log.
Again this is related to the standard result. #2754253: Lack of standard result in collaboration of analyzers
Or we could again introduce another partial interface.
Comment #6
toncic commentedI trying to send message, but we want to send message from admin@example.com or from custom email address? The test are failing, just first step on this issue. After discussing with @miro_dietiker, we also want to add checkbox in deliverer settings to ask user if he want the whole log message in message body or not, and test of course.
Comment #8
miro_dietikerOh we already have some other mail case...
So we need a switch statement for $key.
Remove those lines related to $result or $sensor_* That's more related to a Monitoring result where we copied the code from.
We could simply answer with the original subject + "Re: ".
Simply remove. The standard from is OK.
We should add a reference to the original message-id here.
It's $module and $key. So it's "success" and not "Success".
And as discussed, make sending this mail a configuration setting of the deliverer.
Comment #9
toncic commentedAdded test coverage and try to add checkbox, but I am not sure where is the best to save that state.
Comment #11
toncic commentedReview by Miro:
The from is the site.
Initialise with default value, not constructor.
This is messing with the principle of unique id by reusing it. Use the references field: https://tools.ietf.org/html/rfc2822#section-3.6.4
No.
Consider the code that we previously wrote to fill the body with the result log. Start the message with something like:
The message has been processed successfully.
The key is about mail, not log. Say 'mail'.
Label: Mail processing report to sender.
Use the same CamelCase member var name.
The proper signature is:
public function mail($module, $key, $to, $langcode, $params = array(), $reply = NULL, $send = TRUE) {
inmail_success is not a module name...
Also the setting is not considered.
By default the setting should be disabled and you should check in tests that no mail is sent. Only after enabling, you should retrigger and check count.
Assert all mail body and header by example.
Comment #12
toncic commentedAdded checkbox in deliverer settings and test coverage for that. Also sending mail and test for that.

Comment #13
toncic commentedComment #15
miro_dietikerCheck this first and only do the lines above inside the if().
mail => mails. I would recommend that you assign the mail in question:
$mail = $mails[0]
That's an awesome example...
Because it reminds me that we will for sure NOT send a mail to the sender in case the mail is classified as a bounce...
Otherwise we will create mail loops.
Let's add some more data such as:
- Original message date
Anything else to mention in the body?
OK we can do this in a follow-up. But please remove the garbage comment lines. Just add a clean @todo and a link to the issue where the method is added.
There's no "= ..."
Comment #16
toncic commentedImplemented stuff from #15.
Moved creating checkbox in DelivererConfigurationForm.
Created follow -up..
Do we want to create new follow up for skipping bounce mail?
Comment #17
toncic commentedComment #18
johnchqueTypo (?)
. missing at the end.
Wrong indentation? :)
Extra white line. :)
Comment #19
toncic commentedImplemented comm #18.
Comment #20
miro_dietikerThe site is the from by default. You don't need to state that. Also, it is improved over your code because it's the site name as display name.
still unchanged. see my comments above.
You still need to make sure that messages classified as bounce are not triggering a mail.
Something like
And even if "send report" is enabled, you want to make sure in tests that when processing a bounce, no mail went out.
Comment #21
toncic commentedImplemented stuff from #20.
Comment #22
toncic commentedWrong extension for interdiff.
Comment #24
toncic commentedComment #25
miro_dietikerThis is not correct.
Even if the bounce context doesn't exist, such as when the BounceAnalyzer is disabled, the mail should be sent.
It should only be skipped if the context explicitly exists and confirms isBounce().
Comment #26
toncic commentedChanged the if logic.
Comment #28
miro_dietikerWhere is this from...This is misleading, but it's already defined in setUp(). :-)
Committed with lots of small fixes.