# How do I send notification emails to localhost

**URL:** <https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537>\
**Category:** Support\
**Created:** [December 13, 2024, 8:47am UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537 "2024-12-13T08:47:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![barsch](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/barsch/32/1319_2.png) [@barsch](https://kopia.discourse.group/u/barsch)\
**Post date:** [December 13, 2024, 8:47am UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/1 "2024-12-13T08:47:16Z")

</div>

I want to send notification emails to a local email server. The following test failed:

```auto
barsch@machine ~ $ kopia notification profile configure email \
    --profile-name=email \
    --smtp-server=127.0.0.1 \
    --smtp-port=25 \
    --mail-from=noreply@xxx.yy \
    --mail-to=admin@xxx.yy \
    --format=txt \
    --send-test-notification
Sending test notification to SMTP server: "127.0.0.1", Mail from: "noreply@xxx.yy" Mail to: "admin@xxx.yy" Format: "txt"
ERROR unable to send test notification: unable to send notification message: tls: failed to verify certificate: x509: cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs

```

Sending emails per shell is working, e.g.

```auto
barsch@machine ~ $ echo "This is a test." | mail -s "Test" barsch@xxx.yy

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kapitainsky/32/535_2.png) [@kapitainsky](https://kopia.discourse.group/u/kapitainsky)\
**Post date:** [December 13, 2024, 8:58pm UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/2 "2024-12-13T20:58:39Z")

</div>

> [@barsch](#):
>
> `cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs`

This is not really kopia issues but your SMTP certificate problem. Looks like kopia does it right and requires server to be configured properly.

To validate the certificate successfully the IP must be given inside the subject alternative names section.

When you create your certs:

1. Edit your `/etc/ssl/openssl.cnf` - add `subjectAltName = IP:127.0.0.1` in `[v3_ca]` section.
2. Recreate the certificate

You will also find tones of sources on google how to create proper certs.

---

<div class="post-metadata">

**Author:** ![barsch](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/barsch/32/1319_2.png) [@barsch](https://kopia.discourse.group/u/barsch)\
**Post date:** [December 14, 2024, 12:41am UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/3 "2024-12-14T00:41:47Z")

</div>

no - port 25 above means I want to connect via plain unencrypted SMTP service (configured as send only to smarthost) which does not require a certificate - one can test this with a simple telnet client, e.g.:

```auto
barsch@machine ~ $ telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 machine ESMTP Exim 4.96 Sat, 14 Dec 2024 00:30:00 +0000
EHLO xxx.yy
250-machine Hello localhost [127.0.0.1]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-PIPECONNECT
250-CHUNKING
250-STARTTLS
250-PRDR
250 HELP
MAIL FROM:noreply@xxx.yy
250 OK
RCPT TO:admin@xxx.yy
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
Subject: Test

This is a test.

.
250 OK id=1tMG3n-0020gr-2R
QUIT
221 machine closing connection
Connection closed by foreign host.
barsch@machine ~ $

```

So it seems Kopia does not to support unencrypted SMTP, or?

---

<div class="post-metadata">

**Author:** ![topkat](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@topkat](https://kopia.discourse.group/u/topkat)\
**Post date:** [January 7, 2025, 7:00am UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/4 "2025-01-07T07:00:13Z")

</div>

Unfortunately I am also realizing that Kopia notification email authentication is limited and only supports SSL, and has no other options.  
In my case I got this error when sending to port 587 (which requires SMTP authentication username and password)

_ERROR unable to send notification message: tls: failed to verify certificate: x509: certificate signed by unknown authority_

Just when I discover that Kopia now has email notifications I get disappointed that I cant use it since we have an internal LAN mail server that use SSL for internal communications ☹

---

<div class="post-metadata">

**Author:** ![ToXinE](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/toxine/32/1232_2.png) [@ToXinE](https://kopia.discourse.group/u/ToXinE)\
**Post date:** [January 24, 2025, 9:28am UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/5 "2025-01-24T09:28:57Z")

</div>

Hey same problem here! I’m using Mailrise [GitHub - YoRyan/mailrise: An SMTP gateway for Apprise notifications.](https://github.com/YoRyan/mailrise) on top of apprise to be able to send notifications with SMTP (unauthentified) but i can’t since i got this error :  
Error sending notification: unable to send notification: unable to send notification message: unencrypted connection

---

<div class="post-metadata">

**Author:** ![opstech](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/opstech/32/1343_2.png) [@opstech](https://kopia.discourse.group/u/opstech)\
**Post date:** [January 26, 2025, 7:22pm UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/6 "2025-01-26T19:22:10Z")

</div>

Same situation. send email with internal smtp server on port 25 with no security give error.

I have made a python script that expose webhook api, takes the message via post/get and in script can configure the SMTP server externally as a relay. A raw fix …waiting kopia decide to accept insecure connections in notifications

it’s a beta code but soon I could publish it or attach it here if possible

---

<div class="post-metadata">

**Author:** ![ToXinE](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/toxine/32/1232_2.png) [@ToXinE](https://kopia.discourse.group/u/ToXinE)\
**Post date:** [February 3, 2025, 1:35pm UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/7 "2025-02-03T13:35:10Z")

</div>

any news on this issue ?

---

<div class="post-metadata">

**Author:** ![rcjj35ic](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@rcjj35ic](https://kopia.discourse.group/u/rcjj35ic)\
**Post date:** [May 24, 2025, 5:37pm UTC](https://kopia.discourse.group/t/how-do-i-send-notification-emails-to-localhost/3537/8 "2025-05-24T17:37:32Z")

</div>

any news on this issue ?
