CHKMAILADR      CHECK E-MAIL ADDRESS                   TAAEMLA

 The Check  E-Mail  Address command  checks the  validity  of an  E-Mail
 address.   The local-portion  of an address  is ensured to  have proper
 syntax.   The domain-portion is either  syntax checked or checked using
 APIs to determine if  the domain name exists.   To check if the  domain
 name actually  exists, your  system must have  access to a  domain name
 server.

 For an address like:

            JSmith@abc.com'

 the  'JSmith'  portion  is  the  local-portion  and  'abc.com'  is  the
 domain-portion.

 Typical commands would be:

          CHKMAILADR   EMAIL(JSmith@abc.com)

 The default  of  CHKDMN(*SYNTAX) would  be  used  to syntax  check  the
 entire address.  See the later section on 'Syntax checking rules'.

 If you had specified:

          CHKMAILADR   EMAIL(JSmith@abc.com) CHKDMN(*INTERNET)

 The  local-portion  would  be  syntax checked  and  the  domain-portion
 would  be  checked  using  several  APIs  which  access a  domain  name
 server.   See the  section on  'Domain name  server'.   Responses  from
 these APIs  can be  very slow  and especially  if the  domain does  not
 exist.    The local-portion  is  always syntax  checked,  but does  not
 ensure that the user exists at the domain.

 A  Mail Exchange (MX) record must be able  to be retrieved in order the
 E-mail address  domain to  be verified.   If  the local  host table  is
 used  for host  name resolution,  then E-mail  addresses for  the local
 domain  will be returned as 'Failure:  Domain: No mail exchange records
 found and domain name not found.'

 The code used to access the  internet is derived from that provided  by
 Scott Klement.   See the copyright discussion in  the TAAEMLAR program.

 CHKMAILADR escape messages you can monitor for
 ----------------------------------------------

       TAA9881    Failure - Text includes reason.

 Escape messages from based on functions will be re-sent.

 Syntax checking rules
 ---------------------

   **   Comments  enclosed   in  parenthesis  may  appear  in  both  the
        local-portion and the domain-portion of an address.

   **   If the  local-portion is  not quoted,  the first  character  may
        not be a  period and no character  may be a backslash,  a square
        bracket, a space, or a @.

   **   If  the  local-portion  is  quoted,  any  character  except  the
        backslash is valid.

   **   The  first  unquoted  @  character  separates  the local-portion
        from the domain-portion.

   **   Characters in the  domain-portion must be  a-z, or A-Z, or  0-9,
        or dash.  A dash is not valid in the first position.

   **   The  domain-portion  must  have  at  least  2  parts  which  are
        separated by a period.

      Valid E-mail syntax             Comments
      -------------------             --------

      JSmith@abc.com                  Simple name
      J.Smith@abc.com                 Period is valid in local-portion
      JSmith@abc.def.ghi              Three part domain-portion
      J(the plumber)Smith@abc.com     Comments in parenthesis
      "JSmith"@abc.com                Quotes are not needed
      "J Smith"@abc.com               Quotes needed because of blank
      "J@Smith"@abc.com               Quotes needed because of first @

      Invalid E-mail syntax      Comments
      ---------------------      --------

      J Smith@abc.com            Space in unquoted local-portion
      J@Smith@abc.com            @ in unquoted local-portion
      JSmith@abc                 Domain-portion has only one part
      JSmith.abc.com             No @ to separate domain-portion
      JSmith@abc$.com            $ is invalid in domain-portion

 Domain name server
 ------------------

 Use  the CHGTCPDMN command to specify the  IP addresses of one to three
 domain name servers.

 Your system must have access to the internet.

 Command parameters                                    *CMD
 ------------------

    EMAIL         The  E-Mail  address  to  be  checked.    The  maximum
                  length is 1024 bytes.

    CHKDMN        The  type   of  checking   to  be  performed   on  the
                  domain-portion   of   the   E-mail   address.      The
                  local-portion of the E-mail  address is always  syntax
                  checked.

                  *SYNTAX   is  the   default   to  syntax   check   the
                  domain-portion  of  the   E-mail  address.    See  the
                  section on 'Syntax checking rules'.

                  *INTERNET   may  be  specified   to  use  domain  name
                  servers  to check  the  domain-portion of  the  E-Mail
                  address.   The domain-portion  is not  syntax checked.

                  Specifying   *INTERNET  requires  your  system  to  be
                  configured  with  and  have  access  to  one  or  more
                  domain name  servers.   (see the  previous section  on
                  'Domain  name  server').    APIs  are  used,  but  the
                  responses can  be  very  slow and  especially  if  the
                  domain does not exist.

    RCLACTGRP     A *YES/NO parameter  for whether to reclaim  the named
                  activation group  TAAEMLAR in which  the RPGLE program
                  TAAEMLAR runs.

                  *YES  is the default which  cause the activation group
                  to be reclaimed when CHKMAILADR returns.

                  *NO  should  be  specified  if  you  are  repetitively
                  checking E-mail  addresses.  This  will avoid creating
                  and  deleting  the  activation group.    When  you are
                  finished    checking     E-Mail     addresses,     use
                  RCLACTGRP(*YES) to perform cleanup.

 Restrictions
 ------------

 To check  if the  domain name  actually exists,  your system must  have
 access to a domain name server.

 A Mail  Exchange (MX) record must be able to  be retrieved in order the
 E-mail address  domain to  be verified.   If  the local  host table  is
 used for  host name  resolution, then  E-mail addresses  for the  local
 domain will  be returned as 'Failure: Domain:  No mail exchange records
 found and domain name not found.'

 Prerequisites
 -------------

 The following TAA Tools must be on your system:

      SNDCOMPMSG      Send completion message
      SNDESCINF       Send escape information
      SNDESCMSG       Send escape message

 Implementation
 --------------

 For  CHKDMN(*INTERNET), your  system must  be configured  with and have
 access  to one  or  more  domain name  servers.    See the  section  on
 'Domain name server'.

 Objects used by the tool
 ------------------------

    Object        Type    Attribute      Src member    Src file
    ------        ----    ---------      ----------    ----------

    CHKMAILADR    *CMD                   TAAEMLA       QATTCMD
    TAAEMLAC      *PGM       CLP         TAAEMLAC      QATTCL
    TAAEMLAR      *PGM       RPGLE       TAAEMLAR      QATTRPG

Added to TAA Productivity Tools July 15, 2006


Home Page

Powered by AS/400Powered by AS/400 Last modified on January 12, 2010 © 1995, 2010 - Jim Sloan, Inc.