1

Topic: POST request

====
- iRedMail version (check /etc/iredmail-release):  1.6.5
- Linux/BSD distribution name and version: debian-11
====

Hello,

I need to implement the following functionality:
I have iRedMail installed on Linux Debian 11. I have several created users, and when they receive a new email, I need to send its content to my URL (mysite.com/mail/v1/addmail) using a POST request.
In general, iRedMail should not store emails at all, so as not to waste space in the database. Everything will be stored on my other servers, iRedMail should only work as a receiver, even sending mail is not needed.

How to do it?

Thank you.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: POST request

what is the point of storing mails on other server?
mails are stored as plaintext, not in a database at all

if you want to store them external, you can just mount the store directory to an external network storage

3

Re: POST request

I'm developing a separate service, one of its many modules will process incoming messages, something like a ticket system. We need a module that will be a mail service (linux + iRedMail) and it must send all incoming letters to another complex module for processing and structuring data, taking into account many user settings, subsequent notification, preparation of the data necessary for it, and the like. It turns out: a letter arrived, iRedMail sent it with a POST request to the specified URL, my server saved it in the required format and launched a chain of other necessary services and algorithms for further processing.

4

Re: POST request

then iredmail is nothing for you...
if you just need to forward mails to a api, setup a simple postfix instance and pipe it

5

Re: POST request

The task is as follows. There are users, who have their mail, which receives letters from their users (there may be more than one), for example, user1@company1.com and user2@company1.com. This user registers in our service, and we create a new mailbox for him (for him it is virtual since he will not have access to it as such), for example, guid1@test.com. In their mailboxes, user1@company1.com and user2@company1.com configure mail forwarding to my guid1@test.com. Then, when letters arrive at the guid1@test.com mailbox (which is deployed on iRedMail), they are sent to my service, where I work with them and use them in a form convenient for it. In this case, I need all the capabilities of the mail service to check spam, etc.

If mail is stored not in a database, but in the form of files, this is even better. Then the following scenario is possible: a new letter has arrived, I give access to file storage (for example, Blob Files Azure), this letter is saved in the InboxTemp folder with a unique name (guid), and if there are attached files, they are also assigned a unique name (guid). A POST request is then sent to my site that simply says to create a new email named GUID1 with GUID2/GUID3 attached.

As a result, it should be a full-fledged mail service on which any other mail services can send letters.
It should score 10 out of 10 on all tests.

6

Re: POST request

FYI https://docs.iredmail.org/pipe.incoming … cript.html