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

Email Server Setup - "Invalid addr-spec token at offset 0" Error #3494

Open
WeetbixNMilk opened this issue Jan 8, 2025 · 2 comments
Open
Labels
needs-triage Needs to be triaged by a developer and assigned a release

Comments

@WeetbixNMilk
Copy link

WeetbixNMilk commented Jan 8, 2025

Kavita - User Preferences

What happened?

Hi guys,

I am receiving error "Invalid addr-spec token at offset 0" in the UI when hitting "Test" in the email settings.

I am aware this is an issue when MimeKit thinks an invalid email is being parsed but after general troubleshooting and checking logs I can't fight what the issue might be.
I've tried; single words, quotations/brackets/etc, different email addresses from different hosts, ending in a semicolon and more.

What did you expect?

I expected the "Test" function to work as intended.

Kavita Version Number - If you don not see your version number listed, please update Kavita and see if your issue still persists.

0.8.4.2 - Stable

What operating system is Kavita being hosted from?

Docker (Dockerhub Container)

If the issue is being seen on Desktop, what OS are you running where you see the issue?

None

If the issue is being seen in the UI, what browsers are you seeing the problem on?

No response

If the issue is being seen on Mobile, what OS are you running where you see the issue?

None

If the issue is being seen on the Mobile UI, what browsers are you seeing the problem on?

No response

Relevant log output

[Kavita] [2025-01-08 13:59:46.716 +11:00  385] [Error] Serilog.AspNetCore.RequestLoggingMiddleware HTTP POST /api/settings/test-email-url responded 500 in 10.4106 ms
MimeKit.ParseException: Invalid addr-spec token at offset 0
   at MimeKit.MailboxAddress.set_Address(String value)
   at API.Services.EmailService.SendEmail(EmailOptionsDto userEmailOptions)
   at API.Services.EmailService.SendTestEmail(String adminEmail) in /home/runner/work/Kavita/Kavita/API/Services/EmailService.cs:line 115
   at API.Controllers.SettingsController.TestEmailServiceUrl() in /home/runner/work/Kavita/Kavita/API/Controllers/SettingsController.cs:line 536
   at lambda_method1792(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at API.Startup.<>c__DisplayClass4_0.<<Configure>b__5>d.MoveNext() in /home/runner/work/Kavita/Kavita/API/Startup.cs:line 411
--- End of stack trace from previous location ---
   at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
[Kavita] [2025-01-08 13:59:46.724 +11:00  385] [Error] API.Middleware.ExceptionMiddleware There was an exception
MimeKit.ParseException: Invalid addr-spec token at offset 0
   at MimeKit.MailboxAddress.set_Address(String value)
   at API.Services.EmailService.SendEmail(EmailOptionsDto userEmailOptions)
   at API.Services.EmailService.SendTestEmail(String adminEmail) in /home/runner/work/Kavita/Kavita/API/Services/EmailService.cs:line 115
   at API.Controllers.SettingsController.TestEmailServiceUrl() in /home/runner/work/Kavita/Kavita/API/Controllers/SettingsController.cs:line 536
   at lambda_method1792(Closure, Object)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at API.Startup.<>c__DisplayClass4_0.<<Configure>b__5>d.MoveNext() in /home/runner/work/Kavita/Kavita/API/Startup.cs:line 411
--- End of stack trace from previous location ---
   at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware.Invoke(HttpContext httpContext)
   at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
   at API.Middleware.SecurityEventMiddleware.InvokeAsync(HttpContext context) in /home/runner/work/Kavita/Kavita/API/Middleware/SecurityMiddleware.cs:line 25
   at API.Middleware.ExceptionMiddleware.InvokeAsync(HttpContext context) in /home/runner/work/Kavita/Kavita/API/Middleware/ExceptionMiddleware.cs:line 18

Additional Notes

No response

@WeetbixNMilk WeetbixNMilk added the needs-triage Needs to be triaged by a developer and assigned a release label Jan 8, 2025
@majora2007
Copy link
Member

First off, just to validate, you saved them hit test?

I've never seen that error before, you may need to DM me the email (or email with characters swapped) so I can try to reproduce.

@WeetbixNMilk
Copy link
Author

First off, just to validate, you saved them hit test?

I've never seen that error before, you may need to DM me the email (or email with characters swapped) so I can try to reproduce.

Thank you, I've sent you an email with all the omitted information uncensored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs to be triaged by a developer and assigned a release
Projects
Status: To do
Development

No branches or pull requests

2 participants