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

Send email without authentication #66

Closed
maxxer opened this issue Jul 1, 2022 · 8 comments
Closed

Send email without authentication #66

maxxer opened this issue Jul 1, 2022 · 8 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@maxxer
Copy link

maxxer commented Jul 1, 2022

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

@chrestomanci
Copy link

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.

@kmwoley
Copy link
Owner

kmwoley commented Jan 15, 2023

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 kmwoley added enhancement New feature or request question Further information is requested labels Jan 15, 2023
@SeeJayEmm
Copy link
Contributor

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.

@mrunkel
Copy link

mrunkel commented Feb 1, 2024

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

@gudmmk
Copy link

gudmmk commented Sep 11, 2024

👍

@ilium007
Copy link

Came here looking for a solution to this. I am a Google Workspace user with Gmail Routing configure to allow smtp relay from one public IP but sadly can't use notifications from this code.

@ilium007
Copy link

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.

I can confirm Send-MailMessage works without supplying credentials from powershell command line

@ilium007
Copy link

ilium007 commented Sep 28, 2024

@SeeJayEmm has a pull request here that's cleaner than my attempt :D Tested and working.

#81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants