summaryrefslogtreecommitdiff
path: root/src/Main.java
blob: da89a5036a20f81fd93b2e99e727eca003bcf101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// package org.noreply.fancydress.directory;

import java.io.*;
import org.noreply.fancydress.directory.parser.*;
import org.noreply.fancydress.directory.*;
import org.noreply.fancydress.type3.*;
import org.noreply.fancydress.misc.*;
import org.noreply.fancydress.type3.routing.*;
import org.noreply.fancydress.type3.mmtp.*;

public class Main {
    static public void main(String argv[]) {
    /* Start the parser */
    try {
      DirectoryParser parser = new DirectoryParser(new DirectoryLexer(new FileReader(argv[0])));
      DirectoryMessage dm = (DirectoryMessage)parser.parse().value;
      Directory dir = new Directory(dm, false);
      PathSpec path = new PathSpec(dir,"test1 : tonga", false);

      RoutingSMTP destination = new RoutingSMTP("peter@palfrader.org");
      String body = "FROM:Peter\n" +
                    "SUBJECT:test fancydress\n" +
                    "\n" +
                    "blubb\n";

      Message message = new Message(path, destination, body);
      message.send();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}