cmacmackin / dokuwiki-plugin-structtasks

Send reminder emails for tasks stored as struct data
GNU General Public License v2.0
0 stars 0 forks source link

assignees: multi email field - SMTP error message: "Unexpected return code - Expected: 354, Got: 554 | 554 5.5.1 Error: no valid recipients" #7

Open Chris75forumname opened 1 year ago

Chris75forumname commented 1 year ago

Assignees with multi email field: "There was an unexpected problem communicating with SMTP: Unexpected return code - Expected: 354, Got: 554 | 554 5.5.1 Error: no valid recipients" Structtask throws this error on creation of a new page with page data. No email is send. Are there any configuration details for smtp plugin, I should follow?

EDIT: I tested struct multi user field instead of struct multi email field and the error message disappears. Still, no emails received.

There is an accepted solution here: https://stackoverflow.com/questions/54616706/how-do-we-solve-error-554-5-5-1-no-valid-recipients-when-using-php-swiftmailer Do you think, something like this should be integrated?

try {
    $result = $mailer->send($message);
} 
catch (Swift_TransportException $e) {
    echo $e->getMessage();
}

However, I got the smtp plugin configured to send email notifications with bureaucracy plugin, which works fine.

BTW: There may be one more issue, I might have, because I hacked the date format in struct (to german d.m.Y). So I will have to figure that out. Do you know off the bat, where I can change the date format from d.m.Y back to Y-m-d in structtasks, so it will be processed correctly? Do you think structtask will not send any emails if this date format is wrong??

Cheers!

Chris75forumname commented 1 year ago

Hi, despite much effort, I couldn't get your plugin to run, yet. So, I am trying to debug, right now. The crontab entry does create a log file written to the main directory, each day. But, interestingly, this log file remains empty. Is that expected behaviour or shouldn't there be at least some error message inside this log file, with the verbose flag on??

Now the SMTP error: "no valid recipients". The bureaucracy plugin does it like so: https://codesearch.dokuwiki.org/xref/plugin/bureaucracy/helper/actionmail.php#15. And I can confirm this works. So why not recycle some of this code, to make email support more stable??

Chris75forumname commented 1 year ago

I tackled this some more and I found that after notify is initialized here: https://codesearch.dokuwiki.org/xref/plugin/structtasks/cli.php#52 no pages for the struct schema can be found and $task stays empty/undefined. Maybe, your plugin does not like my older struct version and this would maybe explain why getPage() fails? Did you test your plugin with older struct/sqlite versions?

Chris75forumname commented 1 year ago

I tested bez plugin. It is able to send reminder emails via this code: https://codesearch.dokuwiki.org/xref/plugin/bez/mdl/Entity.php#173 I don't know, how bez can manage this feat without any crontab entry. I will test how it does when wiki is laying dormant! UPDATE: It turns out, it doesn't. I just sends emails, as soon as the wiki is visited, Otherwise, not at all!

So the question remains, how can I run the wiki automatically by cronjob to send out emails, when it doesn't? ATM I am wondering, do I have to frankenstein the two plugins together, in order to get automatic email notification on db date as a feature into my wiki?? I guess I'm stuck again!