2

Using Drupal 7 and Civi 5.7.0

When sending batch emails using CiviMail, if I select "Administer CiviCRM » Scheduled Jobs" and select "Process now" on the "Send Scheduled Mailings" job then the mailing sends successfully. If I allow the cron to execute the same job, then I'm getting an SMTP error ("Failed to set sender" and "authentication failure") and the mailing fails. The log entries for the two jobs are identical. The SMTP settings are correct. The user specified in the cron job is the same as the one I'm using to "Process now".

Note: I recently dealt with the time zone error described in process_mailing processing addresses when called in UI but not CRON This got my cron running the process_mailing job but now I'm getting the SMTP error. The only change I made was to set the timezone on the server to the same as Drupal.

1 Answer 1

1

OK, the answer turns out to be a matter of capitalization. I'm using the cv addon (https://github.com/civicrm/cv) to send the command "job.execute" from cron. My cron line looks like:

cv api job.execute --user=username --cwd=/var/www/html/sites/default

However, my username on the server is not capitalized while my Username in Drupal IS capitalized. When I changed the cron to "--user=Username" all is well. It is interesting that the cron WAS executing and that the commands were being fired, thus the entries in the CiviCRM logs. However, since Drupal was seeing "username" as an unauthenticated user without the authority to send email, even though the process_mailing command was working, SMTP was failing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.