-
Notifications
You must be signed in to change notification settings - Fork 106
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
Added checks for undefined #509
Added checks for undefined #509
Conversation
I think this may actually break the parser, I need to take a closer look -- but IIRC the regex allows e.g. m[1] (which is checked later) but not [2], etc. |
Arrgh. . You're right. |
When I tried sending mail to What I did notice in the debugger was sending to Fwiw, I reverted my code change, and results were the same. Sending to After I created a Finally, I logged in to xibalba to try and determine how things are behaving there. Unfortunately I ran out of time this evening. I'll pick this up again tomorrow. Thanks for your help. |
The email parsing right now is mostly just a placeholder - enig can currently automatically send password resets, auth validation, etc. emails, but is not quite yet set up to map users to [email protected], which is the ultimate intent. If the parser (from the previous PR) doesn't think it's a email, it would default to a local lookup. |
Thanks for the info. It seems the current implementation in master branch behaves slightly differently than you describe. We're actually getting a db lookup whenever the address is determined to be anything other than FTN flavor. Although this PR doesn't get us any closer to the ultimate intent of [email protected] it does resolve the socket disconnect that happens when a number is entered into the To field. |
Sorry you're right, this change is in the ActivityPub branch: function validateGeneralMailAddressedTo(data, cb) {
//
// Allow any supported addressing:
// - Local username or real name
// - Supported remote flavors such as FTN, email, ...
//
const addressedToInfo = getAddressedToInfo(data);
if (Message.AddressFlavor.Local !== addressedToInfo.flavor) {
return cb(null);
}
return validateUserNameOrRealNameExists(data, cb);
} There are actually quite a few fixes in there. I'd like to get a lot of that to main, just need some time on it. Free free to change it to the above. |
…thonyHarwood/enigma-bbs into bugfix/ftn_address_fromString
I made the change you requested. Thanks for reviewing. |
@@ -135,7 +135,7 @@ module.exports = class Address { | |||
static fromString(addrStr) { | |||
const m = FTN_ADDRESS_REGEXP.exec(addrStr); | |||
|
|||
if (m) { | |||
if (m && m[2] && m[3]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to revert this part, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test for m[2] might not be needed.
To be honest, I never found a way to cause m[2] to be null. I just figured if testing for m[3] was necessary, testing for m[2] was probably not a bad idea. Perhaps I was being a bit too defensive.
Anyways... I tried removing the test for m[3] just now, and found that entering a numeric value in the address field will cause an error and disconnect me. So I believe that test is still needed.
I'm curious to know if the tests for m[2] and m[3] might become unnecessary if FTN_ADDRESS_REGEXP was tweaked a bit. And then we could just test m??? Just a thought.
Did this fix your issue still? |
Yes, it did. I tried a variety of FTN, email and local username schemes. All are working for me now. |
Before this can be merged, I left a comment in the FTN parser - still appears to have the previous fix? |
Found a simpler solution.
@NuSkooler - thanks for helping me get there :)