Hi,
I've a little problem with token module.
I defined an action, when someone writes a post, the system must to send an email to an email account. I choosen tokenized e-mail,
because in this way it is possible to see the node the new post belongs to.
I already made the changes on the file modules/token/token_actions.module
token_replace_all with token_replace_multiple
Now the problem:
If someone writes a post, the system returns an error:
Unable to send e-mail. Please contact the site admin, if the problem persists.
and the admin receives this email:
subject: Mail failure - malformed recipient address
----------start email
A message that you sent contained one or more recipient addresses that were
incorrectly constructed:
New post on my New Drupal site: missing or malformed local part (expected word or "<")
This address has been ignored. There were no other addresses in your
message, and so no attempt at delivery was possible.
------ This is a copy of your message, including all the headers. ------
To: Nuovo post sul sito R&D CSP
Subject:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal
Errors-To: mail@domain.it
Return-Path: mail@domain.it
Sender: mail@domain.it
Reply-To: mail@domain.it
From: mail@domain.it
Message-Id:
Date: Wed, 30 Apr 2008 12:25:06 +0200
----------end email
With some debugs I notice that on the function drupal_mail the value recipients is mapped as Subject.
How I can sove this problem?
I'm using drupal 6.1, and I notice the same error on drupal 6.2
Best Regards
Tonio
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 253094_token_actions_mail_body.patch | 703 bytes | greggles |
| #7 | 253094_5_token_reroll_7.patch | 1.98 KB | greggles |
| #5 | 253094_5_token_reroll.patch | 1.83 KB | greggles |
| #1 | token_actions.module-mail.patch | 1.75 KB | seanr |
Comments
Comment #1
seanrDrupal's mail function changed significantly in Drupal 6. See attached patch. Haven't tested it myself yet at all, so I marked it as code needs work.
Comment #2
superjacent commentedSubscribe - (sorry for duplication - I posted a similar problem here http://drupal.org/node/242944#comment-836294)
Comment #3
gregglesSlightly improved title.
@superjacent and @redfox75 - can you test seanr's patch in #1?
Comment #4
superjacent commentedIt's not working for me. Get this error:
Parse error: syntax error, unexpected T_VARIABLE in /home/.../public_html/.../drupal-6.2/sites/all/modules/token/token_actions.module on line 140.Line 140 is in this piece of code:
Comment #5
greggles@superjacent - that's a parser error because it expected a semicolon.
re-rolled patch fixes that and applies cleanly.
Comment #6
calebtr commentedgreggles, I applied your patch and noticed that e-mail message bodies were still empty
should be
But I'm also noticing that I still get the 'unable to send email' error when my action is assigned to saving a comment rather than creating a node. Sending e-mail works on the node action, but not the comment action. I'm not seeing anything in the code in token - maybe something in actions.inc?
Comment #7
greggles@calebtr - thanks for finding that. I've re-rolled it to include that change.
Did you try this for users or taxonomies?
Since this seems to fix at least some of the cases I feel like it's probably worth committing and have moved it back to CNR to reflect that. Additional reviews would be awesome.
Comment #8
gregglesThanks for the patch and reviews, seanr and calebtr! I've now committed this to 6.x - http://drupal.org/cvs?commit=127492
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #10
dave reidThere also is one more thing... in token_actions.module, line 151 needs to be modified. I ran into a problem with Mollom trying to alter a new comment mail sent out by token module. It was expecting $message['body'] to be an array. I took a look at some other examples in core (e.g. contact_mail in contact.module) and confirmed that this is the correct behavior.
Currently:
Should Be:
Comment #11
gregglesGreat. This makes it work for me on a test site.
Comment #12
gregglesAnd I've now committed that fix - http://drupal.org/cvs?commit=131207
Thanks, Dave Reid!
Comment #13
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.