Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email Alerts doesn't work #1360

Closed
MoonApache opened this issue Jul 24, 2023 · 11 comments
Closed

Email Alerts doesn't work #1360

MoonApache opened this issue Jul 24, 2023 · 11 comments

Comments

@MoonApache
Copy link

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

@ansibleguy
Copy link
Contributor

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.

@MoonApache
Copy link
Author

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
}

@ksourdrille
Copy link

ksourdrille commented Aug 8, 2023

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

version : 2.8.89

"email_sender": "noreply@XXX.com",
"email_host": "smtp.xx.xx",
"email_port": "587",
"email_username": "smtp@XXX.com",
"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

@MoonApache
Copy link
Author

Nope ,still waiting

@ksourdrille
Copy link

Hi everyone,

Anyone can help about this issue ?

Kélian

@ksourdrille
Copy link

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.

@MoonApache
Copy link
Author

At least now we know)

@miversen33
Copy link

miversen33 commented Dec 7, 2023

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": "noreply@XXX.com",
        "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

@sla-te
Copy link

sla-te commented Feb 14, 2024

Same here

@tboerger
Copy link
Collaborator

tboerger commented Mar 4, 2024

After merging My PR #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 tboerger closed this as completed Mar 4, 2024
@masterwishx
Copy link

same issue :

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants