Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wish: Report 250 2.0.0 Ok: queued as 17409e25-7190-4d09-954f-5f0ca794940f #64

Closed
stappersg opened this issue May 29, 2023 · 6 comments
Closed

Comments

@stappersg
Copy link
Contributor

Hello,

A nice to have would be mailcrab reporting to sending side with which reference the message was queued. Simular as a MTA as postfix does.

$ swaks --to [email protected]
=== Trying rosa.stappers.it:25...
=== Connected to rosa.stappers.it.
<-  220 rosa.stappers.it ESMTP Postfix (Debian/GNU)
 -> EHLO redacted
    ...
 -> 
 -> .
<-  250 2.0.0 Ok: queued as E191A1FD3
 -> QUIT
<-  221 2.0.0 Bye
=== Connection closed with remote host.
$

It would be something like

--- a/backend/src/mail_server.rs
+++ b/backend/src/mail_server.rs
@@ -93,13 +93,13 @@ impl mailin::Handler for MailHandler {
         Ok(())
     }
 
-    fn data_end(&mut self) -> mailin::Response {
+    fn data_end(&mut self, id: &str) -> mailin::Response {
         if let Err(e) = self.parse_mail() {
             event!(Level::WARN, "Error parsing email: {}", e);
 
             mailin::response::Response::custom(500, "Error parsing message".to_string())
         } else {
-            mailin::response::OK
+            mailin::response::Response::custom(250, "2.0.0 Ok: queued as {}".to_string(), id)
         }
     }
 

But that will need a change in the mailin library.

Maybe there are other options.

@stappersg
Copy link
Contributor Author

... will need a change in the mailin library.

requested

@stappersg
Copy link
Contributor Author

With the information from https://gitlab.com/alienscience/mailin/-/issues/12#note_1417098369 I was able to make merge request #67

@stappersg
Copy link
Contributor Author

Merge request #67 revoked because the self.id being used wasn't the correct one.

@stappersg stappersg reopened this Jun 5, 2023
@marlonbaeten
Copy link
Member

Fixed with #68

@stappersg
Copy link
Contributor Author

Fixed with #68

Yeah, it works. Thanks. Meanwhile I have seen 92b48d0 and probably have seen what was needed for getting #67 working. In other words: I'm gratefull for the change and do think that it would have been good thing if what went into commit 92b48d0 was split into dedicated commits.

@stappersg
Copy link
Contributor Author

... do think that it would have been good thing if what went into commit 92b48d0 was split into dedicated commits.

That became #69 ...

@stappersg stappersg mentioned this issue Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants