Giter Site home page Giter Site logo

dumbster's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dumbster's Issues

Dumbster doesn't comply to the 78 characters per line limit

(This is a continuation of issue #2 that I cannot re-open.)

I finally found from where these Subject line truncation happened. According to the RFC 2822 section 2.2.3 the lines of a message shouldn't be longer than 78 characters. For that reason it's possible to put a CRLF in any header line that is longer than 78, as I observed when looking at the offending email source in Thunderbird:

...
Message-ID: <9637901.1.1314596564608.JavaMail.Administrator@auto-win2003>
Subject: Funnelback Reports for: Se2-ReportingEmail (_default) [29 August
 2011]
MIME-Version: 1.0
...

It turns out that the mail.jar that comes with Dumbster (and used for the unit tests) seems to be v1.3.0, whereas my app is using v1.4.2. When I upgrade mail.jar to 1.4.2 on Dumbster I can reproduce the problem. I've created a branch showing it here: https://github.com/nguillaumin/dumbster/tree/headers-linebreak

So I guess the header / data parsing code will need to be updated to account for that 78 characters limit...

Cheers,

Nico

Problem with multi-line body

The appendBody method in MailMessageImpl is not honoring newlines in multi-lined messages. The origin of the problem is that the readLine() method in BufferedReader strips the newline so it is not being added to the StringBuffer. After playing around with it, the following seems to work (at least for my use case):

public void appendBody(String line) {
    if(body.length() > 0 && line.length() > 0 && !"\n".equals(line)) {
        body.append('\n');
    }
    body.append(line);
}

Command line --mailStore option doesn't work.

java -jar dumbster-1.9.0.2-SNAPSHOT.jar --mailStore=mailstore 4039

Above command results into help text. It should start dumbster with mailstore.

We want to use dumbster by running with command line. And want to retrieve email from the mailstore.

Add option to not print received messages in console

EMLMailStore and RollingMailStore are printing out received messages with a System.out.println().
This is not always wanted (in my case it's polluting my test logs) and I think an option to turn that off should be provided (or remove it completely if nobody is interested by that, we can print it ourselves in our tests if we need to).

Multithreaded server only outputs to one connection at a time

Steps to reproduce:

  1. launch dumbster, e.g.: [swbeitze@daystar ~]$ java -jar src/github/dumbster/build/dumbster.jar 8989
  2. open a telnet session to the local dumbster: [swbeitze@daystar ~]$ telnet localhost 8989
  3. observe the connect sequence:

    Trying ::1...
    Connected to localhost.
    Escape character is '^]'.
    220 localhost Dumbster SMTP service ready

  4. in another terminal, open a second telnet to dumbster
  5. observe that the connect sequence in the second telnet stops with telnet's printing of the escape character
  6. quit the first telnet session
  7. the second telnet session now prints the dumbster greeting

Set socket timeout on client sockets to prevent thread exhausting

Bad-written clients, if hanged in the middle of the session, can cause the dumbster client thread exhausting. In fact, happens to us all the time in our test environment.

The solution is simple: SocketWrapper.java:

diff --git a/src/com/dumbster/smtp/SocketWrapper.java b/src/com/dumbster/smtp/SocketWrapper.java
index f18a1bc..cac3f6d 100644
--- a/src/com/dumbster/smtp/SocketWrapper.java
+++ b/src/com/dumbster/smtp/SocketWrapper.java
@@ -9,8 +9,9 @@ import java.net.Socket;
 public class SocketWrapper implements IOSource {
     private Socket socket;

-    public SocketWrapper(Socket socket)  {
+    public SocketWrapper(Socket socket) throws IOException {
         this.socket = socket;
+        this.socket.setSoTimeout(10000); // protects against hanged clients
     }

     public BufferedReader getInputStream() throws IOException {

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.