Operating System - Linux
1752815 Members
6158 Online
108789 Solutions
New Discussion юеВ

mailx truncate line exceed tot characters

 
Alessio Solouki
Regular Advisor

mailx truncate line exceed tot characters

I can't send send mail with line with length of 3000 characters, this line are truncated...
I use the command:

cat file|mailx -s "subject" name@domain.com

Why? It's possibile change some parameters in mailx.rc or sendmail.cf for increasing max characters for line?

Thanks!
-----------------------
8 REPLIES 8
itai weisman
Super Advisor

Re: mailx truncate line exceed tot characters

do you have the same problem when using
# mailx -s "subject" name@domain.com < file

?

Alessio Solouki
Regular Advisor

Re: mailx truncate line exceed tot characters

Yes, is the same...
-----------------------
Peter Godron
Honored Contributor

Re: mailx truncate line exceed tot characters

Alessio,
you are sending > 3000 char on ONE line ?
How did you create the data ?
Are you sure it is not your editor truncating?
Have you tried creating a 3000 char single line file and sending it; how big is the file when you receive it? If it is 3000 char , then all the data was sent.
Alessio Solouki
Regular Advisor

Re: mailx truncate line exceed tot characters

>Alessio,
>you are sending > 3000 char on ONE line ?
Yes

>How did you create the data ?
Java log read from OV Operation

>Are you sure it is not your editor >truncating?
Which editor? No no, OV Operation pass the line to my script that send it with mailx...

>Have you tried creating a 3000 char single >line file and sending it; how big is the >file when you receive it? If it is 3000 >char , then all the data was sent.
Yes I've tried, ma file contains one lineof 3000 char but I receive a mail with only 2000 char approximately


-----------------------
Peter Godron
Honored Contributor

Re: mailx truncate line exceed tot characters

Alessio,
if there are no control characters forcing termination, all I can think of is that the
MAXLINE identifier in conf.h for smtp is set.

See your sendmail code directory.
"#define MAXLINE 2048 /* max line length */"
Dennis Handly
Acclaimed Contributor

Re: mailx truncate line exceed tot characters

I suppose you could shar -Z the file, mail that then unshar it.
OldSchool
Honored Contributor

Re: mailx truncate line exceed tot characters

Use "fold" to break the line at whitespace.

cat file | fold -s -w 80 | mailx.......


Will break the file into lines of no more than 80 character per line. The breaks will occur at whitespace between words.

"man fold" for other options and details

good luck...scott
Bill Hassell
Honored Contributor

Re: mailx truncate line exceed tot characters

email is used for a LOT of files for which it was never designed. For binary files, you must encapsulate the file with shar but for extremely long line files from JavaJunk, you'll need to fold the line or better yet, use adjust as in:

adjust -m78 JavaLogFile | mailx -s "Java log" name@machine.com

adjust is particularly nice as it folds the line at the nearest breakpoint (ie, space or tab).


Bill Hassell, sysadmin