-
Notifications
You must be signed in to change notification settings - Fork 351
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
NullReferenceException during Auto-Relay #1438
Comments
It's the 23cdcf12-29df-4f89-bc4e-700694f50291 that's looking strange here. Can you work out where that's coming from?
…________________________________
From: sodermatt ***@***.***>
Sent: Friday, April 26, 2024 4:04:01 PM
To: rnwood/smtp4dev ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [rnwood/smtp4dev] NullReferenceException during Auto-Relay (Issue #1438)
I'm trying to get the Auto.Relay-Feature running.
I configured the following RealyOptions (Mail-Addresses, Server-Name are replaced with dummy-values)
`"RelayOptions": {
"IsEnabled": true,
"SmtpServer": "mail.domain.de",
"SmtpPort": 25,
"TlsMode": "Auto",
"AutomaticEmails": ***@***.******@***.***>"],
"AutomaticRelayExpression": ***@***.******@***.***>$/)",
"SenderAddress": "",
"Login": "",
"Password": ""
},`
When I submit a "Send-MailMessage"-PS, the mail is successfully delivered to smtp4dev, but the Auto-Relay throws an error.
Output in cmd-Window:
Session started. Client address ::1. Message received. Client address ::1, From ***@***.***, To ***@***.***, SecureConnection: False. Processing received message AutomaticRelayExpression: (message: {message.Id}, recipient: 23cdcf12-29df-4f89-bc4e-700694f50291, session: {session.Id}) => ***@***.*** => 04de849a-bf01-4745-81ca-660f90e887cd Relaying message to ***@***.*** Can not relay message to ***@***.***: System.NullReferenceException: Object reference not set to an instance of an object. at Rnwood.Smtp4dev.Server.Smtp4devServer.TryRelayMessage(Message message, MailboxAddress[] overrideRecipients) in D:\a\1\s\Rnwood.Smtp4dev\Server\Smtp4devServer.cs:line 407 System.NullReferenceException: Object reference not set to an instance of an object. at Rnwood.Smtp4dev.Server.Smtp4devServer.TryRelayMessage(Message message, MailboxAddress[] overrideRecipients) in D:\a\1\s\Rnwood.Smtp4dev\Server\Smtp4devServer.cs:line 407 Processing received message DONE Session completed. Client address ::1. Number of messages 1.
Am I missing a Config-Option?
—
Reply to this email directly, view it on GitHub<#1438>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAKEGF6DKHSGIDPPF3EUUH3Y7JUGDAVCNFSM6AAAAABG26HG4CVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3DKOJXHE2DMNQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
You can ignore that question. I am able to reproduce and will resolve this. The ID is because there is a bug in the logging. It's the message ID. |
Should be resolved by the PR. Note that |
Correct, this was just a test configuration - thanks for reacting this fast, really appreciated! Will test as soon as build is done |
I'm trying to get the Auto-Relay-Feature running.
I configured the following RelayOptions (Mail-Addresses, Server-Name are replaced with dummy-values)
`"RelayOptions": {
"IsEnabled": true,
"SmtpServer": "mail.domain.de",
"SmtpPort": 25,
"TlsMode": "Auto",
"AutomaticEmails": ["xyz@domain.de"],
"AutomaticRelayExpression": "recipient.match(/xyz@domain.de$/)",
"SenderAddress": "",
"Login": "",
"Password": ""
},`
When I submit a "Send-MailMessage"-PS, the mail is successfully delivered to smtp4dev, but the Auto-Relay throws an error.
Output in cmd-Window:
Session started. Client address ::1. Message received. Client address ::1, From abc@domain.de, To xyz@domain.de, SecureConnection: False. Processing received message AutomaticRelayExpression: (message: {message.Id}, recipient: 23cdcf12-29df-4f89-bc4e-700694f50291, session: {session.Id}) => xyz@domain.de => 04de849a-bf01-4745-81ca-660f90e887cd Relaying message to xyz@domain.de Can not relay message to xyz@domain.de: System.NullReferenceException: Object reference not set to an instance of an object. at Rnwood.Smtp4dev.Server.Smtp4devServer.TryRelayMessage(Message message, MailboxAddress[] overrideRecipients) in D:\a\1\s\Rnwood.Smtp4dev\Server\Smtp4devServer.cs:line 407 System.NullReferenceException: Object reference not set to an instance of an object. at Rnwood.Smtp4dev.Server.Smtp4devServer.TryRelayMessage(Message message, MailboxAddress[] overrideRecipients) in D:\a\1\s\Rnwood.Smtp4dev\Server\Smtp4devServer.cs:line 407 Processing received message DONE Session completed. Client address ::1. Number of messages 1.
Am I missing a Config-Option?
The text was updated successfully, but these errors were encountered: