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

Working with the NULL Sender Address #302

Closed
jhumphries83 opened this issue Apr 24, 2017 · 7 comments
Closed

Working with the NULL Sender Address #302

jhumphries83 opened this issue Apr 24, 2017 · 7 comments
Labels
bug Something isn't working

Comments

@jhumphries83
Copy link

Hi,

A quick question - how should I be working with the NULL Sender address in MimeKit?

Back in v1.10 I was able to create an instance of the NULL Sender address like this:

public static MailboxAddress NullMailboxAddress
{
     get { return new MailboxAddress(string.Empty, string.Empty); }
}

However, in v1.16 I receive a ArgumentException when doing this.

I want so be able to send a DSN from the NULL Sender by doing something like this:

smtpClient.Send(bounceMessage, EmailAddress.NullMailboxAddress, bounceMessage.To.Mailboxes);

Thanks!

@jhumphries83
Copy link
Author

I should also mention that I've tried:

return new MailboxAddress(string.Empty, "<>");

but that throws a ParseException

@jstedfast jstedfast added the question A question about how to do something label Apr 24, 2017
@jstedfast
Copy link
Owner

SMTP requires a sender address. You don't have to add it to the message, though.

@jstedfast
Copy link
Owner

never mind, I guess it is allowed.

@jstedfast jstedfast reopened this Apr 24, 2017
@jstedfast jstedfast added bug Something isn't working and removed question A question about how to do something labels Apr 24, 2017
jstedfast added a commit that referenced this issue Apr 24, 2017
SMTP allows empty return-path addr-specs in MAIL FROM.

Fixes issue #302
@jhumphries83
Copy link
Author

jhumphries83 commented Apr 24, 2017

Hi, Thanks for fixing that so quickly - I'm able to create an instance of the MailboxAddress with an empty address now, but when I call MailKit.Net.Smtp.SmtpClient.Send I'm getting the exception "Index was outside the bounds of the array" at MimeKit.InternetAddress.TryParseLocalPart.

Again, I think this worked back in v1.10 - but now it validates the sender address when calling that method. I'm wondering whether the NULL sender address should be treated as a special case and have a check for that up front when validating the sender?

I took a look at the code but it wasnt clear to me where the validation was happening.

@jstedfast
Copy link
Owner

It should work now.

@jhumphries83
Copy link
Author

Thanks for getting this sorted so quickly. Do you have a plan for the next release date yet?

@jstedfast
Copy link
Owner

End of May I guess. I've been really busy and don't have time to make a release right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants