Troubleshooting
Problem
Extra lines where the first line is the date and time and the second line is a blank line are inserted into the message body section of the received SMTP mail when the mail is submitted via an IEBGENER batch job.
Symptom
Two extra lines are inserted into the message body section of the received SMTP message:
Extra line 1: A date and time
Extra line 2: A blank line
Cause
In the IEBGENER batch job, the message header and message body in the DATA section are NOT separated by an empty line. According to RFC 2822 (section 2.1), the message body in the DATA section is "a sequence of characters that follows the header and is separated from the header by an empty line."
If this rule is not followed, the extra lines could be inserted.
Here's a sample IEBGENER job that would create the extra lines:
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
HELO test
MAIL FROM:<test_mail@test.com>
RCPT TO:<test_mail@test.com>
DATA
TO: Jane Doe
FROM: John Doe
SUBJECT: Test Email
Test Line 1
Test Line 2
.
QUIT
The received mail body would look like:
Test Line 1
Date: Thu, 03 Jan 13 12:16:09 EST
Test Line 2
To fix this, insert an empty line between the header and the message body in the DATA section in the IEBGENER job:
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
HELO test
MAIL FROM:<test_mail@test.com>
RCPT TO:<test_mail@test.com>
DATA
TO: Jane Doe
FROM: John Doe
SUBJECT: Test Email
Test Line 1
Test Line 2
.
QUIT
Resolving The Problem
In the IEBGENER batch job, make sure that there is an empty line between the header and the message body in the DATA section.
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21621559