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

convert To address back to string for tokenization #72

Closed
wants to merge 1 commit into from

Conversation

joedevivo
Copy link

in stmp_server_example, relay/3 is always called with binary(), [binary()], binary() and string:tokens(<<"ex@ample.com">>, "@") would always fail.

@joedevivo
Copy link
Author

ping @Vagabond, merge it! :P WWGD?
ganbold

relay(_, [], _) ->
ok;
relay(From, [To|Rest], Data) ->
% relay message to email address
[_User, Host] = string:tokens(To, "@"),
[_User, Host] = string:tokens(binary_to_list(To), "@"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe binary:split(To, <<"@">>)?

@mworrell
Copy link
Collaborator

mworrell commented Mar 9, 2015

Shouldn't that parse the email address?
Addresses like " @ "@example.com are valid.

@arjan
Copy link
Collaborator

arjan commented May 16, 2016

It's just example code, and the code was clearly broken; this patch just makes it slightly less broken :)

@arjan arjan closed this in d946b10 May 16, 2016
arjan pushed a commit that referenced this pull request Jun 23, 2016
Arjan Scherpenisse (9):
      'rebar3 hex cut' destroyed the .app.src formatting
      Merge pull request #104 from tsloughter/master
      Merge pull request #105 from tsloughter/now_deprecated
      Remove old rebar.test.config
      Merge pull request #71 from fdevibe/master
      Fix #72
      Fix link to OpenACD project
      Merge pull request #106 from zambal/master
      Remove unused nowarn_deprecated_function

Fredrik de Vibe (2):
      Throw permanent_failure when TLS fails due to non-started SSL.
      Close socket and send QUIT also when throwing error because SSL is not started.

Tristan Sloughter (2):
      exclude smtp_rfc822_parse.erl from hex package
      for 18+: remove use of now, replacing with unique_integer

Vincent Siliakus (1):
      Fix -spec's for OTP-19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants