Setting up email via web-interface not working SOLVED


#3

SMTPS, huh? That’s a new one on me - glad I read your post!

When you say you’re trying to do “it” inside the web interface, do you mean a test email maybe from the Commandline page or do you mean email notifications for any backup?

As powerful as it is, I sometimes find the Commandline UI a bit difficult to use so you might want to try setting up a small test backup and see if the notifications work as expected as part of the backup. Plus, a mini test backup gives you the opportunity to try running it on the command line with the Export option.


#4

If you use this link, you can run the send-mail command from within the server: https://localhost:8200/ngax/index.html#commandline

You can see an example of the command here:


#6

I’ve had to break my posts up due to the new user limitation of 3 links :frowning:

I’m trying to come to grips with this unique forum’s features. Apologies if i mess it up :slight_smile: I’ve listened to the robot, but that only goes so far. It’s really quite a superb piece of software - what is it? Back to it…

Thanks for moving my post.

I looked for the usual “code” box icon but couldn’t find it. I’ll try to remember the “~~~” (i used these a lot back in the Amiga days :slight_smile:

I ran the commands via the terminal (Linux), with successful results. At the time, i didn’t realise they were restructures of the same thing as i found them in different places. I did them some time apart in trying to troubleshoot :blush:

mono Duplicati.CommandLine.exe send-mail --send-mail-to=TO...@example.com --send-mail-username=FROM...@example.com --send-mail-password=GoogleAppPassword --send-mail-url=smtps://smtp.gmail.com --log-level=profiling --verbose

and

mono Duplicati.CommandLine.exe send-mail --verbose --log-level=profiling --send-mail-to=youraddress@gmail.com --send-mail-from=youraddress@gmail.com --send-mail-url=smtps://smtp.gmail.com:465 --send-mail-username=youraddress@gmail.com --send-mail-password=yourpassword

Using these arguments within the web interface do not get me an email:
–send-mail-level=all
--send-mail-from=fromaddress@gmail.com
--send-mail-username=fromaddress@gmail.com
–send-mail-password=MyGoogleAppPassword
–send-mail-url=smtps://smtp.gmail.com:465
–send-mail-subject=Duplicati %OPERATIONNAME%
–send-mailbody=%backup-name%
--send-mail-to=toaddress@gmail.com


#7

Thanks. Armed with that information, i tried this using the diagnostic parameters i ran manually via terminal, i.e. send-mail
–verbose
–log-level=profiling
--send-mail-to=youraddress@gmail.com
--send-mail-from=youraddress@gmail.com
–send-mail-url=smtps://smtp.gmail.com:465
--send-mail-username=youraddress@gmail.com
–send-mail-password=yourpassword

It ran and got an exception (although return code 0 which seems odd). – see next post for full error via PasteBin link.

Failed to send email: System.IO.IOException: The authentication or decryption has failed.
--> System.IO.IOException: The authentication or decryption has failed.
--> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server.
 => The authentication or decryption has failed.

This is very interesting, because it’s the error (or very similar) to what i got when my terminal-ran tests didn’t work - before i updated Mono. After i updated Mono, the terminal-ran tests worked (note i did NOT update the certificates - yet it still worked).

So i suppose i’m at the point where i need to update those certificates mentioned in the output. However, this is an area i simply don’t understand (lol - i didn’t understand ANY of this until i just dug in and got busy - i’m not an advanced user). Where are these certificates from? Duplicati? Gmail? Mono Project? I’m happy to update them but i do not know what i’m updating, or from where.

Also, why via the web interface are the certificates an issue - but not via terminal command?

Sorry for the massive post. I hope it’s comprehensive enough :wink:


#8

Full error:
https://pastebin.com/6addujfv

Sorry, as mentioned in the first of 3 posts, i had to split up my posts due to limit of 3 links for noobs.


#9

I’m seeing this in the error:

Failed to send email: System.IO.IOException: The authentication or decryption has failed.
–> System.IO.IOException: The authentication or decryption has failed.
–> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server.

Combined with you running as a service has me wondering if you’re experiencing some Linux flavor of the TLS error mentioned here.

Oh, and I’m not finding it now (and it may not apply) but there are known issues with mono not including “standard” certificate information by default. If you think that might be the case, let me know and I’ll try looking again.


#10

it’s discourse:

It’s the </> button in the editor.

Not a problem, but it looks like you didn’t need any links at all. The problem was that the email-addresses in the configuration you posted were turned into links. That can be avoided by using the code fences (~~~)


#11

Hello

I might have som informtion regarding the error:

Failed to send email: System.IO.IOException: The authentication or decryption has failed.
–> System.IO.IOException: The authentication or decryption has failed.
–> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server.

I have been using the accept-specified-ssl-hash setting.
Now, from this version Duplicati - 2.0.2.4_canary_2017-09-09 and a couple of canary versions back, the web interface messes up the settings. It seems it is swapping around the values in

Web interface accept-specified-ssl-hash shows value from --send-mail-to
Web interface send-mail-to shows value from --send-mail-from
Web interface --send-mail-from shows the value from --accept-specified-ssl-hash

If the software interprets the values like that, then it is no wonder it concludes “Invalid certificate received from server.”

HC


#12

Is it this problem you are seeing:


#13

Hi
I have not set any --excludes via the option page, so at least the solution does not seem to apply.
I did set one exclude expression via the Sources page though…
If I remove this exclude expression, no change webinterface still "messed up"
If I also remove excludes Hidden System and Temporary files, no change webinterface still “messed up”
(I did save and reopen the backup between each of the tests.)

HC


#14

I should perhaps add my textual Advanced settings

--send-mail-to=xxxx2@xxxxxx.dk
--send-mail-from=xxxx1@xxxxxx.dk
--send-mail-password=xxXXXyyyXYYXY
--send-mail-username=xxxHHJADSAKLJ
--send-mail-url=smtp://mail.hobsoft.net:587/?starttls=always
--send-mail-any-operation=True
--accept-specified-ssl-hash=877751A2C6F522D0F79F73999E3530073AD38ABE
--amzcd-consistency-delay=30s
--retry-delay=30s
--aes-set-threadlevel=4
--auto-cleanup=true
--tempdir=/volume1/duplicati/tmp
--asynchronous-upload-folder=/volume1/duplicati/upload

And add that this is running on a Synology box

HC


#15

Hi guys, just checking in to see if there’s anything i can do to help troubleshooting. TBH, i didn’t understand JonMikeIVs link :slight_smile: I think it’s beyond my wee brain.

I haven’t updated the certificates - should I? And i have re-checked running the Terminal mono command to send the email and it still works.

Thanks :sunny:


#16

Yes, and is there anything I could do to help troubleshooting? :slight_smile:

HC


#17

@Derek, I am successfully using gmail to send me email notifications.

I used the following --send-mail-url: “smtp://smtp.gmail.com:587/?starttls=when-available” (without the quotes)

Update at 07:10PDT 9/19/2017.

Adding my complete email configuration with sensitive data scrubbed out:

> --send-mail-any-operation="true" 
> --send-mail-password="my gmail password" 
> --send-mail-subject="Duplicati %PARSEDRESULT%, %OPERATIONNAME% report for %backup-name%" 
> --send-mail-to="destination@foobar.com" 
> --send-mail-url="smtp://smtp.gmail.com:587/?starttls=when-available" 
> --send-mail-username="my-gmail-acct@gmail.com" 
> --send-mail-from="<hostname> backup <my-gmail-acct@gmail.com>"

I changed the format of the sender (“send-mail-from”) and subject to be something I liked a bit better. <hostname> in the “–send-mail-from” section is the name of the host the backup was run on. Please note that this is not a keyword that is filled in automatically – I manually type out my hostname into that filed.

Hope this helps!

Marc


#18

Now running Duplicati - 2.0.2.7_canary_2017-09-19

From the first looks of it the problem with showing wrong data in the web interface has been fixed.

As always, thank you. Duplicati is the nicest backup out there :slight_smile:

Doing backup to check the e-mail functionality…

HCJE


#19

Hmm, no the parameters are still messed up…
amzcd-consistency-delay often gets messed up and becomes custom even if set to 30 seconds
send-mail-from seems to be messed up with amzcd-consistency-delay and send-mail-to
Something doesnt work in translation from Graphical inteface to text interrface and back…

Let me know how I can supply further information…

Could I try some command line stuff to get more info?

HC


#20

Hi all,

I’ve done some tests and Marc_Aronson’s solution (post 16) seems to work. Tip - remove all the quotes and heed his advice re the , i.e. it doesn’t autofill :blush:

Very interestingly, it also worked when i used his settings, but changed:
–send-mail-url=smtp://smtp.gmail.com:587/?starttls=when-available
to:
–send-mail-url=smtps://smtp.gmail.com:465

Confused! :confused:

Which of the two above is “better” and what exactly in my original settings were failing?

On a separate note, i tried using my ISP as the source of the email, and it works with SMTP, but not SMTPS - is this normal for ISP SMTP? Is either of SMTPS or the starttls (gmail) when available are better options than simply SMTP (ISP)?

At this point should i mark the thread as solved (with Marc’s post)? There’s still the question of “wtf”, but it does appear to work. Perhaps i can leave it a few days?


#21

Very interestingly, it also worked when i used his settings, but changed:
–send-mail-url=smtp://smtp.gmail.com:587/?starttls=when-available
to:
–send-mail-url=smtps://smtp.gmail.com:465

Confused! :confused:

@Derek Here’s an extract from this Google support page:

Port 465 (SSL required)
Port 587 (TLS required)

This means that you can use port 465 with SSL encryption and port 587 for TLS encryption. I believe that the “smtps://…” prefix forces SSL, which is why it works with port 465.

Both SSL and TLS are methods for encrypting the communication for security.

I believe that TLS is considered more secure than SSL, so if both work, I suggest using TLS (port 587) using the format I provided in my previous post (“smtp://smtp.gmail.com:587/?starttls=when-available”).

Hope this helps to clear up the confusion!

Marc


Common provider email setting suggestions
#22

Thanks Marc, very helpful background.

I still don’t know what was wrong with my original syntax :slight_smile: Something other than that i suppose :man_shrugging:


#23

If anybody wants to chime in, I’ve started a discussion about potentially adding “common provider” suggested defaults to the UX.