[ 
https://issues.apache.org/jira/browse/JAMES-3431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17231246#comment-17231246
 ] 

Benoit Tellier commented on JAMES-3431:
---------------------------------------

Hello Karsten,

I took some time to come up with some end to end scenarii regarding DSN feature:

{code:java}
    Given a mail with no NOTIFY params for a local user When it succeed THEN no 
email is sent back to the sender
    Given a mail with no NOTIFY params for a local user When it fails THEN a 
regular bounce is sent back to the sender
    Given a mail with no NOTIFY params for a remote user When it succeed THEN 
no email is sent back to the sender
    Given a mail with no NOTIFY params for a remote user When it fails THEN a 
regular bounce is sent back to the sender

    Given a mail with NOTIFY=NEVER params for a local user When it succeed THEN 
no DSN success notification is sent to the sender
    Given a mail with NOTIFY=NEVER params for a local user When it fails THEN 
no bounce is sent back to the sender
    Given a mail with NOTIFY=NEVER params for a remote user When it succeed 
THEN no email is sent back to the sender (by James), james forward the 
responsibility to the remote server (NOTIFY=SUCCESS)
    Given a mail with NOTIFY=NEVER params for a remote user When it fails THEN 
no bounce is sent back to the sender

    Given a mail with NOTIFY=SUCCESS params for a local user When it succeed 
THEN a DSN success notification is sent to the sender
    Given a mail with NOTIFY=SUCCESS params for a local user When it fails THEN 
a regular bounce is sent back to the sender
    Given a mail with NOTIFY=SUCCESS params for a remote user When it succeed 
THEN no email is sent back to the sender (by James), james forward the 
responsibility to the remote server (NOTIFY=SUCCESS)
    Given a mail with NOTIFY=SUCCESS params for a remote user When it fails 
THEN a regular bounce is sent back to the sender

    Given a mail with NOTIFY=FAILURE params for a local user When it succeed 
THEN no email is sent back to the sender
    Given a mail with NOTIFY=FAILURE params for a local user When it fails THEN 
a dsn bounce is sent back to the sender
    Given a mail with NOTIFY=FAILURE params for a remote user When it succeed 
THEN no email is sent back to the sender (by James), james forward the 
responsibility to the remote server (NOTIFY=FAILURE)
    Given a mail with NOTIFY=FAILURE params for a remote user When it fails 
THEN a dsn bounce is sent back to the sender

    Given a mail with NOTIFY=DELAY params for a remote user When temporary 
failures are encountered THEN a dsn bounce is sent back to the sender, and 
James eventually forward the responsibility to the remote server 
(NOTIFY=FAILURE)
{code}

Here would be the steps to implement and test these behaviors:

 - 1. Modify the Mail object, of the mailet-api to include the "per rcpt notify 
partameters" 
   - Emuate a strong type API on top of Email object, backed by mail attributes.

 - 2. Handling the NOTIFY  extension at the SMTP server level to position the 
"per rcpt notify partameters" on emails. Command handler saves intermediate 
states in the SMTP session.
   - MailCmdHandler handling for VERIFY and RET options
   - RcptCmdHandler should attach the NOTIFY and ORCPT parameters for the 
recipient to the SMTP session 
   - Provide a JamesMessageHook to position DSN information on enqueued emails 
   - Unit test as the command handler level

 - 3. MailQueue needs to carry over "per rcpt notify partameters" 

 - 4. MailRepositories needs to carry over "per rcpt notify partameters"

 - 5. Provide utilities for processing and generating DSN within the mailet 
container
    - Audit existing DSNBounce mailet, and provide more specilized mailet: 
DSNSuccess, DSNDelay, DSNFailure
        - RET option needs to be taken into account, on a per email basis and 
not as a global parameter
        - ENVID needs to be taken into account and returned within the bounce.
    - Add DSNSuccessRequested, DSNFailureRequested , DSNDelayRequested matchers 

 - 6. Remote Delivery should cary over NOTIFY parameters (using SMTPMessage)
    - Customize MockSmtpServer to register RCPT NOTIFY parameters
      - adapt interaction format & store 
      - modify MockSMTPServer SMTP stack to capture Motification parameters 
into the interactions 


> Relay DSN options on RemoteDelivery
> -----------------------------------
>
>                 Key: JAMES-3431
>                 URL: https://issues.apache.org/jira/browse/JAMES-3431
>             Project: James Server
>          Issue Type: Bug
>          Components: Remote Delivery, SMTPServer
>    Affects Versions: 3.5.0
>            Reporter: Karsten Otto
>            Priority: Major
>
> Since James claims to support the DSN SMTP extension, it may receive a mail 
> submission according to [RFC 3461|https://tools.ietf.org/html/rfc3461]:
> {code:java}
> MAIL FROM:<al...@example.org> RET=HDRS ENVID=QQ314159
> RCPT TO:<d...@ivory.edu> NOTIFY=SUCCESS,FAILURE,DELAY 
> ORCPT=rfc822;d...@ivory.edu
> RCPT TO:<f...@bombs.af.mil> NOTIFY=NEVER{code}
> In this case James should
>  * remember the given DSN options (NOTIFY, ORCPT, RET, ENVID) for each 
> recipient, and
>  * provide the same options when relaying the mail to remote servers via the 
> RemoteDelivery mailet.
> (The DSN options should be accessible to other interested mailets as well, 
> e.g. for bounce processing.)
> Possibly related issues:
>  https://issues.apache.org/jira/browse/JAMES-322
>  https://issues.apache.org/jira/browse/JAMES-362
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to