Scheduled Ruleset mail is not send to arbitrary emailadress, it's defined as token from CCK-field with emailadress
How can you explain:
A. The scheduled mail is send
1. when I make the CCK-email field (=recipient) "view anonymous"
OR
2. when the CCK-email fiels not ticked "view anonymous" permissions AND CRON-RUN is done by me, logged on with administer-right (or user 1)
B. The scheduled mail is not send
1. when the CCK-email fiels not ticked "view anonymous" permissions AND anonymous views the specific node or cron is run by anonymous.

I've a Content Type with CCK fields, in one CCK field is a emailadres saved. I use a scheduled ruleset to send after 2 months a email to that emailadres, saved in the CCK-field. See also the attachment Message.jpg
The permissions for CCK-email-field: anonymous "not view", that seems to be the reason the recipient is not found. When I'm logged on with administer permissions: "rights to view CCK-email-field" and the Scheduled rule is processed at that time by cron, the email is send and the recipient is found.
So the email is not send due to a permission-reason.
Is it possible to find the reason and solve this issue?
I use this scheduled ruleset for an job-bank in production, when a job is 2 months online then automatically is send an email to the contactperson of the specific job to ask if the job is still vacant.
Kind Regards

CommentFileSizeAuthor
#1 MailError.jpg42.02 KBPipB
Message.jpg94.21 KBPipB

Comments

PipB’s picture

Component: Rules Core » Rules Engine
StatusFileSize
new42.02 KB

I've debugging on for Rules, this is debug about the mail that not is send
•0 ms "Test Email contactpersoon na 1 uur ruleset" has been invoked.
•0.089 ms Executing the rule "Test email na 1 uur new rule bij rules" on rule set "Test Email contactpersoon na 1 uur ruleset"
•2.649 ms Action execution: "Send a mail to an arbitrary mail address"
•87.922 ms Evaluation of "Test Email contactpersoon na 1 uur ruleset" has been finished.

And in a Yellow line under de debug-code this line is displayed:
"Unable to send e-mail. Please contact the site administrator if the problem persists."

In the Drupal log I found the message: "Error sending e-mail (from XXXXXXX to )."
Nothing after "to", means no recipient is found,
See the message in the attachment: MailError.jpg

PipB’s picture

The token I used in the Scheduled Ruleset with mail to arbitrary mailadress:
[node:field_vaca_email-formatted]
I replace this with:
[node:field_vaca_email-raw]
and the scheduled mail is working.
Very strange......but my problem is solved.

But I don't know it's a very good solution because in the Api.txt file from the Token Module: the security note is not to use raw-token:

API.txt:
Security Note
========
If use any of the tokens in the ['raw'] sub-array then please note that these
are unfiltered values which could conceivably contain XSS attacks or other
malicious data. Your module should then provide it's own filtering to ensure the
safety of site users.

Because of this Security note, this issue is still active.

tr’s picture

Component: Rules Engine » Rules Core
Status: Active » Closed (outdated)