Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Include file YMLSML.H for YMLSML() - Send e-mail

&pagelevel(5)&pagelevel

The include file YMLSML.H is listed below. You will find a program example that shows how to use the YMLSML() function call on "C program examples".

#ifndef _YMLSML_H
#define _YMLSML_H
 
#if 0
/*********************************************************************
 BEGIN-INTERFACE   YMLSML
 
 TITLE             (/ Submit send mail order /)
 NAME              YMLSML.H
 DOMAIN            MAIL
 LANGUAGE          C
 COPYRIGHT         (C) Fujitsu Technology Solutions 2010
                       ALL RIGHTS RESERVED
 COMPILATION-SCOPE USER
 INTERFACE-TYPE    CALL,
                      ORDER
 RUN-CONTEXT       TU
 
 PURPOSE           (/ Submit an order to send mail
                   /)
 [...]
 END-INTERFACE     YMLSML.
*********************************************************************/
#endif
 
[...]
 
#ifdef _YMLSML_H_VERSION_3
 
#define YMLSML_UNIT     940
#define YMLSML_FUNCTION  20
#define YMLSML_VERSION    3
 
/* Wait operand values                                                */
/* ENUM wait_s                                                        */
#define YMLSML_yes 1                    /* YES                        */
#define YMLSML_no 2                     /* NO-DISCARD                 */
#define YMLSML_res 3                    /* NO                         */
 
/* Mail encryption/signing protocol                                   */
/* ENUM sec_prot_s                                                    */
#define YMLSML_smime 1                  /* SMIME                      */
 
/* General yes or no selection                                        */
/* ENUM yesno_s                                                       */
#define YMLSML_yes 1                    /* YES                        */
#define YMLSML_no 2                     /* NO                         */
#define YMLSML_optfile 3                /* OPTFILE                    */
 
/* Cipher operand values                                              */
/* ENUM cipher_s                                                      */
#define YMLSML_des3 5                   /* 3DES                       */
#define YMLSML_aes_128 6                /* AES-128                    */
#define YMLSML_aes_192 7                /* AES-192                    */
#define YMLSML_aes_256 8                /* AES-256                    */
#define YMLSML_cipher_from_optfile 127  /* OPTFILE                    */
 
/* rc                                                                 */
/* ENUM rc_s                                                          */
#define YMLSML_be_ok 0                  /* OK                         */
#define YMLSML_be_param_error 1         /* Parameter error            */
#define YMLSML_be_resource_sat 2        /* Resource saturation        */
#define YMLSML_be_smtp_error 3          /* General SMTP error         */
#define YMLSML_be_smime_error 4         /* SMIME error                */
#define YMLSML_be_smtp_mail_from_error 5
                                        /* Error at SMTP MAIL FROM    */
#define YMLSML_be_smtp_rcpt_to_error 6  /* Error at SMTP RCPT TO      */
#define YMLSML_be_smtp_data_error 7     /* Error at SMTP DATA         */
#define YMLSML_be_file_access_error 8   /* Error at user file access  */
#define YMLSML_be_message_too_large 9   /* Message too large          */
#define YMLSML_be_int_error 10          /* Internal error             */
 
/* main return codes                                                  */
/* mret_code                                                          */
#define YMLSML_successful 0             /* No error detected          */
#define YMLSML_parameter_error 1        /* Parameter error            */
#define YMLSML_int_error 2              /* Internal error             */
#define YMLSML_syntax_error 3           /* Syntax error               */
#define YMLSML_opt_file_error 4         /* Option file not accessible */
#define YMLSML_msgatt_file_error 5      /* Message or attachment file */
                                        /* not accessible             */
#define YMLSML_smime_file_error 6       /* SMIME related file not     */
                                        /* accessible                 */
#define YMLSML_param_too_big 7          /* Mail parameter too big     */
#define YMLSML_backend_error 8          /* Back-end error             */
#define YMLSML_max_order 9              /* Max number of orders       */
                                        /* exceeded                   */
#define YMLSML_serv_not_avail 10        /* Mailclient Service not     */
                                        /* available                  */
#define YMLSML_addr_invalid 11          /* Mailpar address invalid    */
#define YMLSML_resource_sat 12          /* Resource saturation        */
#define YMLSML_asti_not_avail 13        /* Subsystem ASTI not         */
                                        /* available                  */
