restic-windows-backup icon indicating copy to clipboard operation
restic-windows-backup copied to clipboard

Send email without authentication

Open maxxer opened this issue 3 years ago • 8 comments
trafficstars

I'm using a local SMTP which has granted Windows server delivery without auth, but I'm unable to set up the script to work with it. I initially commented out $ResticEmailUsername and $ResticEmailPassword but it complained, so I set them to an empty string, but it's still not happy.

From what I can see in the sources, empty credentials are not managed. Can this be added? Thanks

P.S. side note: when or after trying to send the notification email, I get a prompt for credentials, even tough I ran restic from an Administrator shell

immagine

immagine

maxxer avatar Jul 01 '22 06:07 maxxer

Upvote for this.

I don't want to leave my email password credentials lying around in the clear where they might be found by an unauthorised person, or included in a backup.

I have an email server that is configured to accept emails from the local network without further authentication, so I should be able to use it for backup logs, but this bug means that I can't.

chrestomanci avatar Jan 14 '23 11:01 chrestomanci

I'd be happy to take a pull request to make the change. What would be the proper fix here? If you could give me instructions on how you've set up your system so I could reproduce I'd be happy to take a look.

i.e. on your systems, does Send-MailMessage work if you do not set the -Credential argument? If so, I think it'd be a pretty easy fix.

kmwoley avatar Jan 15 '23 04:01 kmwoley

I also have this configuration. I have a local/internal SMTP relay that accepts unauthenticated port 25 connections.

In my case I commented out the $password and $credentials lines (305, 306) because ConvertTo-SecureString pukes on an empty string. I also altered Send-Message to remove -Credential.

I think the simplest solution is to detect an empty "ResticEmailPassword" and skip those parts of the script.

SeeJayEmm avatar Apr 24 '23 14:04 SeeJayEmm

Let me add my 👍 for this. I have a similar problem. Would love to see the PR merged.

mrunkel avatar Feb 01 '24 10:02 mrunkel