Skip to content

Add Reply-To function - #199

Merged
mbrt merged 7 commits into
mbrt:masterfrom
peteroneilljr:add-reply-to-function
Oct 4, 2021
Merged

Add Reply-To function#199
mbrt merged 7 commits into
mbrt:masterfrom
peteroneilljr:add-reply-to-function

Conversation

@peteroneilljr

Copy link
Copy Markdown
Contributor

Adding Reply-To function mentioned in issue #140

@mbrt

mbrt commented Sep 27, 2021

Copy link
Copy Markdown
Owner

Thanks a lot for the contribution!

I was trying to test this out, but I couldn't make it work.
It seems that Gmail doesn't support this at all? https://support.google.com/mail/answer/7190?hl=en.

@mbrt

mbrt commented Sep 27, 2021

Copy link
Copy Markdown
Owner

Actually I was wrong, it does seem to work, it's just undocumented.

I was able to create a filter that does just that and it seems to work.

FFR, here's the exported version:

<feedxmlns='http://www.w3.org/2005/Atom'xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:...</id>
<updated>2021-09-27T19:35:54Z</updated>
<author>
<name>Me</name>
<email>me@gmail.com</email>
</author>
<entry>
<categoryterm='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:z...</id>
<updated>2021-09-27T19:35:54Z</updated>
<content></content>
<apps:propertyname='hasTheWord'value='replyto:mbrt/gmailctl'/>
<apps:propertyname='shouldNeverSpam'value='true'/>
<apps:propertyname='sizeOperator'value='s_sl'/>
<apps:propertyname='sizeUnit'value='s_smb'/>
</entry>
</feed>

@mbrtmbrt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'm looking through the changes and they look good!

There's only one place I could see missing:

  • README.md, section Tests, about the new replyto field in the test object.

@peteroneilljr

Copy link
Copy Markdown
ContributorAuthor

Hi @mbrt was it as simple as updating the list of fields available for the test object? Or is there an actual test object that needs to be updated?

@mbrtmbrt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Tests are also failing. See the results here.

One way to fix this is to do the following:

go test ./... --update
go test ./...

The first command should trigger the regeneration of the golden test files here: https://github.com/mbrt/gmailctl/blob/master/pkg/config/lib_test.go#L18. The second will run all the tests. If nothing fails we should be good to go!

Comment threadREADME.md Outdated
@peteroneilljr

Copy link
Copy Markdown
ContributorAuthor

Alright, everything should be fixed now. I was updating all of the same files that were updated when BCC was added as an operator and It seems I updated an autogenerated file used by the Go tests.

@mbrt

mbrt commented Oct 2, 2021

Copy link
Copy Markdown
Owner

Sorry for the delay in responding.

Actually the file you updated was good, it's the input to the test. The result is checked against the JSON files that are updated through the commands in the comment above.

If you remove it, there's no test for the new field you added, so a future change might break the behavior. Could you please add it back and fix the tests? Then we are truly good to go.

@peteroneilljr

Copy link
Copy Markdown
ContributorAuthor

Ok I think the tests are fixed now! :)

mbrt
mbrt approved these changes Oct 4, 2021

@mbrtmbrt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good, thanks!

@mbrt
mbrt merged commit 82184ee into mbrt:masterOct 4, 2021
@mbrt

mbrt commented Oct 4, 2021

Copy link
Copy Markdown
Owner

Thanks for the contribution! :)

@gtback

Copy link
Copy Markdown

Thanks, @peteroneilljr !

Sign up for freeto 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.

3 participants

@peteroneilljr@mbrt@gtback