Profile: Nathan

Statistics
Avatar
  • 4

Thank you

Thursday, September 12, 2019 12:00 PM

My IT department has informed me that the SMTP server is configured not to use authentication. I have cleared the user and password, but cannot get the system to send email - on windows or linux.

Is it possible to send email without providing an user / password to Mailkit?

The error message received is:
The SMTP server does not support authentication.

The stack trace:
at MailKit.Net.Smtp.SmtpClient.ProcessMailFromResponse(MimeMessage message, MailboxAddress mailbox, SmtpResponse response)
  at MailKit.Net.Smtp.SmtpClient.MailFromAsync(FormatOptions options, MimeMessage message, MailboxAddress mailbox, SmtpExtension extensions, Boolean doAsync, CancellationToken cancellationToken)
  at MailKit.Net.Smtp.SmtpClient.SendAsync(FormatOptions options, MimeMessage message, MailboxAddress sender, IList`1 recipients, Boolean doAsync, CancellationToken cancellationToken, ITransferProgress progress)
  at MailKit.Net.Smtp.SmtpClient.Send(FormatOptions options, MimeMessage message, CancellationToken cancellationToken, ITransferProgress progress)
  at MailKit.MailTransport.Send(MimeMessage message, CancellationToken cancellationToken, ITransferProgress progress)
  at Grand.Services.Messages.EmailSender.SendEmail(EmailAccount emailAccount, String subject, String body, String fromAddress, String fromName, String toAddress, String toName, String replyToAddress, String replyToName, IEnumerable`1 bccAddresses, IEnumerable`1 ccAddresses, String attachmentFilePath, String attachmentFileName, IEnumerable`1 attachedDownloads) in C:\dev-git\BICGraphic\Grand.Services\Messages\EmailSender.cs:line 153
  at Grand.Web.Areas.Admin.Services.EmailAccountViewModelService.SendTestEmail(EmailAccount emailAccount, EmailAccountModel model) in C:\dev-git\BICGraphic\Grand.Web\Areas\Admin\Services\EmailAccountViewModelService.cs:line 50
  at Grand.Web.Areas.Admin.Controllers.EmailAccountController.SendTestEmail(EmailAccountModel model) in C:\dev-git\BICGraphic\Grand.Web\Areas\Admin\Controllers\EmailAccountController.cs:line 154

Wednesday, September 11, 2019 6:15 PM

My colleague informed me that the password I was sending in the request body first needed to be base-64 encoded using the utility found here: http://www.utilities-online.info/base64/#.XJvaoJhKiUl

After encoding my password, the request is now working as expected.

Thursday, March 28, 2019 11:39 AM

I've followed the documentation for generating a token, but am not able to get the password to validate.

I have verified that the user configured in Manage api users matches an active user account, and that the password matches the params posted to the api. I am able to step through the code, and see the apiuser record is retrieved via the email address.

However, on line 29 of the LoginValidator, the encrypted values do not match, resulting in a 400 response with the error "User not exists or password is wrong":

Grand.Web.Areas.Api.Validators.Common.LoginValidator line #29:
userapi.Password = "WVv3K2+inlyXrlVaJ6ML39iBqXfjNN/k"
encryptionService.EncryptText(password, userapi.PrivateKey) = "43OCLnIRcilrHsOHpOn4nw=="

I'm using Grand Node Version 4.4

appsettings:
"Api": {
    "Enabled": true,
    "SecretKey": "################",
    "ValidateIssuer": false,
    "ValidIssuer": "",
    "ValidateAudience": false,
    "ValidAudience": "",
    "ValidateLifetime": true,
    "ValidateIssuerSigningKey": true,
    "ExpiryInMinutes": 1440,
    //generate system model
    "SystemModel":  true
  }


response:
{
    "errors": {
        "": [
            "User not exists or password is wrong"
        ]
    },
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "0HLLIML0JQ9OH:00000008"
}

Wednesday, March 27, 2019 1:39 PM