function

emailparse . mails . sncode

VERSIONlatest Parse the content of an email.

EMAILPARSE

NAME

emailparse - Parses the content of an email.

SYNOPSIS

emailparse (email:"value") emailparse ("value")

PARAMETERS

email
email to parse.

RETURN

Array
Returns an array of headers fields that can be a single string or an array of strings plus sn_body for the body of the message.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{
                for a dir("/tests/mail") do
                        email = read(a.path);
                        res = emailparse(email);
                        sn_nb; ":"; res.Subject; " "; res.sn_body.length(); " ";
                endfor
}}. return res=0:sshd-60.28.246.143 1 1:Logwatch for lynx.sednove.com (Linux) 1218190
2:Cron  /local/bin/db 859
3:Cron  /local/bin/compress_logs 5832 .),{asm => "-a", strict => 1});

(No linefeed in the output. This is for clarity)

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>