Closed (fixed)
Project:
Mail Comment
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jan 2012 at 20:55 UTC
Updated:
1 Oct 2014 at 08:35 UTC
Jump to comment: Most recent
It used to be that the 'name' (now 'admin_title') of a mailbox had to be an email address. Now it is suggested, but not required, for this to be the case. The problem is that in the Mail Comment configuration, the admin_title of the selected mailbox is used to set the reply-to address for outgoing emails; if the admin_title is not a valid email, that is a bad thing...
Maybe this option should be a free-input field instead of a select box? The downside is that we can't just set a default based on a mailbox name...
Also, once this is resolved, we may want to edit the mailbox config form to change 'email address' to 'mailbox name' or whatever, to avoid confusion.
Comments
Comment #1
danepowell commentedAdditionally, it seems that the reply-to address may not be getting set at all- does it default to the site address?
Comment #2
rsbecker commentedI have found with Messaging 6.x-2.x and 6.x-4.x, if you use PHPMailer the reply-to address is not set properly. There is a fix for this. I'm not sure it would work with 7.x
If you use PHPMailer, rather than Drupal Mail to send messages you must fix a bug in the messaging_phpmailer.module file to ensure that the reply-to address is set properly in outgoing. Find the following code:
Replace it with:
Comment #3
danepowell commented@rsbecker See #548864: AddReplyTo method called with invalid parameters. I think the 'fix' that you propose would actually cause a regression of that issue.
Comment #4
danepowell commented@rsbecker I see that you've replied to #1067202: Reply-to header not set correctly when used with phpmailer, please continue discussion of the PHPMailer reply-to issue there.
Comment #5
rsbecker commentedYou're correct, it is a regression. All I can tell you is that it works and the change to preg_match does not work on 3 sites I have. These sites use messaging 6.x-4.x-dev. I can't explain why this is so.
I am using the phpmailer 5.1 library if that is helpful.
Comment #6
danepowell commentedNevermind #1... the reply-to seems to be set just fine. Maybe I was confused because the from address is the site address. Anyway, I changed the reply-to option to be a textfield defaulting to the site email address:
http://drupalcode.org/project/mailcomment.git/commit/b26807f
http://drupalcode.org/project/mailcomment.git/commit/fa44b6b
Comment #8
MickC commentedI was getting the wrong 'reply-to' - it was defaulting to the 'from' but only for some emails.
More weirdly, if I only sent to some of my subscribers it was ok, but if I sent to all of them, the reply-to would be wrong.
But inconsistently - I had 2 admin users subscribing to check - sometimes one, the other, both, none would have the wrong reply-to.
So I added a line at the end to hard code the reply-to, hence ignoring any if statements wrapped around it earlier on (see bottom of this post)
This works, but not ideal - do you think some of those if conditions need to be reviewed?
Why do we need these conditions? If any fail then quite a few steps won't be done
if ($params ----------------------- OK, so what is the problem if no params?
&& ($reply = variable_get('mailcomment_mailbox', '')) -------------- why do we need this if we set reply-to in the UI?
&& user_access('post comments', $account) ---------------------- doesn't Mailhandler and feeds already do this?
&& (node_load($event->objects['node']->value)->comment == 2) ---- OK I guess just checking that comments are open
Comment #9
MickC commentedUPDATE - ok the hard coding works, but I've noticed a couple of other issues:
Another thing I noticed in the code is different event types -should they be the same? First line uses 'node-post'
Then later it uses 'node'