The mail callback is intended to work with a local MTA, and not intended to work with public email services that require SMTP auth. As such, you cannot supply a password. You have to be able to send mail unauthenticated with this callback.
On Mon, Mar 21, 2022 at 9:05 AM Frédéric GAUTHIER BESNARD < [email protected]> wrote: > Hello, > I try to understand mail callback configuration. > > My ansible.cfg > > ``` > [defaults] > inventory = env/inventory.ini > library = lib > callback_enabled = timer,minimal,profile_tasks,mail > interpreter_python = /usr/bin/python3 > collections_paths = . > > [callback_mail] > smtphost = mail.externalsmtp.com > smtpport = 465 > sender = [email protected] > to = [email protected] > ``` > > But, Where I put password? > I tried with password = "mypassword', in callback_mail section, but no > more works. > > I created a playbook with task that I'm sure it fails. But I don't receive > mail. > > I tried without success: > ``` > callback_enabled = timer,minimal,profile_tasks,community.general.mail > ``` > > ``` > ansible-playbook [core 2.12.2] > config file = /Users/fred/labo/dev/ansible.cfg > configured module search path = ['/Users/fred/labo/dev/lib'] > ansible python module location = > /Users/fred/labo/venv/lib/python3.9/site-packages/ansible > ansible collection location = /Users/fred/labo/dev > executable location = /Users/fred/labo/venv/bin/ansible-playbook > python version = 3.9.0 (v3.9.0:9cf6752276, Oct 5 2020, 11:29:23) [Clang > 6.0 (clang-600.0.57)] > jinja version = 2.11.2 > libyaml = False > Using /Users/fred/labo/457/ansible.cfg as config file > host_list declined parsing /Users/fred/labo/dev/env/inventory.ini as it > did not pass its verify_file() method > auto declined parsing /Users/fred/labo/dev/env/inventory.ini as it did not > pass its verify_file() method > yaml declined parsing /Users/fred/labo/dev/env/inventory.ini as it did not > pass its verify_file() method > Parsed /Users/fred/labo/dev/env/inventory.ini inventory source with ini > plugin > Skipping callback 'default', as we already have a stdout callback. > Skipping callback 'minimal', as we already have a stdout callback. > Skipping callback 'oneline', as we already have a stdout callback. > ``` > > Thanks for help > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/57b5c0a0-5c99-4503-84bc-8fdec805418fn%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/57b5c0a0-5c99-4503-84bc-8fdec805418fn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Matt Martz @sivel sivel.net -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v9uYH%3DiXJHsN0oyvba0d2uXWtDcGk6Dzs%2BqcjncZFNfpA%40mail.gmail.com.
