Base solution for your next web application
Open Closed

SMTP Password error #5619


User avatar
0
joe704la created

Something that has happened to me now a few times is the credentials for my SMTP settings seems to become wrong. I am the only person that has access to the Settings and I know I haven't changed them each time this has happened to us. I have 2 factor auth enabled and it fails when it tries to send the code to the user. I then see the below error. As soon as I renter the password in the SMTP settings all is good and it is fixed. But does anyone have any ideas why this would keep happening? It is acting like it doesn't decrypt the password before sending it or something like that.

MailKit.Net.Smtp.SmtpCommandException: 5.7.1 Invalid credentials for relay . The IP address you've 5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of 5.7.1 the account this email is being sent from. If you are trying to relay 5.7.1 mail from a domain that isn't registered under your G Suite account 5.7.1 or has empty envelope-from, you must configure your mail server 5.7.1 either to use SMTP AUTH to identify the sending domain or to present 5.7.1 one of your domain names in the HELO or EHLO command. For more 5.7.1 information, please visit


8 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @joe704la could you share the full error message ?

  • User Avatar
    0
    joe704la created

    @ismcagdas here is the entire error.

    ERROR 2018-09-20 06:05:00,027 [29   ] Mvc.ExceptionHandling.AbpExceptionFilter - 5.7.1 Invalid credentials for relay . The IP address you've
    5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of
    5.7.1 the account this email is being sent from. If you are trying to relay
    5.7.1 mail from a domain that isn't registered under your G Suite account
    5.7.1 or has empty envelope-from, you must configure your mail server
    5.7.1 either to use SMTP AUTH to identify the sending domain or to present
    5.7.1 one of your domain names in the HELO or EHLO command. For more
    5.7.1 information, please visit
    5.7.1  https://support.google.com/a/answer/6140680#invalidcred v69-v6sm3914401qkg.1 - gsmtp
    MailKit.Net.Smtp.SmtpCommandException: 5.7.1 Invalid credentials for relay . The IP address you've
    5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of
    5.7.1 the account this email is being sent from. If you are trying to relay
    5.7.1 mail from a domain that isn't registered under your G Suite account
    5.7.1 or has empty envelope-from, you must configure your mail server
    5.7.1 either to use SMTP AUTH to identify the sending domain or to present
    5.7.1 one of your domain names in the HELO or EHLO command. For more
    5.7.1 information, please visit
    5.7.1  https://support.google.com/a/answer/6140680#invalidcred v69-v6sm3914401qkg.1 - gsmtp
       at MailKit.Net.Smtp.SmtpClient.OnSenderNotAccepted(MimeMessage message, MailboxAddress mailbox, SmtpResponse response)
       at MailKit.Net.Smtp.SmtpClient.FlushCommandQueueAsync(MimeMessage message, MailboxAddress sender, IList`1 recipients, 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.SendAsync(FormatOptions options, MimeMessage message, MailboxAddress sender, IList`1 recipients, Boolean doAsync, CancellationToken cancellationToken, ITransferProgress progress)
       at Abp.MailKit.MailKitEmailSender.SendEmailAsync(MailMessage mail)
       at Abp.Net.Mail.EmailSenderBase.SendAsync(MailMessage mail, Boolean normalize)
       at Authorization.Users.UserEmailer.ReplaceBodyAndSend(String emailAddress, String subject, StringBuilder emailTemplate, StringBuilder mailMessage) in Authorization.Users.UserEmailer.SendEmailActivationLinkAsync(User user, String link, String plainPassword) in Core\Authorization\Users\UserEmailer.cs:line 125
       at Abp.Threading.InternalAsyncHelper.AwaitTaskWithPostActionAndFinally(Task actualReturnValue, Func`1 postAction, Action`1 finalAction)
       at Authorization.Accounts.AccountAppService.SendEmailActivationLink(SendEmailActivationLinkInput input) in Application\Authorization\Accounts\AccountAppService.cs:line 116
       at lambda_method(Closure , Object )
       at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
       at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
       at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
    
  • User Avatar
    0
    alper created
    Support Team

    google says;

    The IP address you registered in the G Suite SMTP relay service setting doesn’t match domain of the account this email is being sent from. If you are trying to relay mail from a domain that isn’t registered in your Googles Apps account, you must configure your mail server either to use SMTP AUTH to identify the sending domain or to present one of your domain names in the HELO or EHLO command. See SMTP Relay service setting for more information.

    https://support.google.com/a/answer/6140680?hl=en

  • User Avatar
    0
    joe704la created

    @alper I know that is what it says. But as soon as I renter the password into our sites settings all is good even without doing anything at all to G Suite. That would make me believe it has something to do with something is messing up the password and its sending the wrong password so it can't authenticate. If it had something to do with the IP address I would think it would completely fail until I went into G Suite admin settings and fix it.

  • User Avatar
    0
    ismcagdas created
    Support Team
  • User Avatar
    1
    alper created
    Support Team

    use this basic application to test your settings to see if it works or not. http://www.alexnolan.net/software/SMTPProber.htm

    run it on the same computer that your website in.

  • User Avatar
    0
    joe704la created

    @ismcagdas I did change the DefaultPassPhrase yes. I figured that if I was the only one that knew that default passphrase it would be more secure. Why would it mess things up?

  • User Avatar
    0
    ryancyq created
    Support Team

    @joe704la the DefaultPassPhrase in SimpleStringCipher does not get overriden by AppConsts.DefaultPassPhrase.

    It is using the defalut passphase if customer passphrase is not passed in when calling the method. See SimpleStringCipher

    You can use the workaround here first.