| Sympa::Message(3Sympa) | sympa 6.2.74 | Sympa::Message(3Sympa) |
Sympa::Message - Mail message embedding for internal use in Sympa
use Sympa::Message; my $message = Sympa::Message->new($serialized, context => $list);
While processing a message in Sympa, we need to link information to the message, modify headers and such. This was quite a problem when a message was signed, as modifying anything in the message body would alter its MD5 footprint. And probably make the message to be rejected by clients verifying its identity (which is somehow a good thing as it is the reason why people use MD5 after all). With such messages, the process was complex. We then decided to embed any message treated in a "Message" object, thus making the process easier.
Parameters:
Returns:
A new Sympa::Message object, or undef, if something went wrong.
Parameter:
Returns:
Serialized representation of Message object.
Note that returned value is real reference to internal data structure. Even if it was changed, string representation of message may not be updated. Alternatively, use "add_header"(), "delete_header"() or "replace_header"() to modify header.
Returns:
An array of the overall result of checking and authentication result(s).
Instance method. Verifies DKIM signatures included in the message, and if any of them are invalid, removes them.
Returns:
An array of the result of checking and authentication result.
Note:
Use of aggregate_authentication_results() is recommended instead of using this method derectly.
Returns true value if seal was successfully added.
Note that returned value is real reference to internal data structure. Even if it was changed, string representation of message may not be updated. Below is better way to modify message.
my $entity = $message->as_entity->dup;
# ... Modify $entity...
$message->set_entity($entity);
Parameter:
Note that method like "set_string()" does not exist: You would be better to create new instance rather than replacing entire content.
Note that the result won't be decoded.
Note that the result won't be decoded nor unfolded.
In scalar context without $sep, returns first occurrence or "undef". If $sep is defined, returns all occurrences joined by it, or "undef". Otherwise in array context, returns an array of all occurrences or "()".
Note: Folding newlines will not be removed.
Parameters:
Returns:
Instance method. Adds topic and puts header X-Sympa-Topic.
Parameters:
Returns:
Instance method. Gets topic of message.
Parameters:
None.
Returns:
Note that this method modifies Message object.
Parameters:
None.
Returns:
True value if message was decrypted. Otherwise false value.
If decrypting succeeded, {smime_crypted} item is set.
Note that this method modifies Message object.
Parameters:
Returns:
True value if encryption succeeded, or "undef".
Signing key is taken from what stored in list directory.
Parameters:
None.
Returns:
True value if message was successfully signed. Otherwise false value.
Parameters:
None
Returns:
1 if signature is successfully verified. 0 otherwise. "undef" if something went wrong.
Note: This checks if the message has appropriate content type and header parameters. Use check_smime_signature() to check if the message has properly signed content.
Currently, S/MIME-signed messages with content type "multipart/signed" or "application/pkcs7-mime" (with smime-type="signed-data" parameter) are recognized. Enveloped-only messages are not supported. The other signature mechanisms such as PGP/MIME have not been supported yet.
Parameters:
None.
Returns:
1 if the message is considered signed. 0 otherwise.
Parameters:
Returns:
Modified message itself, or "undef" if error occurred.
Instance method. Tests if personalization can be performed successfully over all subscribers of list.
Parameters:
Returns:
1 if succeed, or "undef".
Parameters:
Returns:
Customized text, or "undef" if error occurred.
By 'nomail', 'digest', 'digestplain' or 'summary' mode, the message is not modified.
Returns modified message object itself, or "undef" if transformation failed.
MIME-compliant headers are appended / modified. And custom X-Mailer: header is appended :).
Parameters:
Returns:
string
Dies if the context of the message was not List.
The text will be converted to UTF-8. Flowed text (see RFC 3676) will be conjuncted.
Parameter:
TBD.
Returns:
The name of malware the message contains, if any; "unknown" for unidentified malware; "undef" if checking failed; otherwise 0.
Parameters:
None.
Returns:
String.
Parameters:
None.
Returns:
None. "From:" field of the message may be modified.
Parameters:
None.
Returns:
String of tag(s), can be separated by ',', can be empty.
Context and metadata given to constructor are accessible as hash elements of object. These are typically used.
These are accessible as hash elements of objects.
'<>' will be used for "null envelope sender".
This item was added on Sympa 6.2.59b.2 to avoid processing decoration twice with the messages stored into outgoing spool by earlier version of Sympa.
On Sympa 6.2.58 or earlier, there was no distinction between "footer" and "all". The "merge" item in the messages stored into outgoing spool by earlier version of Sympa will be treated as "all".
This is used by bulk spool.
Sympa::Message object includes number of slots as hash items: metadata, context, attributes and message content. Metadata including context are given by spool: See "Marshaling and unmarshaling metadata" in Sympa::Spool.
Logically, objects are stored into physical spool as serialized form and deserialized when they are fetched from spool. Attributes will be serialized and deserialized along with raw message content. Attributes are encoded in "X-Sympa-*:" pseudo-header fields and "Return-Path:" header field. Below is an example of serialized form.
X-Sympa-Message-ID: 123456789.12345@domain.name : {message_id} attribute
X-Sympa-Sender: user01@user.sympa.test : {sender} attribute
X-Sympa-Display-Name: Infant : {gecos} attribute
X-Sympa-Shelved: dkim_sign; tracking=mdn : {shelved} attribute
X-Sympa-Spam-Status: ham : {spam_status} attribute
Return-Path: sympa-request@domain.name : {envelope_sender} attribute
Message-Id: <123456789.12345@domain.name> : ---
From: Infant <user@other.host.dom> : |
To: User <user@some.host.name> : |
Subject: Howdy world : | Raw message content
X-Sympa-Topic: sometopic : |
: |
Bonjour, le monde. : |
: ---
On msg, automatic and bounce spools, "Return-Path:" header fields are given by MDA and "X-Sympa-*:" header fields are given by queue programs. On other spools, they are given by components of Sympa.
Pseudo-header fields should appear at beginning of serialized content. Fields appear at other places (e.g. "X-Sympa-Topic:" field above) are not attributes but are the part of raw message content.
Pseudo-header fields should not be included in actually sent messages.
We trust in "Return-Path:" header field only at the top of message to prevent forgery. To ensure it will be added to messages by MDA,
get_plaindigest_body() seems to ignore any text after a UUencoded attachment.
Message module appeared on Sympa 3.3.6. It was initially written by:
get_plaindigest_body, ex. "plain_body_as_string" in PlainDigest, was initially written by Chris Hastie. It appeared on Sympa 4.2b.1.
(c) Chris Hastie 2004 - 2008.
Renamed and merged Sympa::Message appeared on Sympa 6.2.
| 2024-12-17 | 6.2.74 |