Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

FAQ: REST API

Derek Battams edited this page Jan 21, 2016 · 4 revisions

Corporate policy says I have to host everything over HTTPS instead of HTTP. Does psmtp support serving the API over HTTPS (only)?

Been there, done that.

The war file's web.xml does not enforce a secure connection, but if you're in such an environment then I'm going to assume whatever container your IT/DevOps team is providing to host psmtp is already configured to serve over HTTPS only so you should be fine in that case.

The standalone psmtp app will not run over HTTPS. Use an Apache httpd reverse proxy instead. This is actually how I expose my psmtp instance at work. The test server only exposes Apache over port 443 and I use a reverse proxy to hit anything hosted on Tomcat, including psmtp. I don't have to worry about providing an SSL connector in the embedded version of the app and corporate IT is happy because the only endpoints into the API are over HTTPS.

How do I manually send DELETE requests to the API?

Personally, I used Groovy's HttpBuilder and wrote a lightweight client to interact with the API. A subset of the client is actually available in the psmtp source code under the test folder (I use it for FVT testing of psmtp). If you're using psmtp as a testing tool, you're going to want to write some kind of REST client to interact with it from your tests.

For quick one offs, curl is a nice tool to quickly and easily fire off any kind of request to the API. You should be able to find some browser plugins for firefox or chrome to assist you as well.

Ok, the REST API is nice, but can I not just read the messages stored from my browser?

Starting with v0.2.0, a very basic, bare bones web viewer is bundled with psmtp. For now, this only allows you to view the basic metadata of all email stored in the psmtp database. Over time, the features of this viewer might be enhanced. If you want to see specific enhancements, please open an issue.

Can I download the attachments only for a given message?

Yes! Starting with v0.2.0, you can download attachments for specific email messages via the REST API. See the REST wiki for more details.

Clone this wiki locally