Skip to content
Snippets Groups Projects
send_mail.md 2.37 KiB
Newer Older
  • Learn to ignore specific revisions
  • ines mkacher's avatar
    ines mkacher committed
    # Envoi de mails
    
    ines mkacher's avatar
    ines mkacher committed
    
    ## Vérifications
    
    
    
    ines mkacher's avatar
    ines mkacher committed
    ```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
    ```