Skip to content

Filter mails with Sieve - #1822

Closed
pierlon wants to merge 41 commits into
nextcloud:masterfrom
pierlon:feature/sieve-filters
Closed

Filter mails with Sieve#1822
pierlon wants to merge 41 commits into
nextcloud:masterfrom
pierlon:feature/sieve-filters

Conversation

@pierlon

@pierlon pierlon commented Jun 22, 2019

Copy link
Copy Markdown
Member

This PR is intended to fix #44.

Todo:

  • Configure Sieve settings from account form
  • Add UI to add and edit filter rules
  • Add UI to use custom Sieve rule
  • Add UI to change the active Sieve script
  • Store Sieve rules in a script on the server
  • Retrieve Sieve rules from a script on the server
  • Parse Sieve rules from a script to send to frontend
  • Compile Sieve rules that are sent from the frontend

@pierlon
pierlon requested a review from ChristophWurst June 22, 2019 06:10
@ChristophWurst

Copy link
Copy Markdown
Member

Looks great so far! Please coordinate with the others that wanted to work on #44. We should avoid conflicts and duplicate work.

Comment thread lib/Service/SetupService.php Outdated
Comment thread lib/Account.php
Comment thread lib/Account.php Outdated
Comment thread lib/Account.php Outdated
Comment thread lib/Account.php Outdated
@kesselb kesselb mentioned this pull request Sep 5, 2019
3 tasks

@kesselb kesselb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I found a migration in my stash. Looks very similar to your migration. We might need a sieve_enable flag: $table->addColumn('sieve_enable', Type::BOOLEAN);

Comment thread lib/Migration/Version0151Date20190622040212.php
Comment thread lib/Migration/Version0151Date20190622040212.php Outdated
Comment thread lib/Migration/Version0151Date20190622040212.php Outdated
Comment thread lib/Migration/Version0151Date20190622040212.php Outdated
Comment thread lib/Migration/Version0151Date20190622040212.php Outdated
Comment thread lib/Migration/Version0151Date20190622040212.php Outdated
mmittelb and others added 10 commits September 5, 2019 16:36
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Co-Authored-By: Daniel Kesselberg <mail@danielkesselberg.de>

Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
Signed-off-by: Pierre Gordon <pierregordon@protonmail.com>
@pierlon
pierlon force-pushed the feature/sieve-filters branch from 8dc9f84 to 5500191 Compare September 12, 2019 15:01
@pierlon
pierlon requested a review from kesselb September 12, 2019 15:07
Comment thread lib/Account.php Outdated
Comment thread lib/Command/CreateAccount.php Outdated
Comment thread lib/Db/MailAccount.php Outdated
Comment thread lib/Service/Sieve/Script.php Outdated
Comment thread lib/Service/Sieve/Script.php

@ChristophWurst ChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some early feedback :)

Comment thread lib/Account.php
* @return ManageSieve
* @throws ManageSieve\Exception
*/
public function getSieveConnection()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

getImapConnection is using an outdated coding style and we're int process of refactoring our code to get rid of the method. Please see the ImapClientFactory and create something similar for Sieve.

Comment thread lib/Account.php
public function getSieveConnection()
{
if ($this->sieveClient === null) {
$host = $this->account->getSieveHost();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Handle accounts without Sieve settings

* @param int $accountId
* @return JSONResponse
* @throws AccountException
* @throws \Horde\ManageSieve\Exception

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • TODO: Catch

* @param string $script
* @param string $script_name
* @return JSONResponse
* @throws \Horde\ManageSieve\Exception

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • TODO: Catch

*/
private function getSieveService(int $accountId): SieveService
{
$account = $this->accountService->find($this->currentUser->getUID(), $accountId);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • TODO: handle account not found error

return $this->installRawScript($script);
}

return ['status' => 'error', 'message' => 'Not implemented'];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

$this->installScript($script);
return ['status' => 'success'];
} else {
return ['status' => 'error', 'message' => $script->getParseError()];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

Comment thread package.json
"test:watch": "mochapack -w --webpack-config webpack.test.js --require src/tests/setup.js \"src/tests/**/*.spec.js\""
},
"dependencies": {
"@saeris/vue-spinners": "^1.0.8",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • TODO: use Nextcloud's icon-loading/icon-loading-small instead

Comment thread package.json
"vue-autosize": "^1.0.2",
"vue-click-outside": "^1.0.7",
"vue-infinite-scroll": "^2.0.2",
"vue-m-message": "^2.0.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • TODO: use OC.Notification.showTemporary(...) instead

Comment thread package.json
"vue-on-click-outside": "^1.0.3",
"vue-router": "^3.1.3",
"vue-scroll": "^2.1.12",
"vue-select": "^3.1.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • TODO: use Multiselect from nextcloud/vue instead

@LorbusChris

Copy link
Copy Markdown

@pierlon any updates?

@jancborchardt

Copy link
Copy Markdown
Member

@pierlon @mmittelb do you have any new developments here? :) Or @kesselb maybe you want to take this over?

Let me know when or if you need any design input.

@jancborchardt

Copy link
Copy Markdown
Member

Currently there are some merge conflicts. @nextcloud/mail does anyone want to look into resolving them and/or taking this over? :)

