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

Mail::Sendmail cannot send to addresses with tildes #1121

Closed
Benabik opened this issue Jun 6, 2017 · 2 comments
Closed

Mail::Sendmail cannot send to addresses with tildes #1121

Benabik opened this issue Jun 6, 2017 · 2 comments
Milestone

Comments

@Benabik
Copy link
Contributor

Benabik commented Jun 6, 2017

Mail::Sendmail.shellquote escapes characters like Shellwords.escape, but then also wraps the argument in double quotes. This causes incorrect values to be passed to sendmail/exim.

require 'mail'
require 'shellwords'

address = 'test~@example.com'
system "echo #{Shellwords.escape address}"
system "echo #{Mail::Sendmail.shellquote address}"

Outputs:

test~@example.com
test\~@example.com
@Benabik
Copy link
Contributor Author

Benabik commented Jun 6, 2017

Further testing indicates that Mail::Exim can send to those addresses (as it's not passed on the command line), but it can't send from them.

Benabik added a commit to Benabik/mail that referenced this issue Jun 6, 2017
Shells (tested with bash, dash, and busybox) don't unescape \~ inside
double quotes.

Fixes mikel#1121
Benabik added a commit to Benabik/mail that referenced this issue Jul 17, 2017
Shells (tested with bash, dash, and busybox) don't unescape \~ inside
double quotes.

Fixes mikel#1121
@jeremy
Copy link
Collaborator

jeremy commented Oct 24, 2017

#1122

@jeremy jeremy closed this as completed Oct 24, 2017
@jeremy jeremy added this to the 2.7.0 milestone Oct 24, 2017
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

No branches or pull requests

2 participants