makes the postfix mail receiver execute in its own directory

This commit is contained in:
Timothy Prepscius 2013-09-29 20:01:12 -04:00
parent 16650b0728
commit 588bfd41f3
2 changed files with 2 additions and 3 deletions

View File

@ -61,5 +61,5 @@ anvil unix - - - - 1 anvil
scache unix - - - - 1 scache scache unix - - - - 1 scache
javapipe unix - n n - - pipe javapipe unix - n n - - pipe
user=postfix-user flags=DRhuX argv=java -jar /home/postfix-user/PostfixMailReceiver.jar -args $recipient directory=/home/postfix-user user=postfix-user flags=DRhuX argv=java -jar /home/postfix-user/PostfixMailReceiver.jar -args $recipient

View File

@ -24,14 +24,13 @@ public class PostfixMailReceiver
{ {
File me = new File(args[0]); File me = new File(args[0]);
File logFile = new File(me.getParent(), "run.log"); File logFile = new File(me.getParent(), "run.log");
log.debug("Running with log file as ",logFile);
System.setOut(new PrintStream(new FileOutputStream(logFile))); System.setOut(new PrintStream(new FileOutputStream(logFile)));
System.setErr(System.out); System.setErr(System.out);
try try
{ {
log.debug("Running with log file as ",logFile);
Class.forName("com.mysql.jdbc.Driver"); Class.forName("com.mysql.jdbc.Driver");
String toAddress = args[1]; String toAddress = args[1];
byte[] bytes = Streams.readFullyBytes(System.in); byte[] bytes = Streams.readFullyBytes(System.in);