Giter Club home page Giter Club logo

managesievej's Introduction

Introduction

Sieve is a simple mail filtering language. Users scripts are stored and run on the mail server, and are managed through the Manage Sieve protocol. This library provides a Java API to the Manage Sieve protocol.

Dependencies

This library depends on Apache Commons Codec for Base64 support. It also depends on SLF4J as its logging facade.

Example

There is an example use of the library in the com.fluffypeople.managesieve.examples package.

Maven

<dependency>
  <groupId>com.fluffypeople</groupId>
  <artifactId>managesievej</artifactId>
  <version>0.3.1</version>
</dependency>

Licence

This library is covered by the MIT licence.

References

managesievej's People

Contributors

malbinola avatar mbaechler avatar moosemorals avatar ricardonooijen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

managesievej's Issues

NullPointerException when calling ManageSieveClient#isConnected before ManageSieveClient#connect

I'm building a simple UI to edit my sieve scripts and to avoid opening too many connections to the server, I want to check if the client is already/still connected. But if the client is not yet connected or the underlying socket was closed, I get a NullPointerException and I have to guard against this by doing:

    try {
        if (client.isConnected()) return;
    } catch(NullPointerException e) {
        // this is fine if we are not yet connected
    }
    ManageSieveResponse resp1 = client.connect(host, port);
    ...

If ManageSieveClient.java#L171 would check if the socket exists (like ManageSieveClient.java#L171), the NPE could be prevented and I could check if the connection is still open.

Cyrus compatibility

In order to be compatible with Cyrus, the first argument of sieve commands sent to the server should use the 'quoted' string representation.

Cyrus and Maven compatibility

Hi,

In order to better support the managesieve protocol in OBM, we are working on a fork of managesievej. This fork includes:

  • Maven support (pom.xml, source code moved to src/main/java)
  • bugfix in getScript (the upstream version does not work properly if the server returns NO/BYE)
  • turned space into tabs (for compatibility with the rest of the codebase)
  • encodeString uses the literal-c2s string representation from RFC 5804 instead of literal-s2c
  • escapeString escapes double quotes
  • Cyrus compatibility: ACTIVATE, GETSCRIPT, PUTSCRIPT and DELETESCRIPT use the quoted string representation for their first argument (Cyrus doesn't seem to parse literal-c2s properly)

For now, the fork has no Netbeans support, as nobody here uses Netbeans (the build.xml and the Netbeans files have been dropped). The work-in-progress XML support has also been dropped.

We would be glad to contribute some of these changes back. What is a bit tricky, though, is that changes like switching the way command encode their strings may break compatibility with other implementations, if they don't conform to the spec in a different way from Cyrus.

putscript with utf-8 chars

Hi,
the InputStreamReader is opened with UTF-8 charset but the PrintWriter is not (ManageSieveClient.java:806).
Is there a reason for this or is this a bug?
Thank you
Peter

setActive can only make only one script active.

I used the ConnectAndListScripts to make test and found that the client.setActinve can only make one script active while making other scripts unactive...

is this a bug? or this just work like this ?

Maven compatibility

Options:

  • standard Maven layout (preferred), with sources in src/main/java instead of src, and resources in src/main/resources
  • fiddling with pom.xml to point the sources to src. It does mean that the XSL and XSD would have to move to a different directory, though.

This is blocking for the other issues.

Update copyright

  • The copyright states "2013", should be "2013-2015"
  • XML.java lacks both license and copyright
  • Add Linagora copyright to modified files

Socket timeout

Is it possible for you to make socket timeout configurable and not hardcoded to 5000 ms? Tnx in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.