NAME
Net::AS2::MDN - AS2 Message Deposition Notification
SYNOPSIS
### Sending Message and got a Sync MDN
my $mdn = $as2->send($body, Type => 'application/xml', MessageId => 'my-message-id-12345@localhost')
if (!$mdn->is_success) {
print STDERR $mdn->description;
}
DESCRIPTION
This is a class for creating Message Deposition Notifications (MDN) for use in handling AS2 (RFC 4130) communication. This described in RFC 3798.
PUBLIC INTERFACE
Constructor
- $mdn = Net::AS2::MDN->create_success($message)
- $mdn = Net::AS2::MDN->create_success($message, $plain_text)
-
Create an
Net::AS2::MDN
indicating processed with transaction information provided byNet::AS2::Message
. Optionally with a human readable text. - $mdn = Net::AS2::MDN->create_warning($message, $status_text)
- $mdn = Net::AS2::MDN->create_warning($message, $status_text, $plain_text)
-
Create an
Net::AS2::MDN
indicating processed with warnings with transaction information provided byNet::AS2::Message
. Optionally with a human readable text.Status text is required and will goes to the
Disposition
line. It is limited to printable ASCII. - $mdn = Net::AS2::MDN->create_failure($message, $status_text)
- $mdn = Net::AS2::MDN->create_failure($message, $status_text, $plain_text)
-
Create an
Net::AS2::MDN
indicating failed/failure status with transaction information provided byNet::AS2::Message
. Optionally with a human readable text.Status text is required and will goes to the
Disposition
line. It is limited to printable ASCII. - $mdn = Net::AS2::MDN->create_error($message, $status_text)
- $mdn = Net::AS2::MDN->create_error($message, $status_text, $plain_text)
-
Create an
Net::AS2::MDN
indicating processed/error status with transaction information provided byNet::AS2::Message
. Optionally with a human readable text.Status text is required and will goes to the
Disposition
line. It is limited to printable ASCII. - $mdn = Net::AS2::MDN->create_from_unsuccessful_message($message)
-
Create a corresponding
Net::AS2::MDN
for unsuccessfulNet::AS2::Message
notice generated while receiving and decoding. Message's error text will be used. - $mdn->parse_mdn($content)
-
Parses the given content as an MDN.
- $mdn = Net::AS2::MDN->create_error_mdn($reason)
-
Create an 'error'
Net::AS2::MDN
with the status text of$reason
. - $mdn = Net::AS2::MDN->create_unparsable_mdn($reason)
-
Create an 'unparsable'
Net::AS2::MDN
with the status text of$reason
.
Methods
- $mdn->match_mic($mic, $alg)
-
Verify the MDN MIC value with a pre-calculated one to make sure the receiving party got what we sent.
The MDN will be marked
is_error
if the MICs do not match.$mdn->match_mic($mic, 'sha1'); if ($mdn->is_success) { # still success after comparing mic }
Returns 1 if MICs do match, 0 otherwise.
- $mdn->is_success
-
Indicating a successfully processed status. (This returns true even with warning was presented)
- $mdn->with_warning
-
Indicating the message was processed with warning.
- $mdn->is_failure
-
Indicating a failed/failure status.
- $mdn->is_error
-
Indicating a processed/error status
- $mdn->is_unparsable
-
Indicating the MDN was unparsable
- $mdn->status_text
-
The machine readable text follows the Disposition status
- $mdn->async_url
-
The URL where the MDN was requested to sent to
- $mdn->should_sign
-
Returns true if the MDN was requested to be signed
- $mdn->recipient
-
Returns the AS2 name of the final recipient field of the MDN
- $mdn->original_message_id
-
Returns the Original-Message-Id field of the MDN
- $mdn->description
-
Returns a concatenated text message of the MDN status, machine readable text and human readable text.
- $mdn->as_mime
-
Returns a multipart/report
MIME::Entity
representation of the MDN
SEE ALSO
BUGS AND LIMITATIONS
The Message Deposition Notification RFC 3798 is now obsolete. It has been superceeded by RFC 8098. These changes have not been implemented.