|
Mailfromd |
General-Purpose Mail Filter |
Sergey Poznyakoff |
| Mailfromd Manual (split by node): | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
? |
The functions described below retrieve information from RFC822
messages. The message to operate upon is identified by its
descriptor, an integer number returned by the previous call to
mailbox_get_message (see section mailbox_get_message) or current_message
(see current_message) function.
Return the size of the message nmsg, in bytes. Notice,
that if nmsg refers to current message
(see current_message), the returned value is less than the size
seen by the MTA, because mailfromd recodes
CR-LF sequences to LF, i.e. removes carriage
returns (ASCII 13) occurring before line feeds
(ASCII 10. To obtain actual message length as seen by the
MTA, add the number of lines in the message:
set actual_length message_size(%nmsg) + message_lines(%nmsg) |
Return the size, in bytes, of the body of message nmsg. See the
note to the message_size, above.
Return the size, in bytes of the headers of message nmsg. See the
note to the message_size, above.
Return number of lines in the body of message referred to by descriptor nmsg.
Rewind stream associated with the body of message referred to by descriptor nmsg.
A call to message_body_read_line (see below) after calling this
function will return the first line from the message body.
Close the message identified by descriptor nmsg.
Return number of parts in message nmsg, if it is a multipart (MIME) message. If it is not, return ‘1’.
Use message_is_multipart to check whether message is a
multipart one.
string name [, number idx]) Return value of header name from the message nmsg. If the message contains several headers with the same name, optional parameter idx may be used to select one of them. Headers are numbered from ‘1’.
If no matching header is not found, the not_found exception is
raised. If another error occurs, the failure exception is
raised.
The returned string is a verbatim copy of the message contents (except
for eventual CR-LF -> LF translation, see above).
You might need to apply the unfold function to it (see section unfold).
Extract nth part from the multipart message nmsg. Numeration of parts begins from ‘1’. Return message descriptor referring to the extracted part. Message parts are regarded as messages, so any message functions can be applied to them.
Return true if message nmsg contains header with the
given name. If there are several headers with the same name,
optional parameter idx may be used to select one of them.
Return number of headers in message nmsg.
Return number of lines occupied by headers in message nmsg.
Return true if message nmsg is a multipart
(MIME) message.
Return total number of lines in message nmsg. The following relation holds true:
message_lines(x) = message_body_lines(x)
+ message_header_lines(x) + 1
|
Read and return next line from the body of the message nmsg. If
there are no more lines to read, raise the eof exception.
Use message_body_rewind (see above) to rewind the body stream
and read its contents again.
Read and return next line from the message nmsg. If
there are no more lines to read, raise the eof exception.
Use message_rewind to rewind the message stream and read its
contents again.
Rewind the stream associated with message referred to by descriptor nmsg.
| Mailfromd Manual (split by node): | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
? |
Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.