trancos30 / subethasmtp

Automatically exported from code.google.com/p/subethasmtp
Other
1 stars 0 forks source link

Add feature to include custom string in DATA completion reply #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently in Subethasmtp (3.1.7), the response (aka the completion reply) to a 
successful reception of the message after the DATA command is sent, is "250 Ok".

On other MTAs (specifically Exim), I've seen that a unique identifier is 
appended, which correlates to the instance of the message on the exim queue and 
exim log entries.

e.g. "250 OK id=1TkhHl-0006EV-R3"

This can be quite handy for troubleshooting.

It would be helpful if SimpleMessageListener#deliver and 
SmarterMessageListener#deliver could return a String, which would be appended 
the response "250 OK" (with a space in between of course).

Original issue reported on code.google.com by ericparu...@gmail.com on 17 Dec 2012 at 8:36

GoogleCodeExporter commented 9 years ago

Original comment by hontvari@flyordie.com on 12 May 2013 at 12:48

GoogleCodeExporter commented 9 years ago
Yes, I think it would be interesting to trace the message from the log. 
Using the id generated by the server it is possible to make the relation 
between 
what was sent and what was received

Attached Patch  

Original comment by chley...@gmail.com on 4 Mar 2014 at 8:30

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
A more interesting solution would be to add the following in the SMTPServer 
class. 

public void setCommandHandler (CommandHandler CommandHandler) {
     this.commandHandler = CommandHandler; 
}

This would overload CommandRegistry CommandHandler classes and so define its 
own controls. 
MyDataCommand could be 

@ Override 
     public void execute (String commandString, Session sess) 
             throws IOException {DropConnectionException 
         super.execute (commandString, sess); 
         log.info ("Message" + sess.getSessionId () + " queued for 
delivery."); 
     }

Original comment by chley...@gmail.com on 4 Mar 2014 at 9:32