Helpmonks / haraka-plugin-mongodb

Plugin for the Haraka SMTP server to store incoming and outgoing emails to MongoDB
GNU General Public License v3.0
31 stars 17 forks source link

Add support for smtp_forward plugin #20

Closed kayrus closed 2 years ago

kayrus commented 2 years ago

https://haraka.github.io/plugins/queue/smtp_forward/ config allows to specify an SMTP server with credentials to forward emails to. It can also forward emails to different SMTP servers according to the recipient/sender domains.

In case when the email cannot be delivered right away, the credentials and the backend hostname info must be stored in a queue along with the message body, so the next attempt would use the corresponding user:pass@host:587 backend server.

thenitai commented 2 years ago

Hi,

You wrote a description of what that plugin does. However, I don't get what this has to do with this plugin? Is there a question in there that I've missed?

kayrus commented 2 years ago

@thenitai I haven't noticed that it saves SMTP host and credentials for further tries https://github.com/Helpmonks/haraka-plugin-mongodb/blob/master/index.js#L326-L357 :\ did I miss something?

kayrus commented 2 years ago

I also didn't find the logic that retries to send an email from mongodb.

thenitai commented 2 years ago

You are mistaken about what this plugin does. Please read the description.

kayrus commented 2 years ago

I think there is a general confusion about the terms haraka uses. For me a queue is a special storage haraka uses to store emails for further retry. Same as postfix or exim. Currently this behavior corresponds only to the local disk queue (queue directory). It looks like all queue plugins don't follow this approach and queuing means just to deliver emails to external storage with no other actions from haraka side.

See similar references I found with this confusion:

@thenitai could you please explain the use case for your config? Why do you store emails in mongo if haraka doesn't process them afterwards? Do you use a separate application to access emails from mongo?