Fieldactions created bad "from" e-mail address
drmdwebb - August 7, 2009 - 20:35
| Project: | Field Actions |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
I had a problem with a bad "from" e-mail address when using fieldactions. None of the other modules that use drupal_mail exhibit this problem on my site.
I hacked the fieldactions module to behave properly when sending an e-mail. The hack occurs at line number 220. The original code was:
$from = $vars['%site_name'] .' <'. $vars['%site_mail'] .'>';
In line with other modules, I hacked this to the following:
$from = variable_get('site_mail', ini_get('sendmail_from'));
This fixed the problem. Perhaps the issue is on my end, but no other module using e-mail exhibited the problem. I'm new to this, so perhaps this isn't the best fix, and somebody can correct me.

#1
I am using the following contributed modules in my site:
advanced_help
bulkmail
calendar
cck
comment_upload
contactlink
date
fieldactions
jquery_ui
node_clone
realname
smtp
token
views
workflow
I suspect the problem lies in the interaction with realname, but I don't know for sure. The problem occurs whether or not smtp is installed.
#2
Can you send headers of a messed up email? You can replace characters in the email for spambots if you want.
#3
Sorry I didn't reply sooner; I was out of town on vacation.
I can't send along the headers of the e-mail, because the e-mail never gets sent. However, this is what the error message in the log looks like:
The error emitted by smtp:
Details
Type smtp
Date Tuesday, August 18, 2009 - 08:38
User --redacted--
Location http://--redacted--/node/607/clone
Referrer http://--redacted--/node/607/clone
Message The submitted from address ( **Admin name** ) is not valid.
Severity error
Hostname xxx.xxx.xx.xxx
Operations
And a similar error from mail:
Type mail
Date Tuesday, August 18, 2009 - 08:24
User --redacted--
Location http://--redacted--/node/add/action-item
Referrer http://--redacted--/node/add/action-item
Message Error sending e-mail (from **Admin name** to recipientname@mysite.com).
Severity error
Hostname xxx.xxx.xx.xxx
Operations
In this example, the user cloned an "action item," but the same error will happen when creating an action item from scratch--that is, it's not dependent on using the clone module.
#4
That error above didn't come out quite right. The message line should have read:
Message Error sending e-mail (from somename to recipient@mysite.com).
#5
Arggh!
somename above is actually the name of the administrator account, then an opening bracket, then the e-mail address, then the closing bracket:
Message Error sending e-mail (from somename "opening bracket" someaddress@mysite.com "closing bracket" to recipient@mysite.com).
#6
Same error occuring here - I'm about to implement the code change used above, see if that fixes the problem.
Emails don't get sent using "Send email to user reference field" but they do if you use "Send a mail to a user" action.
#7
That fix worked for me too. And I am using the latest release of the SMTP Authentication module.