# Configure callback mail

**URL:** <https://forum.ansible.com/t/configure-callback-mail/36461>\
**Category:** Ansible Project\
**Created:** [March 19, 2022, 7:39am UTC](https://forum.ansible.com/t/configure-callback-mail/36461 "2022-03-19T07:39:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 19, 2022, 7:39am UTC](https://forum.ansible.com/t/configure-callback-mail/36461/1 "2022-03-19T07:39:52Z")

</div>

Hello,  
I try to understand mail callback configuration.

My ansible.cfg

```auto

[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 = mail@mail.com
to = mail@mail.com

```

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:

```auto

callback_enabled = timer,minimal,profile_tasks,community.general.mail

```

```auto
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

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [March 21, 2022, 3:34pm UTC](https://forum.ansible.com/t/configure-callback-mail/36461/2 "2022-03-21T15:34:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lee](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lee/32/4857_2.png) [@lee](https://forum.ansible.com/u/lee)\
**Post date:** [March 22, 2022, 2:30am UTC](https://forum.ansible.com/t/configure-callback-mail/36461/3 "2022-03-22T02:30:00Z")

</div>

What we usually do is install Postfix on the local machine and have  
Postfix relay to the SMTP server with username/password.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 23, 2022, 6:44am UTC](https://forum.ansible.com/t/configure-callback-mail/36461/4 "2022-03-23T06:44:26Z")

</div>

Ok, thanks, I understand now.

But my ansible project is in docker container, so I need to intergrate postix in image.

Thanks