#define YMLSML_no_from_addr 14          /* No FROM address specified  */
#define YMLSML_asti_error 15            /* Unexpected ASTI error      */
#define YMLSML_timeout 16               /* Maximum wait time reached  */
#define YMLSML_flm_error 17             /* Unexpected FLM error       */
 
/* Parameter area                                                     */
struct YMLSML_pl_mdl {
 
        /* FHDR                                                       */
        struct ESMFHDR hdr;
 
        /* Input parameters                                           */
        struct {
                void* mail_par;         /* Mail parameter area        */
                unsigned long mail_par_len;
                                        /* Mail parameter area length */
                long waittime;          /* Maximum wait time (secs)   */
                unsigned char wait;     /* wait                       */
                unsigned char sec_prot; /* Protocol for encryption    */
                                        /* and signing                */
                unsigned char encrypt;  /* Encryption                 */
                unsigned char sign;     /* Signing                    */
                unsigned char cipher;   /* Cipher                     */
                char optfile[54];       /* Option file                */
                char reserved1[1];      /* Reserved                   */
        } in_data;
 
        /* Output parameters                                          */
        struct {
                char order_id[16];      /* Order Id                   */
                unsigned long rc;       /* Return code                */
                char ret_msg[160];      /* Return message             */
                unsigned long asti_rc;  /* Return code from ASTI      */
                char msg_id[7];         /* Message Id                 */
                char reserved2[1];      /* Reserved                   */
        } out_data;
};
 
/*  Entry for YMLSML  */
#ifdef __SNI_HOST_BS2000
#ifdef __cplusplus
extern "C" void _SVC(int, void*);
inline void YMLSML(struct YMLSML_pl_mdl& param)
{_SVC(20, &param);}
#else
void _SVC(int, void*);
#define YMLSML(p) _SVC(20, &p)
#endif
#endif
 
 
/* Tag value(s) for struct _general                                   */
/* ENUM tag_s                                                         */
#define YMLSML_tag_from 1               /* from                       */
#define YMLSML_tag_fake_from 2          /* fake_from                  */
#define YMLSML_tag_to 3                 /* to                         */
#define YMLSML_tag_fake_to 4            /* fake_to                    */
#define YMLSML_tag_cc 5                 /* cc                         */
#define YMLSML_tag_fake_cc 6            /* fake_cc                    */
#define YMLSML_tag_bcc 7                /* envelope recipient mail    */
                                        /* addresses                  */
#define YMLSML_tag_replyto 8            /* reply_to                   */
#define YMLSML_tag_subject 9            /* subject                    */
#define YMLSML_tag_cont_type 18         /* content_type               */
#define YMLSML_tag_optfile 20           /* option file                */
#define YMLSML_tag_keyfile 21           /* key file                   */
#define YMLSML_tag_signfile 22          /* signer certificate file    */
#define YMLSML_tag_scertfile 23         /* additional signer          */
                                        /* certificates file          */
#define YMLSML_tag_rcertfile 24         /* recipient certificate file */
#define YMLSML_tag_crlfile 25           /* CRL file                   */
#define YMLSML_tag_cafile 26            /* CA file                    */
#define YMLSML_tag_att_name 27          /* Attachment name            */
 
/* Input parameters                                                   */
struct YMLSML_general {
        unsigned short tag;             /* tag of general parameter   */
        char reserved[2];               /* reserved                   */
        unsigned long len;              /* general parameter length   */
};
 
/* Tag value(s) for struct _add_header                                */
/* ENUM tag_s                                                         */
#define YMLSML_tag_add_header 10        /* add. header                */
 
/* Input parameters                                                   */
struct YMLSML_add_header {
        unsigned short tag;             /* tag of add. header         */
        char reserved[2];               /* reserved                   */
        unsigned long len_field_name;   /* add. header name length    */
        unsigned long len_field_body;   /* add. header body length    */
};
 
/* Tag value(s) for struct _data_spec                                 */
/* ENUM tag_s                                                         */
#define YMLSML_tag_data_spec 15         /* dataspec                   */
 
/* Type of data specification                                         */
/* ENUM type_s                                                        */
#define YMLSML_file 1                   /* file                       */
#define YMLSML_data 2                   /* data                       */
 
/* Data specification                                                 */
struct YMLSML_data_spec {
        unsigned short tag;             /* tag of add. header         */
        unsigned char type;             /* specification type         */
 
