vSMTP
vSMTP copied to clipboard
Do you have any feature request ?
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.
How does it delivery the received letters directly to my web api via http request? I want to store received mail into database.
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
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.
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?
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.
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.
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?
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!
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.");
}
}
]
}