Solved

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

Posted on 2006-10-25
6
258 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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

820 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