-1

How can I execute .jar file via procmail?

My recipe:

:0
* ^Subject.*test
* B ?? test
| /usr/local/bin/java /home/username/.procmail/printer.jar

In present form it doesn't work but if I change executing jar file to forward mail like that:

! mail@mail.com

It works perfectly.

What to do?

EDIT I just looked into log file and here it is:

Error: Could not find or load main class .home.Main..procmail.printer.jar
  • 1
    Please read [How do I ask a good question?](http://stackoverflow.com/help/how-to-ask) before attempting to ask more questions. –  Jan 23 '18 at 20:58

1 Answers1

0

Apparently the argument to Java needs to be a class name, not the path to the file which contains the class definition.

Alternatively, as remarked in a comment, pass the -jar option before the jar file name.

tripleee
  • 175,061
  • 34
  • 275
  • 318