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

Configure a Mail instance as Email notifications gateway #623

Merged
merged 5 commits into from
Apr 16, 2024

Conversation

stephdl
Copy link
Contributor

@stephdl stephdl commented Apr 12, 2024

Extend the get-smarthost action response with additional attributes.

  • The UI code can understand if the smarthost settings point to a Mail module instance by looking at manual_configuration attribute.
  • The list of installed Mail instances is returned by the new mail_server attribute.

NethServer/dev#6895

get-smarthost

[root@R4-pve ~]# api-cli run --agent cluster get-smarthost | jq
Warning: using user "cluster" credentials from the environment
{
  "port": 25,
  "host": "10.5.4.1",
  "username": "",
  "password": "",
  "enabled": true,
  "encrypt_smtp": "none",
  "tls_verify": false,
  "mail_server": [
    {
      "mail_id": "mail1",
      "mail_name": "",
      "node": "1",
      "node_name": "",
      "host": "10.5.4.1"
    }
  ],
  "manual_configuration": false
}

For example, to select mail1 and switch to manual _configuration : false pass the IP in host and set port:25.

api-cli run --agent cluster set-smarthost --data '{
  "port": 25,
  "host": "10.5.4.1",
  "username": "",
  "password": "",
  "enabled": true,
  "encrypt_smtp": "none",
  "tls_verify": false
 }'

Other parameters lead to a manual _configuration : true case. E.g.:

api-cli run --agent cluster set-smarthost --data '{
  "port": 587,
  "host": "smtp.domain.com",
  "username": "xxxxx",
  "password": "xxxxx",
  "enabled": true,
  "encrypt_smtp": "starttls",
  "tls_verify": true
 }'

github-actions bot pushed a commit that referenced this pull request Apr 12, 2024
@stephdl stephdl force-pushed the feat-6895-mail-notification branch from 02d1b09 to 20c3e6f Compare April 12, 2024 10:39
github-actions bot pushed a commit that referenced this pull request Apr 12, 2024
@stephdl stephdl force-pushed the feat-6895-mail-notification branch from 20c3e6f to 4fee229 Compare April 12, 2024 10:40
github-actions bot pushed a commit that referenced this pull request Apr 12, 2024
github-actions bot pushed a commit that referenced this pull request Apr 12, 2024
Co-authored-by: Davide Principi <[email protected]>
github-actions bot pushed a commit that referenced this pull request Apr 12, 2024
github-actions bot pushed a commit that referenced this pull request Apr 16, 2024
@DavidePrincipi DavidePrincipi changed the title Update notification with mail server configuration Configure a Mail instance as Email notifications gateway Apr 16, 2024
@DavidePrincipi DavidePrincipi merged commit 91d767b into main Apr 16, 2024
3 checks passed
@DavidePrincipi DavidePrincipi deleted the feat-6895-mail-notification branch April 16, 2024 15:13
@DavidePrincipi DavidePrincipi mentioned this pull request Apr 16, 2024
19 tasks
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

Successfully merging this pull request may close these issues.

2 participants