@ChristophWurst

Copy link
Copy Markdown
Member

Whoever takes this over should first get in contact with the original authors so there is no conflict on who may eventually claim the bounty.

@LorbusChris

Copy link
Copy Markdown

friendly ping @pierlon @mmittelb
(as a little incentive I've increased the bounty a bit -- if you get this done within the next 3mo)

@ChristophWurst

Copy link
Copy Markdown
Member

@nextcloud/mail at which point will we just assume that this incentive is dead? We want to have this feature eventually but since I've been wrongly accused of taking away bounties from community people I'm not willing to take this over unless the original authors can clarify #1822 (comment). @pierlon @mmittelb would you have a minute to comment?

@ChristophWurst

Copy link
Copy Markdown
Member

@nextcloud/mail at which point will we just assume that this incentive is dead?

Currently it's been 165d since the latest commit.

@pierlon

pierlon commented May 6, 2020

Copy link
Copy Markdown
Member Author

Much apologies for not replying as quickly as possible here, but unfortunately I won't be able to continue where I left off. I hope the work done so far will serve as a basis and guide for the additional code to be written, and I do wish all the best for my successor.

With that said, if I recall correctly I believe the "TODO" section in the description above is still accurate and those are still outstanding. I may have done some more work on the UI for adding and customizing filters that were not pushed; if I am able to find it I will update this PR with the changes.

@dehnhardt

Copy link
Copy Markdown
Collaborator

Sieve filters are a pretty important thing to me. I would try to move on here - even though I might need help for frontend things.
However, I do not know how to take over a pull request in a meaningful way.
Since there are many merge conflicts now, I tend to create a new pull request. Does that make sense?

@hashworks

Copy link
Copy Markdown

Does that make sense?

I think so. The only other option would be pull requests to pierlon:feature/sieve-filters that he would need to merge. But I guess it's better you fork from that branch.

@ChristophWurst

Copy link
Copy Markdown
Member

I would try to move on here

@dehnhardt please coordinate with the original authors regarding #1822 (comment) and how you want to handle the bounty.

@dehnhardt

Copy link
Copy Markdown
Collaborator

Ups, haven't seen the bounty. Ok, I will get in touch with pierlon.
Thanks for reminding me!

@dehnhardt

Copy link
Copy Markdown
Collaborator

@pierlon : Dear Pierre, I want to try to finish this ManageSieve extension.
@ChristophWurst pointed out to me that there are bounties for it. I think you did a good part of the implementation, so you should decide what to do with the bounties;-)
Can you give some feedback?
Thanks Holger
@ChristophWurst is there a possibility to contact @pierlon directly?

@ChristophWurst

Copy link
Copy Markdown
Member

@ChristophWurst is there a possibility to contact @pierlon directly?

You can try the email from the commit 6d7b0dc

@pierlon

pierlon commented May 28, 2020

Copy link
Copy Markdown
Member Author

@ChristophWurst pointed out to me that there are bounties for it. I think you did a good part of the implementation, so you should decide what to do with the bounties;-)
Can you give some feedback?

Hey @dehnhardt, I'd leave that up to you. I did put a lot of hard work into this quite some time ago, but I believe the person who is able to bring this across the finish line deserves as much respect and praise as I would have received if I did.

@dehnhardt

Copy link
Copy Markdown
Collaborator

@pierlon, then we'll see if I get further than you and if this is the case we'll toss a coin;-)

@dehnhardt dehnhardt mentioned this pull request Jun 30, 2020
@ChristophWurst

Copy link
Copy Markdown
Member

Hi 👋,

we are about to merge #4472. This isn't the full sieve feature but merely the basics with sieve credentials, provisioning and so on and "just" a basic UI, but this will be the foundation for any other enhancements. Therefore I'm closing this PR and the other one.

Thanks a lot everyone who has helped move this forward. Even if this PR wasn't integrated it was a huge help for Daniel's implementation.

✌️

@pierlon
pierlon deleted the feature/sieve-filters branch February 27, 2021 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filtering of Incoming messages

8 participants