Technical article 109647

sendmail inserts an exclamation point and carriage return into mail messages.

OpenServer 5.0.4OpenServer 5.0.5

Written · Last revised

Problem

Mail delivered via sendmail 8.8.5 (or later) arrives with an exclamation point and carriage return inserted into lines that are over 990 characters long. That is, these long lines are split and text up to the split is first transmitted followed by the ! character; the remaining portion is transmitted as a new line.

Cause

Prior to version 8.8.5, there was no line limit specified for sendmail. With 8.8.5 and later, the line limit defaults to 990 characters. This line limit option is helpful with programs that cannot handle long lines; however, it can also cause applications expecting data in a given format to fail when the added exclamation point and carriage return are encountered.

Solution

To change or eliminate the line length limit, follow these steps:

As root, edit the /usr/lib/sendmail.cf file.

Go to the SMTP mailer specification by searching for the string Msmtp. You will see the following definitions:

Msmtp,          P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n,
                L=990, A=IPC $h
Mesmtp,         P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n,
                L=990, A=IPC $h
Mrelay,         P=[IPC], F=mDFMuXa, S=11/31, R=61, E=\r\n,
                L=2040, A=IPC $h

Change the L= equate to L=0 to remove the line length limit for any of these delivery agents. You can also change the line length limit to a value that best suits your needs.

After making the changes, save and exit the sendmail.cf file, and restart the sendmail daemon by finding the sendmail process ID with:

# ps -ef | grep sendmail
Then restart the process by typing:
# kill -1 <PID>

where <PID> is the process ID of the sendmail process.

See also

Bryan Costales with Eric Allman, "sendmail", O'Reilly & Associates, Inc., page 528

From the Xinuos technical article database, record 109647. Reproduced with permission. The original is at www.sco.com/ta/109647, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.