vSMTP icon indicating copy to clipboard operation
vSMTP copied to clipboard

Do you have any feature request ?

Open Mathieu-Lala opened this issue 3 years ago • 9 comments

You would like to see some features in vSMTP ?

Feel free to create an issue or open a discussion about your feature request, we will consider them with high priority and integrate them in our roadmap.

Mathieu-Lala avatar Jan 19 '22 15:01 Mathieu-Lala

How does it delivery the received letters directly to my web api via http request? I want to store received mail into database.

jet10000 avatar Jun 23 '22 17:06 jet10000

Interesting :+1:

We planned to support http socket, and direct connection to databases (mysql / redis / ...). But it is not implemented right now. You can still call your api using a third party software (cURL or anything), and call it from your vsl file.

You have an example of these syntax here : https://github.com/viridIT/vSMTP/tree/develop/examples/config/antivirus

// in http.vsl
service my_api cmd = #{
    timeout: "15s",
    command: "curl",
};
// in main.vsl
import "http" as http;

#{
  postq: [
    action "send to my api" || {
      let result = http::my_api.cmd_run(["-P", `${msg()}`]);
      debug(`${result}`);
    }
  ]
}

This should be correct

Mathieu-Lala avatar Jun 23 '22 17:06 Mathieu-Lala

I have pretty much the same usecase as above only with mongodb. Our current solution (based on http://haraka.github.io/) checks rcpt against a mongodb database and delivers to said database.

If there was vSL support for mongodb, that would be a lot cleaner than our current solution.

Brandl avatar Aug 24 '22 21:08 Brandl

Also I hope I got this right, but it seems like delivery is implemented outside of vSL? Is that assumption correct? If yes, why so?

Brandl avatar Aug 24 '22 21:08 Brandl

Also I hope I got this right, but it seems like delivery is implemented outside of vSL? Is that assumption correct? If yes, why so?

What do you mean by "implemented outside of vsl" ? For now delivery is configured using vsl and executed after the "delivery" stage that you can hook on to in vsl.

ltabis avatar Aug 25 '22 07:08 ltabis

If there was vSL support for mongodb, that would be a lot cleaner than our current solution.

MongoDB support in vsl is possible ! I'll discuss with the team to add support for future releases.

ltabis avatar Aug 25 '22 08:08 ltabis

Also I hope I got this right, but it seems like delivery is implemented outside of vSL? Is that assumption correct? If yes, why so?

What do you mean by "implemented outside of vsl" ? For now delivery is configured using vsl and executed after the "delivery" stage that you can hook on to in vsl.

Is it possible to define a condition in which some emails will be forwarded and others stored in a db?

Brandl avatar Aug 25 '22 19:08 Brandl

If there was vSL support for mongodb, that would be a lot cleaner than our current solution.

MongoDB support in vsl is possible ! I'll discuss with the team to add support for future releases.

That would be great to see!

Brandl avatar Aug 25 '22 19:08 Brandl

Is it possible to define a condition in which some emails will be forwarded and others stored in a db?

Yes it is. Here is what it would look like using vSL:

import "database" as db;

#{
    preq: [
        action "forward or store" || {

            let sender = mail_from();

            // A really simple conditions, you can do stuff more complex with
            // multiple conditions, regex etc ...
            if sender.domain == "example.com" {
                // forward the email to another server.
                forward_all("192.168.1.19");
            } else {
                // pseudocode for mongodb query because it's not yet implemented.
                db::mongdb_database.query("your query to send the email.");
            }
        }
    ]
}

ltabis avatar Aug 26 '22 07:08 ltabis