        /* options                                                    */
        struct /* options */ {
                char del_file: 1;       /* delete file                */
                char destroy: 1;        /* destroy when deleting      */
                char lock_file: 1;      /* lock file                  */
                char unused: 5;         /* unused                     */
        } options;
        unsigned long len;              /* length of data. spec.      */
};
 
/* Tag value(s) for struct _charset                                   */
/* ENUM tag_s                                                         */
#define YMLSML_tag_charset 16           /* character set              */
 
/* Binary data selection                                              */
/* ENUM bnry_s                                                        */
#define YMLSML_yes 1                    /* YES                        */
#define YMLSML_no 2                     /* NO                         */
 
/* Data specification                                                 */
struct YMLSML_charset {
        unsigned short tag;             /* tag of add. header         */
        unsigned char binary;           /* binary data                */
        char reserved[1];               /* reserved                   */
        unsigned long len;              /* length                     */
        char src_charset_XHCS[8];       /* src_charset_XHCS           */
        char dest_charset_XHCS[8];      /* dest_charset_XHCS          */
};
 
/* Tag value(s) for struct _encoding                                  */
/* ENUM tag_s                                                         */
#define YMLSML_tag_encoding 17          /* transfer encoding          */
 
/* Type of encoding mechanism                                         */
/* ENUM mech_s                                                        */
#define YMLSML_7bit 1                   /* 7 bit                      */
#define YMLSML_8bit 2                   /* 8 bit                      */
#define YMLSML_binary 3                 /* binary                     */
#define YMLSML_qp 4                     /* quoted printable           */
#define YMLSML_b64 5                    /* base64                     */
 
/* Encoding                                                           */
struct YMLSML_encoding {
        unsigned short tag;             /* tag of encoding            */
        unsigned char mechanism;        /* encoding mechanism         */
        char reserved[1];               /* reserved                   */
};
 
/* Tag value(s) for struct _cont_disp                                 */
/* ENUM tag_s                                                         */
#define YMLSML_tag_cont_disp 19         /* content disposition        */
 
/* Disposition type                                                   */
/* ENUM disptype_s                                                    */
#define YMLSML_inline 1                 /* inline                     */
#define YMLSML_attachment 2             /* attachment                 */
 
/* Content disposition                                                */
struct YMLSML_cont_disp {
        unsigned short tag;             /* tag of content disposition */
        unsigned char disp_type;        /* content disposition        */
        char reserved[1];               /* reserved                   */
};
 
/* Tag value(s) for struct _msg_att                                   */
/* ENUM tag_s                                                         */
#define YMLSML_tag_msg_begin 11         /* msg_begin                  */
#define YMLSML_tag_msg_end 12           /* msg_end                    */
#define YMLSML_tag_att_begin 13         /* att_begin                  */
#define YMLSML_tag_att_end 14           /* att_end                    */
 
/* Bracketing message or attachment specification                     */
struct YMLSML_msg_att {
        unsigned short tag;             /* tag of msg | att           */
        char reserved[2];               /* reserved                   */
};
 
#endif /* _YMLSML_H_VERSION_3 */
 
#endif          /* _YMLSML_H */

Notes on the definition of the input section for the mail parameters

  • The current implementation of the subsystem limits the size of the mail parameters to 63 kB. This limit is only likely to be reached if the text of the e-mail or data in the attachments is inserted directly in the e-mail’s parameter section. If this error occurs, write the e-mail text in a (temporary) file, and specify only the file name in the parameter section.

  • The reserved header fields must be initialized with binary zeroes.
  • The data of a variable length begins immediately after the associated header. The headers must be designed for full word length. You therefore have to insert filler bytes when the variable part contains a number of bytes that is not a multiple of 4.

  • The field name of the mail header must be entered in the data structure for additional headers without the subsequent colon.

  • The order in which the data structures occur is irrelevant unless stated otherwise.

  • The definition of the mail text or an attachment must be nested within two YMLSML_msg_att data structures, where

    tag = YMLSML_tag_msg_begin / YMLSML_tag_msg_end

    or

    tag = YMLSML_tag_att_begin / YMLSML_tag_att_end

    The definition of the mail text or an attachment can contain data structures with the following tags:

    YMLSML_tag_{data_spec, charset, encoding, cont_type}

    If a YMLSML_charset data structure is outside a nesting with the YMLSML_tag_msg_att data structure, it is applied to the subsequent header lines (see RFC 2047) and to subsequent messages or attachments without their own character set specification.

  • Files must remain unchanged until the e-mail is sent.