Solved

How to send a mail without having auto newline in the body?

Posted on 2006-10-25
6
256 Views
Last Modified: 2013-12-16
Hi All,

I am trying to send a mail with a long singline line as a message body. Whenever i send the message, an auto-newline is getting inserted in after certain number of characters (991 characters). This is destroying the structure of my email. How to fix this?
To simulate this issue, try to send a mail (using 'mail' command)  arround 1000-1500 chars in a single line.  Is it a sendmail limitation? I am getting this issue at postfix and sendmail at my fedora core 3 and centos 4.3 installations. I didnt try it at other versions or OS.

Any suggestions on this will be greately appreciated.

Thanks,
Bimal Mankara
0
Comment
Question by:bimal_linux
  • 3
  • 2
6 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 17802500
try using sendmail directly
cat << EOF | /usr/sbin/sendmail target@address.tld
From: me
To: target@address.tld
Subject: some subject

The very long line
EOF
0
 
LVL 6

Author Comment

by:bimal_linux
ID: 17802626
Hi,

Thank you for the quick response. I tried that, but still getting newline characters after 990th one.

Regards,
Bimal
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 500 total points
ID: 17802857
Then it's MTA who is splitting the line.
For postfix, there are such settings in main.cf (bringing defaults here) - bump them.
line_length_limit = 2048
smtp_line_length_limit = 990
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 14

Expert Comment

by:chris_calabrese
ID: 17803309
SMTP based email does not guarantee that plain text emails will arrive in the exact format was sent. If you want to ensure that the line is not broken, you'll have to encode the data in e.g. uuencode or base-64.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17803343
chris_calabrese: good point.
Even if You bump those values I provided it will only work if the mail is delivered locally. Any remove MTA will cut it anyway...
0
 
LVL 6

Author Comment

by:bimal_linux
ID: 17864562
"               The maximum total length of a text line including the
               <CRLF> is 1000 characters (but not counting the leading
               dot duplicated for transparency)."
From SMTP RFC (http://www.ietf.org/rfc/rfc0821.txt)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question