diff --git a/troubleshooting/send_mail.md b/troubleshooting/send_mail.md index d57b8d83a97387e19a3a24ad1d949d67b5300b0f..9b433e0e299e9143d686edec4b0098ba6a10b0c3 100644 --- a/troubleshooting/send_mail.md +++ b/troubleshooting/send_mail.md @@ -1,8 +1,65 @@ -Envoi de mails -========================== +# Envoi de mails ## Vérifications -*sendmail/batch/config/config.xml -*notifications/batch/config/config.xml \ No newline at end of file +```bash +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/custom/cs_test/modules/notifications/batch/config$ ls -ltr +total 4 +-rwxrwx--- 1 maarch maarch 2824 juil. 11 17:41 config.xml +``` + +```sh +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/custom/cs_test/modules/sendmail/batch/config/config.xml$ ls -ltr +total 4 +-rwxrwx--- 1 maarch maarch 2824 juil. 11 17:41 config.xml +``` + +https://docs.maarch.org/gitbook/html/MaarchCourrier/18.04/guat/guat_exploitation/sendmail_notif.html + +## Diagnostique + +Dans le cas de non reception de mail, on peut faire le test en lançant le script d'envoi de mail : + +``` +/var/www/html/MaarchCourrier/custom/cs_carrieres/modules/notifications/batch/scripts$ ./sendmail.sh +``` + +Puis vérifier la log : + +```shell +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/modules/notifications/batch$ ls -ltr +total 136 +drwxrwx--- 6 maarch www-data 4096 mai 27 15:53 logs +``` + +``` +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/modules/notifications/batch/logs/process_email_stack$ ls -ltr +total 4 +-rw-r--r-- 1 maarch www-data 484 août 6 10:56 2019-08-06_10-55-26.log +``` + +``` +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/modules/notifications/batch/logs/process_email_stack$ tail -f 2019-08-06_10-55-26.log +[2019-08-06 10:55:26] INFO 0 'Load xml config file:/var/www/html/MaarchCourrier/custom/cs_carrieres/modules/notifications/batch/config/config.xml' +[2019-08-06 10:55:26] INFO 0 'Load xml config file:/var/www/html/MaarchCourrier/custom/cs_carrieres/modules/notifications/batch/config/config.xml' +[2019-08-06 10:55:26] INFO 0 'An instance of the batch is already in progress. Waiting for the second try..' +[2019-08-06 10:56:26] INFO 109 'An instance of the batch is already in progress' +``` + +Le message 'An instance of the batch is already in progress' peut signifier qu'il y a des fichiers .lck qui bloquent l'execution du script : + +``` +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/modules/notifications/batch$ ls -ltr +total 136 +drwxrwx--- 6 maarch www-data 4096 mai 27 15:53 logs +-rw-r--r-- 1 maarch www-data 1 mai 28 10:15 process_event_stack_error.lck +-rw-r--r-- 1 maarch www-data 1 mai 28 10:30 process_email_stack.lck +``` + +Supprimer les .lck puis relancer le script + +``` +maarch@MaarchIntegration1810:/var/www/html/MaarchCourrier/modules/notifications/batch$ rm *.lck +``` +