# Not getting email notice from MAIL\_ADDRESS

**URL:** <https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593>\
**Category:** Cylc Support\
**Created:** [February 6, 2023, 3:13pm UTC](https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593 "2023-02-06T15:13:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![schaferk](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/schaferk/32/92_2.png) [@schaferk](https://cylc.discourse.group/u/schaferk)\
**Post date:** [February 6, 2023, 3:13pm UTC](https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593/1 "2023-02-06T15:13:57Z")

</div>

- The Cylc version 7.8.8.

attempting to notify in case of ‘failed’ using

[cylc]

```
[[environment]]
  MAIL_ADDRESS=OtherUser1,OtherUser2

[[events]]
  mail events = failed

```

$USER gets a notice of with:  
**Subject:**!!cylc alert!! suite cylc-test failed

the folks on MAIL\_ADDRESS do not.

folks on MAIL\_ADDRESS do receive email from command line with:

echo test-00 | mail -s test-00 OtherUser1

is this method viable?

---

<div class="post-metadata">

**Author:** ![oliver.sanders](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/oliver.sanders/32/110_2.png) [@oliver.sanders](https://cylc.discourse.group/u/oliver.sanders)\
**Post date:** [February 6, 2023, 4:35pm UTC](https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593/2 "2023-02-06T16:35:34Z")

</div>

Cylc supports configuring email addresses with the “mail to” configurations:

- For workflow events - [15.1. Suite.rc Reference — The Cylc Suite Engine 7.9.3 documentation](https://cylc.github.io/cylc-doc/7.9.3/html/appendices/suiterc-config-ref.html#cylc-events-mail-to)
- For task events - [15.1. Suite.rc Reference — The Cylc Suite Engine 7.9.3 documentation](https://cylc.github.io/cylc-doc/7.9.3/html/appendices/suiterc-config-ref.html#runtime-name-events-mail-to)

```auto
[cylc]
    [[events]]
         mail to = me, OtherUser1, OtherUser2
[runtime]
    [[root]]
        [[[events]]]
             mail to = me, OtherUser1, OtherUser2

```

However, Cylc does not support configuring email addresses via the `MAIL_ADDRESS` environment variable.

I think you might be looking at this example in the docs:

[https://cylc.github.io/cylc-doc/7.9.3/html/appendices/command-ref.html?highlight=mail\_address#email-task](https://cylc.github.io/cylc-doc/7.9.3/html/appendices/command-ref.html?highlight=mail_address#email-task)

The trick which makes this example work is the configuring of a custom event handler script which looks at that environment variable:

`failed handler = cylc email-task`

---

<div class="post-metadata">

**Author:** ![schaferk](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/schaferk/32/92_2.png) [@schaferk](https://cylc.discourse.group/u/schaferk)\
**Post date:** [February 6, 2023, 11:32pm UTC](https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593/3 "2023-02-06T23:32:05Z")

</div>

i successfully used the ‘trick’ mentioned above, even though it seems to be obsolete.

however i could not get ‘mail to’ method to work.

---

<div class="post-metadata">

**Author:** ![dpmatthews](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/dpmatthews/32/26_2.png) [@dpmatthews](https://cylc.discourse.group/u/dpmatthews)\
**Post date:** [February 7, 2023, 7:53am UTC](https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593/4 "2023-02-07T07:53:56Z")

</div>

You can try running your workflow using the `--debug` option to see what’s happening.  
For example. if I run this workflow:

```auto
[scheduling]
    [[dependencies]]
        graph = root
[runtime]
    [[test]]
        script = "true"
        [[[events]]]
            mail events = succeeded
            mail to = user1, user2

```

then I can see an entry like this in `log/suite/log`:

```auto
DEBUG - ['mail', '-s', '[1/test/01 succeeded] test-email', '-r', 'notifications@host', 'user1, user2']

```

---

<div class="post-metadata">

**Author:** ![schaferk](https://yyz2.discourse-cdn.com/free1/user_avatar/cylc.discourse.group/schaferk/32/92_2.png) [@schaferk](https://cylc.discourse.group/u/schaferk)\
**Post date:** [February 16, 2023, 6:48pm UTC](https://cylc.discourse.group/t/not-getting-email-notice-from-mail-address/593/5 "2023-02-16T18:48:30Z")

</div>

thank you dp.  
it worked…
