Debugging the Email Engine on UNIX


To enable the -Dmail.debug=true debug mode option for UNIX, perform the following steps.

  1. In the emaild.sh script, add the following option to the line that starts the Java process in the emaild.sh script:

    -Dmail.debug=true
  2. Edit the emaild.sh script from:

    exec ${JAVA_BIN}/java -Djava.library.path=${InstallPath} -cp ${CP_PATH}                          com.bmc.arsys.emaildaemon.EmailDaemon -d ${InstallPath} >${LogFile} 2>&1

    to the following content:

    exec ${JAVA_BIN}/java ${JAVA_START_OPTS} ${JAVA_OPTS} -Djava.library.path=${InstallPath} -Duser.dir=${InstallPath} -Demail.console.output=false -Dmail.debug=true -cp ${CP_PATH} \
    com.bmc.arsys.emaildaemon.EmailDaemon -d ${InstallPath} -f "${TMPDIR}" >${LogFile} 2>&1
  3. Stop and start the Email Engine.


Example of outgoing email using SMTP

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG: SMTPTransport trying to connect to host "cruiser", port 25
DEBUG SMTP RCVD: 220 cruiser.bmc.com ESMTP Sendmail 8.11.6+Sun/8.11.6; Mon, 10 Feb 2004 12:19:35 -0800 (PST)
DEBUG: SMTPTransport connected to host "cruiser", port: 25
DEBUG SMTP SENT: EHLO cruiser.bmc.com
DEBUG SMTP RCVD: 250-cruiser.bmc.com Hello cruiser.bmc.com [10.4.30.23], pleased to meet you
250-ENHANCEDSTATUSCODES
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ONEX
250-ETRN
250-XUSR
250 HELP
DEBUG SMTP Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP Found extension "EXPN", arg ""
DEBUG SMTP Found extension "VERB", arg ""
DEBUG SMTP Found extension "8BITMIME", arg ""
DEBUG SMTP Found extension "SIZE", arg ""
DEBUG SMTP Found extension "DSN", arg ""
DEBUG SMTP Found extension "ONEX", arg ""
DEBUG SMTP Found extension "ETRN", arg ""
DEBUG SMTP Found extension "XUSR", arg ""
DEBUG SMTP Found extension "HELP", arg ""
DEBUG SMTP: use8bit false
DEBUG SMTP SENT: MAIL FROM:
DEBUG SMTP RCVD: 250 2.1.0 ... Sender ok
DEBUG SMTP SENT: RCPT TO:
DEBUG SMTP RCVD: 250 2.1.5 ... Recipient ok
Verified Addresses
rsteck@bmc.com
DEBUG SMTP SENT: DATA
DEBUG SMTP RCVD: 354 Enter mail, end with "." on a line by itself
DEBUG SMTP SENT:
DEBUG SMTP RCVD: 250 2.0.0 h1AKJZh09819 Message accepted for delivery

Example of incoming email using MBOX

You can see the lock file gets created--the file is read and saved, and then the lock is removed.

# tail -f emaild.sh_log
DEBUG: java.io.FileNotFoundException: /usr/java1.5.0/j2se/jre/lib/javamail.address.map (No such file or directory)
DEBUG: getProvider() returning javax.mail.Provider[STORE,mbox,gnu.mail.providers.mbox.MboxStore,dog@gnu.org]
mbox: creating /var/mail/arsystem.lock
mbox: reading /var/mail/arsystem
mbox: saving /var/mail/arsystem
mbox: removing /var/mail/arsystem.lock
mbox: creating /var/mail/arsystem.lock
mbox: reading /var/mail/arsystem
mbox: saving /var/mail/arsystem
mbox: removing /var/mail/arsystem.lock
mbox: creating /var/mail/arsystem.lock
mbox: reading /var/mail/arsystem
mbox: saving /var/mail/arsystem
mbox: removing /var/mail/arsystem.lock
mbox: creating /var/mail/arsystem.lock
mbox: reading /var/mail/arsystem
mbox: saving /var/mail/arsystem
mbox: removing /var/mail/arsystem.lock

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*