Mailozaurr icon indicating copy to clipboard operation
Mailozaurr copied to clipboard

Add UseDefaultCredentials

Open PrzemyslawKlys opened this issue 4 years ago • 9 comments

In SMTP mail UseDefaultCredentials can be called to skip need to provide credentials.

  • https://docs.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient.usedefaultcredentials?view=netcore-3.1

In Send-MailMessage it seems to be turned on by default if there's no login/pass prompt given or at least I think so. Would need to check sources.

  • https://github.com/EvotecIT/PSWriteHTML/issues/156

In MailKit it can be achieved it seems but requires some deep dive

  • https://stackoverflow.com/questions/38113437/is-it-possible-to-use-default-network-credentials-with-mailkit-and-exchange
  • https://github.com/jstedfast/MailKit/issues/332#issuecomment-398300208

PrzemyslawKlys avatar Oct 24 '20 07:10 PrzemyslawKlys

Is there any plan on implementing this? It would be very beneficial for situations where we need services to send emails using a local AD integrated SMTP server and don't want to store credentials.

AvrumFeldman avatar Aug 24 '22 19:08 AvrumFeldman

It is wanted & therefore planned, but I lack time to implement this. But if you have time, feel free to take a bite.

PrzemyslawKlys avatar Aug 24 '22 19:08 PrzemyslawKlys

@PrzemyslawKlys I looked through the thread from MailKit and it seems that integrated authentication isn't implemented yet even on MailKit due to not being cross compatible.

AvrumFeldman avatar Aug 26 '22 03:08 AvrumFeldman

@AvrumFeldman it probably never will be cross-compatible, but from what I see https://github.com/jstedfast/MailKit/issues/332#issuecomment-398300208 someone did do it on Windows, which would be enough.

PrzemyslawKlys avatar Aug 26 '22 06:08 PrzemyslawKlys

@PrzemyslawKlys I didn't realize you are fine with non cross compatibility. I will try to give it a shot over the next week (hopefully).

AvrumFeldman avatar Aug 26 '22 13:08 AvrumFeldman

@AvrumFeldman any luck?

PrzemyslawKlys avatar Oct 02 '22 15:10 PrzemyslawKlys

@PrzemyslawKlys what a coincident you are asking now. I've just worked this night a few hours on it and I'm (hopefully) almost done. image

AvrumFeldman avatar Oct 02 '22 17:10 AvrumFeldman

Great - we're only missing this and signing functionality. Looking forward to this!

PrzemyslawKlys avatar Oct 02 '22 17:10 PrzemyslawKlys

Implemented in:

  • https://github.com/EvotecIT/Mailozaurr/pull/47

Hopefully will work

PrzemyslawKlys avatar May 16 '24 18:05 PrzemyslawKlys