Iness Bha
Iness Bha

Reputation: 1

How to manage a SMTP server in a Java EE application?

I am building a Java EE web application that has to be able to connect to a Postfix server and "manage" it (change informations in his configuration file....).

I had found a lot of documents that shows how to create a new smtp server but I didn't found anything about how to manage a one that I had installed on my VMWare. So if anyone can point me in the right direction and explain what could I use for this,that would be great.

Upvotes: 0

Views: 266

Answers (1)

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340733

I don't know Postfix, but looking at Postfix Basic Configuration it seems like it is controlled via simple main.cf file. So all you have to do is to create a web GUI reading and modifying that file.

After modifying the file it seems like you need to reload Postfix:

# /etc/init.d/postfix reload

Java is capable of running any system processes/scripts.

Problems

  • your application will probably need root privileges to modify Postfix configuration file and reload the service

  • the application needs to run on the same virtual machine as Postfix to have access to main.cf file. Otherwise some sort of network file system or synchronization is required. Alternatively - load the file locally and have some external script synchronizing it.

Upvotes: 1

Related Questions