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

Sending mail via SMTP aborts if a user is unknown #256

Closed
RoyTinker opened this issue Oct 28, 2015 · 7 comments
Closed

Sending mail via SMTP aborts if a user is unknown #256

RoyTinker opened this issue Oct 28, 2015 · 7 comments
Labels
enhancement New feature or request

Comments

@RoyTinker
Copy link

It would be really great if there was an option to specifically ignore 550 [...] User unknown.

Thanks for this great utility!

@jstedfast
Copy link
Owner

I'm honestly having trouble understanding the use-case for this. Normally, if an address doesn't exist, you need to abort sending the message and notify the user that one of the addresses does not exist and allow the user to fix it/remove it and then send again.

Allowing the message to go through is just awkward unless you are writing a mass mailer that doesn't care if addresses are invalid/unavailable.

I'm also not really keen on adding awkward bool properties to SmtpClient to specify corner-case behaviors.

@RoyTinker
Copy link
Author

I'm using MimeKit/MailKit to send automated notification emails internally from an intranet application. From time to time, I receive a "Hey! So and so did not get notified of XYZ" email, and it's always been due to a problem outside of my control: either an alias isn't configured correctly, or someone who doesn't work here anymore was accidentally added to a form, etc.

Manually checking each mail address against the internal LDAP database could solve some of the problem, but there are issues that would only show up in the SMTP session with a 550 error, like aliases that aren't configured correctly. (And there are valid addresses that the LDAP database does not know about.)

In my opinion, the best solution would be for the app to send the message anyway and notify the responsible devs of the problem.

The application in question facilitates a pretty high-profile process; so if problem notification emails aren't sent and have to wait for a dev to fix, I'll have frustrated users.

@RoyTinker
Copy link
Author

I'd be happy if you only marked SmtpClient#ProcessMailFromResponse and SmtpClient#ProcessRcptToResponse protected so I could provide different behavior in a subclass. I'll submit a PR for that if you like.

@jstedfast jstedfast added the enhancement New feature or request label Oct 29, 2015
@jstedfast
Copy link
Owner

if MAIL FROM fails, there's no way to recover, so I left that one private for now.

@RoyTinker
Copy link
Author

Thanks Jeffrey, much appreciated.

@RoyTinker
Copy link
Author

Hey, also, before I go --- thanks so much for the quick turnaround and the really great libraries.

@jstedfast
Copy link
Owner

Hey @TimTheTinker, another user in issue #309 has a similar problem and the current ProcessRcptToCommand() method does not provide enough context for their use case.

I am proposing to modify that method to also take the MimeMessage object that is currently being sent as a possible solution and both wanted to keep you updated on the potential API breakage but also to solicit feedback from you to see if that would be useful to you (perhaps you might run into the same situation he brought up (which is "what to do if all recipients are rejected?").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants