You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the behavior I'm getting from ofxSMTP and GMail is that if sent to an invalid email, GMail returns an error that looks like this when sent to an email like "junkaddress":
[ error ] Client::threadedFunction: SMTP Exception : SMTP Exception: Recipient rejected: <junkaddress>: 553-5.1.2 We weren't able to find the recipient domain. Please check for any
553-5.1.2 spelling errors, and make sure you didn't enter any spaces, periods,
553 5.1.2 or other punctuation after the recipient's email address. mj3sm1311496igb.11 - gsmtp
Even after this failure, the message stays in the queue.
Then, so in your opinion, if a message fails to send, it should be removed from the queue?
Actually I'm speaking of mail addres that are not string in an email format (with a @ followed by a .)
I'm using ofxSMTP on a permanent installation. People can enter their email.
If the user enters nothing and hit "send" or if he enters kjhsdgf and hits "send", I've got the error
[ error ] Client::threadedFunction: SMTP Exception : SMTP Exception: Recipient rejected: <>: 555 5.5.2 Syntax error. fq1sm9143606wib.12 - gsmtp
Recipient rejected is blank, and any further valid (or in the right string email format) email address returns the same error.
With the is_email function of my first post I check if the string entered have a @ followed by a .
And everything is fine.
I choose to not send to the queue addresses that are not in the email format.
Cheers
bakercp
changed the title
ofxsmtp stop sending email
Remove Undeliverable Mail from the queue
Oct 21, 2014
OK. So the main issue I see here is that if the server responds with a 500 series error (unrecoverable), then the message that caused that error needs to be marked as a delivery failure and removed from the queue.
While I'm OK with adding a utility method to check for valid email addresses, I'd prefer to leave that up to the server when sending a message failure.
I started work on fixing this and will add it to the next version. For the time being, the work around is to do exactly what you did -- pre-validate email addresses before submitting them the the send queue.
When using a gmail smtp server, the recipient address needs to be a valid email format (with a @ followed by a .)
Here is a function that can check that
bool is_email(std::string const& address) {
size_t at_index = address.find_first_of('@', 0);
return at_index != std::string::npos
&& address.find_first_of('.', at_index) != std::string::npos;
}
This function could be called in the send function of the smtp client.
Sorry, I'm a very beginner with Github ...
The text was updated successfully, but these errors were encountered: