working on IMAP listener
This commit is contained in:
24
src/main/java/de/srsoftware/widerhall/Application.java
Normal file
24
src/main/java/de/srsoftware/widerhall/Application.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package de.srsoftware.widerhall;
|
||||
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) throws IOException, ParseException {
|
||||
var parser = new JSONParser();
|
||||
var config = Files.readString(new File("/tmp/config.json").toPath());
|
||||
JSONObject json = (JSONObject) parser.parse(config);
|
||||
|
||||
//String testSender = (String) json.get("sender");
|
||||
//String testReceiver = (String) json.get("receiver");
|
||||
// new SmtpClient(json).send(json,testSender,"Stephan Richter",testReceiver,"Test","Dies ist ein Test");
|
||||
MessageHandler forward = new Forwarder();
|
||||
new ImapClient(json).addListener(forward).start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user