semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Email Alerts doesn't work

Open MoonApache opened this issue 2 years ago • 9 comments
trafficstars

Hey, I'm trying to setup email alerts, tried various ports and nothing works for me. Currently I'm on last version (v2.8.90). For email host I'm using Microsoft Exchange. I don't have any logs too , seems like it doesn't try to connect either. How can I fix this issue

MoonApache avatar Jul 24 '23 08:07 MoonApache

Seems like Semaphore should log any errors while sending mail-alerts. Example: services/tasks/alert.go#L67

Please provide any errors that are logged. If none appear - it might be a configuration error.

ansibleguy avatar Jul 25 '23 18:07 ansibleguy

here is my conf file { "mysql": { "host": "127.0.0.1:3306", "user": "semaphore", "pass": "", "name": "semaphore", "options": null }, "bolt": { "host": "", "user": "", "pass": "", "name": "", "options": null }, "postgres": { "host": "", "user": "", "pass": "", "name": "", "options": null }, "dialect": "mysql", "port": "", "interface": "", "tmp_path": "/tmp/semaphore", "cookie_hash": "", "cookie_encryption": "", "access_key_encryption": "", "email_sender": "some_sender", "email_host": "some_ip", "email_port": "587", "email_username": "", "email_password": "", "web_host": "some_host", "ldap_binddn": "", "ldap_bindpassword": "", "ldap_server": ":389", "ldap_searchdn": "", "ldap_searchfilter":"*", "ldap_mappings": { "dn": "distinguishedName", "mail": "userPrincipalName", "uid": "sAMAccountName", "cn": "cn" }, "telegram_chat": "", "telegram_token": "", "slack_url": "", "max_parallel_tasks": 10, "email_alert": true, "email_secure": false, "telegram_alert": false, "slack_alert": false, "ldap_enable": true, "ldap_needtls": false, "ssh_config_path": "", "demo_mode": false, "use_external_git": false }

MoonApache avatar Jul 26 '23 07:07 MoonApache

Hi, i've the same problem my config.json smtp part :

version : 2.8.89

"email_sender": "[email protected]",
"email_host": "smtp.xx.xx",
"email_port": "587",
"email_username": "[email protected]",
"email_password": "MYPASSWORD",
[...]
"email_alert": true,
"email_secure": true,

in logs i don't have any smtp error same as @MoonApache

@MoonApache did you solved this issue ?

anyone can help ?

Kélian

ksourdrille avatar Aug 08 '23 08:08 ksourdrille

Nope ,still waiting

MoonApache avatar Aug 08 '23 09:08 MoonApache

Hi everyone,

Anyone can help about this issue ?

Kélian

ksourdrille avatar Aug 25 '23 14:08 ksourdrille

Hi @MoonApache, i've tried the pre-release v2.8.91, and mail notifications works fine when a task failed, so we have to wait a release.

ksourdrille avatar Aug 29 '23 13:08 ksourdrille

At least now we know)

MoonApache avatar Aug 29 '23 16:08 MoonApache

I am seeing this issue as well with version v2.9.39-beta.

On my side, I am using the following email configuration

        "email_alert": true,
        "email_sender": "[email protected]",
        "email_host": "localhost",
        "email_port": "25",
        "email_username": "",
        "email_password": "",
        "email_secure": false,

Nothing ever hits the maillog. I changed it to a random port that was unused and setup netcat on that port to see if semaphore was even trying to send an email and I saw no activity at all when I ran my task. This test was ran with a task that failed and another that succeeded. I don't know what is going on exactly but it seems as though semaphore is not attempting to send emails at all regardless of configuration which is why there is no logging of it.

Edit: Checked and my user does have an email address associated with it, so between that and the configuration having email setup, I would expect it to at least try to send them out. Maybe a flag is missing in the configuration?

User Setttings

miversen33 avatar Dec 07 '23 14:12 miversen33

Same here

sla-te avatar Feb 14 '24 22:02 sla-te

After merging My PR https://github.com/ansible-semaphore/semaphore/pull/1788 have been merged which fixes this issue. the mail notification is working fine if the config.json includes all mentioned options and after enabling alerts for your user.

tboerger avatar Mar 04 '24 09:03 tboerger

same issue :

image

masterwishx avatar Jul 12 '24 20:07 masterwishx