Solved

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

Posted on 2006-10-25
6
251 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Suggested Solutions

Title # Comments Views Activity
Linux tcp ports listening for testing 4 47
Linux as a middle box 7 64
gdb doesn't stop on breakpoint 2 50
installing LSI MegaRAID Storage Manager on CentOS 7 22 97
rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now