Brak maili wychodzących (po SMTP) z KUIP

Przy zakładaniu userów lub resecie hasła nie dochodzą żadne maile.

EZDRP wersja bieżąca 21.20.6 (B)

Serwer SMTP jest mój (działający produkcyjnie bez żadnych problemów), w logu:

Sep 17 13:33:01 poczta postfix/submission/smtpd[214453]: Anonymous TLS connection established from unknown[91.x.x.x]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
Sep 17 13:33:03 poczta postfix/submission/smtpd[214453]: warning: unknown[91.x.x.x]: SASL PLAIN authentication failed:
Sep 17 13:33:09 poczta postfix/submission/smtpd[214453]: warning: unknown[91.x.x.x]: SASL LOGIN authentication failed: VXNlcm5hbWU6
Sep 17 13:33:09 poczta postfix/submission/smtpd[214453]: lost connection after AUTH from unknown[91.x.x.x]

Tymi samymi credentialami co w EZDRP loguję się dowolnym innym klientem - tu jest błąd.

Na poprzedniej wersji EZDRP (20.x.x) te same dane logowania, to samo konto działało zawsze poprawnie.

Wyciągnąłem logi z poda mail:

{
    "@t": "2025-09-17T11:53:36.2965462Z",
    "@mt": "Exception thrown by subscription callback, receivedInfo={receivedInfo}, properties={properties}, message={message}",
    "@l": "Error",
    "@x": "MailKit.Security.AuthenticationException: 535: 5.7.8 Error: authentication failed: VXNlcm5hbWU6
    ---> MailKit.Net.Smtp.SmtpCommandException: 5.7.8 Error: authentication failed: VXNlcm5hbWU6
    --- End of inner exception stack trace ---
    at MailKit.Net.Smtp.SmtpClient.AuthenticateAsync(Encoding encoding, ICredentials credentials, CancellationToken cancellationToken)
    at ICE.AppCommon.Mail.MailKitSmtpClient.SendAsync(SmtpMessage smtpMessage, Stream messageOutputStream, Boolean quit, RemoteCertificateValidationCallback remoteCertificateValidationCallback, CancellationToken cancellationToken)
    at EZDRP.Mail.Gateway.Handlers.ProcessMailFromQueueHandler.SendMail(MailDto input, CancellationToken cancellationToken) in /home/rancher/work/41dbe19119ea5546/src/EZDRP.Mail.Gateway/Handlers/ProcessMailFromQueueHandler.cs:line 172
    at EZDRP.Mail.Gateway.Handlers.ProcessMailFromQueueHandler.SendMail(MailDto input, CancellationToken cancellationToken) in /home/rancher/work/41dbe19119ea5546/src/EZDRP.Mail.Gateway/Handlers/ProcessMailFromQueueHandler.cs:line 187
    at EZDRP.Mail.Gateway.Handlers.ProcessMailFromQueueHandler.<>c__DisplayClass11_0.<<InvokeAsync>b__0>d.MoveNext() in /home/rancher/work/41dbe19119ea5546/src/EZDRP.Mail.Gateway/Handlers/ProcessMailFromQueueHandler.cs:line 137
    --- End of stack trace from previous location ---
    at Polly.ResiliencePipeline.<>c.<<ExecuteAsync>b__3_0>d.MoveNext()
    --- End of stack trace from previous location ---
    at Polly.Outcome`1.GetResultOrRethrow()
    at Polly.ResiliencePipeline.ExecuteAsync(Func`2 callback, CancellationToken cancellationToken)
    at EZDRP.Mail.Gateway.Handlers.ProcessMailFromQueueHandler.InvokeAsync(MailDto input, Dictionary`2 properties) in /home/rancher/work/41dbe19119ea5546/src/EZDRP.Mail.Gateway/Handlers/ProcessMailFromQueueHandler.cs:line 132
    at ICE.AppCommon.Commands.ScopedCommandDispatcher.InvokeCommandHandle(ICommandDto command, Dictionary`2 properties, Type handlerType, ICommandHandlerBase commandHandlerBase)
    at ICE.AppCommon.Commands.Interceptors.CommandHandlerInterceptors.Handle(IContainerScope scope, ICommandDto command, Type handlerType, Func`1 next)
    at ICE.AppCommon.Commands.ScopedCommandDispatcher.Handle(ICommandDto command, Dictionary`2 properties)
    at EZDRP.Mail.App.Modules.Logger.LogExtensions.Enrich(IContainerScope scope, IAction action, Func`1 next) in /home/rancher/work/41dbe19119ea5546/src/EZDRP.Mail.App/Modules/Logger/LogExtensions.cs:line 47
    at ICE.Infrastructure.Commands.Interceptors.CommandReceiverInterceptors.Receive(IContainerScope scope, ICommandDto command, Func`1 next)
    at ICE.Infrastructure.Commands.DefaultMessageCommandReceiver.ReceiveMessage(ContextCommandMessageDto message, IMessageContext messageContext)
    at ICE.AppCommon.Messaging.Streams.MessagesStream.Receive(IMessageContext messageContext)
    at ICE.Infrastructure.Rabbitmq.RabbitmqSubscriberClient.<>c__DisplayClass11_0.<<Subscribe>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at EasyNetQ.AdvancedBusExtensions.<>c__DisplayClass14_0.<<Consume>b__0>d.MoveNext()
    --- End of stack trace from previous location ---
    at EasyNetQ.RabbitAdvancedBus.<>c__DisplayClass20_0.<<Consume>b__6>d.MoveNext()
    --- End of stack trace from previous location ---
    at EasyNetQ.Consumer.HandlerRunner.InvokeUserMessageHandlerAsync(ConsumerExecutionContext context, CancellationToken cancellationToken)",
    "receivedInfo": "[ConsumerTag=amq.ctag-TsoYqk7mT1gGYsllQwMlaw, DeliveryTag=17, Redelivered=False, Exchange=mail.internal.gateway, RoutingKey=mail.gateway.send, Queue=mail.gateway]",
    "properties": "ContentType=application/msgpack, ContentEncoding=NULL, Headers=[EasyNetQ.Confirmation.Id=System.Byte[]], DeliveryMode=2, Priority=0, CorrelationId=NULL, ReplyTo=NULL, Expiration=NULL, MessageId=NULL, Timestamp=0, Type=NULL, UserId=NULL, AppId=NULL, ClusterId=NULL",
    "message": "iKJJZNkgMjRkYjAyZWZhMzBlNDUzZjg3YWEwYzhmMGFh[.......]Xkuc2VuZA==",
    "SourceContext": "EasyNetLogger",
    "MachineName": "mail-789cdd85b7-8xst4",
    "ExceptionDetail": {
        "HResult": -2146233088,
        "Message": "535: 5.7.8 Error: authentication failed: VXNlcm5hbWU6",
        "Source": "MailKit",
        "TargetSite": "Void MoveNext()",
        "InnerException": {
            "HelpLink": "https://github.com/jstedfast/MailKit/blob/master/FAQ.md#ProtocolLog",
            "HResult": -2146233088,
            "Message": "5.7.8 Error: authentication failed: VXNlcm5hbWU6",
            "Source": null,
            "ErrorCode": "UnexpectedStatusCode",
            "Mailbox": null,
            "StatusCode": "AuthenticationInvalidCredentials",
            "Type": "MailKit.Net.Smtp.SmtpCommandException"
        },
        "Type": "MailKit.Security.AuthenticationException"
    },
    "IceHost": "Mail",
    "InstanceName": "ezdrp.naszadres.local"
}

Niestety, ale błąd “authentication failed” jest mylący, albo niedokładny bo podane dane logowania działają w każdym innym kliencie.

Jeśli zmieniane były ustawienia ezdrp, to trzeba albo zrobić redeploy niektórych workloadów albo najprościej zrestartować cały serwer.

Ale o jakich ustawieniach piszesz? - bo parametry do konta SMTP w trakcie instalacji podawałem i są prawidłowe - w poprzedniej wersji jak pisałem dokładnie te same działały a w nowej na nowo instalowanej rzuca błędem autentykacji.

Po zmianie ustawień SMTP Rancher sam robi restarty/redeploy podów.

Czy hasło do konta e-mail ma znaki specjalne? Jeśli tak to zmień bez tych znaków bo tu może być problem.

Dzięki, pomogło - miałem owszem w haśle ‘@’ - serio NASK?, w haśle nie można stosować znaków specjalnych ? :slight_smile:

Dzień dobry,
”Powinno mieć ono minimum osiem znaków i zawierać przynajmniej jedną wielką literę, jedną małą literę, jedną cyfrę i jeden znak specjalny (@$!%*#?).” :wink:
Nie wiedzieć czemu, czasem EZD RP ma z tym problem i trzeba zmienić.