Some utility methods for controlling an RGB LED (or LED's) and gracefully fade between colors
AWS SDK for the Go programming language.
Beam Up Pebble watchface
lightweight, idiomatic and composable router for building Go HTTP services
Chocolately package for Dep https://github.com/golang/dep
Chrome extension that adds media keys to most web music players
dcormier/dotnet-framework-docker 0
The repo for the official docker images for .NET Framework on Windows Server Core.
GO Wrapper for Windows DPAPI
MIME mail encoding and decoding library for Go
fork rakyll/grafana
The tool for beautiful monitoring and metric analytics & dashboards for Graphite, InfluxDB & Prometheus & More
fork in 9 hours
pull request commentjhillyerd/enmime
ParseMediaType: Don't split quoted strings containing semicolons
@jhillyerd I think that if a user wants to include a delimiter with a quoted-string, it must be done using RFC2047 encoding. Such that a filename like:
name="Index\";a.doc"
is rendered as:
name="=?UTF-8?B?SW5kZXhcIjthLmRvYw==?="
comment created time in 10 hours
pull request commentjhillyerd/enmime
ParseMediaType: Don't split quoted strings containing semicolons
So here is a nice quote from that SO thread:
Figuring out what exactly the RFC stipulates is not going to be actually useful. The de facto standard you need to adhere to for interoperability is set by poorly implemented mail clients and browsers. If that's your goal, I would not expect anything like escaping to work reliably, regardless of whether the RFC is on your side.
So I looked up mozilla's libraries and found some stuff of interest: https://github.com/mozilla-comm/jsmime/blob/master/headerparser.js#L29
Quoted-strings (if opt.qstring is true): A string which is surrounded by double quotes. Escapes in the string are omitted when returning.
Another note about this behavior: [Whitespace] need not be between a qstring and an atom (a"b" produces two tokens, a and b). This is an error case, though.
However, in the implementation I see a tell: This is at the head of the character iteration loop which is designed to detect quoted-strings and domain-literals.
// If we see a \, no matter what context we are in, ignore the next
// character.
if (ch == '\\') {
i++;
continue;
}
So it looks like the accepted best practice here is simply to omit any escaped characters, whether or not it's within a quoted-string.
I'm still looking for how they handle single versus double quotes inside each other, like the proposed test-case: "a;'b;c;d"
Ah, okay, so only double-quotes are respected as quoted-string delimiters, and single-quotes are treated as just another character.
So the want here should be:
{
input: "a;'b;c;d",
want: []string{"a", "'b", "c", "d"},
},
comment created time in 11 hours
startedOpenObservability/OpenMetrics
started time in a day
Pull request review commentjhillyerd/enmime
ParseMediaType: Don't split quoted strings containing semicolons
+package stringutil++import (+ "testing"+)++func TestSplitQuoted(t *testing.T) {+ testCases := []struct {+ input string+ want []string+ }{+ // All tests split on ; and treat ' as quoting character.+ {+ input: "",+ want: []string{""},+ },+ {+ input: ";",+ want: []string{"", ""},+ },+ {+ input: "'",+ want: []string{"'"},+ },+ {+ input: "a;b",+ want: []string{"a", "b"},+ },+ {+ input: "a;b;",+ want: []string{"a", "b", ""},+ },+ {+ input: "a;b;c",+ want: []string{"a", "b", "c"},+ },+ {+ input: "a;'b;c';d",+ want: []string{"a", "'b;c'", "d"},+ },+ {+ input: "a;'b;c;d",+ want: []string{"a", "'b;c;d"},+ },
I can picture two possible alternatives; if we hit the end of the string and find it has an unterminated quote:
- Start over and split the entire string without respecting separator quoting at all -- aka how enmime worked previously, since it didn't have a notion of quoting.
- Reset to the last opening quote and pretend it didn't exist; so earlier quoted runs would be respected.
I'd lean towards the first option, given we don't know which quote(s) may be missing, the second isn't going to be any safer than what the code does now.
comment created time in 2 days
pull request commentjhillyerd/enmime
Yeah, it's definitely more aggressive than I'd like. Haven't looked into tuning it, but given enmime is dealing with potentially hostile external email for many folks, probably want static checks.
comment created time in 2 days
pull request commentjhillyerd/enmime
ParseMediaType: Don't split quoted strings containing semicolons
👀 today
comment created time in 2 days
startedkubernetes-sigs/kubebuilder
started time in 2 days
startedgojek/weaver
started time in 2 days
startedkubernetes/kube-state-metrics
started time in 2 days
startedjacksontj/promxy
started time in 2 days
pull request commentjhillyerd/enmime
ParseMediaType: Don't split quoted strings containing semicolons
@requaos and @dcormier -- if either of you have time to review this PR, feedback appreciated. Thanks!
comment created time in 2 days
push eventjhillyerd/enmime
commit sha fc8fb9bda1b9ea1fb46184e06a06eeeaa0c321c6
header: Support escaped quotes in SplitQuoted
push time in 2 days
pull request commentjhillyerd/enmime
ParseMediaType: Don't split quoted strings containing semicolons
It looks like others are also unclear about contents and escaping of quoted strings: https://stackoverflow.com/questions/59816619/do-quoted-mime-media-type-parameters-allow-escaped-quotes
Given that Go let's us escape things with its mime library, I will try to support it as well.
https://play.golang.org/p/r_8sUV16lax
comment created time in 2 days
pull request commentjhillyerd/enmime
I feel using the term envelope here could be confusing since the parsing portion of the library has an Envelope struct. It appears the RFCs use the term "return path" -- but that also seems a bit dated. How about ReturnAddress?
comment created time in 2 days
startedhashicorp/memberlist
started time in 2 days
pull request commentjhillyerd/enmime
@jhillyerd Yes, I need a different address in the envelope. I don't know if the function name 'SendWithEnvelopFrom' is the best, maybe you have a better idea.
comment created time in 2 days
pull request commentjhillyerd/enmime
Thanks for sending this PR, can you elaborate it's purpose? Do you need the from value send to the SMTP server to be different from that of the email headers?
If you are just looking to have multiple from addresses:
Each manipulation method returns a copy of the receiver struct. It can be considered immutable if the caller does not modify the string and byte slices passed in. Immutability allows the headers or entire message to be reused across multiple threads.
This means you can setup an email and send it with different from already:
msg := Builder()
// configure message
msg.From("Bob", "[email protected]").Send(...)
msg.From("Fred", "[email protected]").Send(...)
comment created time in 2 days
startedfoxcpp/maddy
started time in 3 days
startedfoxcpp/maddy
started time in 3 days
push eventjhillyerd/enmime
commit sha 0fc82b7610f94504a5e01fccd73aaf36432e7056
Add more ParseMediaType test cases
push time in 3 days
startedClipy/Clipy
started time in 3 days
push eventjhillyerd/enmime
commit sha fa660c17e12d8f9572cddbc086ed916ff0205aba
Use GitHub Actions for build, test, and PR static checks (#175) * Run unit tests with GitHub Actions * Check PR imports * Add test coverage * Remove travis-ci
push time in 3 days
PR merged jhillyerd/enmime
- [x] Build and test
- [x] Static analysis
- [x] Test coverage
- [x] Remove travis
- [x] Fix lint errors
Closes #173
pr closed time in 3 days
issue closedjhillyerd/enmime
Travis CI has been slow and buggy for months, and it appears they would like their open source users to go elsewhere: https://www.jeffgeerling.com/blog/2020/travis-cis-new-pricing-plan-threw-wrench-my-open-source-works
GitHub Actions is likely to be the best replacement.
closed time in 3 days
jhillyerd