Strange Issue with sendmail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Strange Issue with sendmail
# 1  
Old 08-30-2016
CPU & Memory Strange Issue with sendmail

more works.sh
Code:
#!/bin/ksh

{
        print "From: reportgenerator@myserver.com"
        print "To: randomguy@myfirm.com"
        print "MIME-Version: 1.0"
        print "Content-Type: text/html"
        print "Subject: Disk Report"
        print "<body>"
        print "<table border=1>"
        print "<tr>"
        print "<th bgcolor=#D7D3D3>Disk</th>"
        print "<th bgcolor=#D7D3D3>Growth</th>"
        print "</tr>"
        print "</table>"
        print "<p>Today's by: 999,999</p>"
        print "</body>"
        print "</html>"
} | /usr/sbin/sendmail -t

I run works.sh and i see the table in my email body as expected.

but more fails.sh
Code:
#!/bin/ksh

{
        print "From: reportgenerator@myserver.com"
        print "To: randomguy@myfirm.com"
        print "MIME-Version: 1.0"
        print "Content-Type: text/html"
        print "Subject: Disk Report"
        print "<body>"
        print "<table border=1>"
        print "<tr>"
        print "<th bgcolor=#D3D3D3>Disk</th>"
        print "<th bgcolor=#D3D3D3>Growth Monthly</th>"
        print "</tr>"
        print "</table>"
        print "</body>"
        print "</html>"
} | /usr/sbin/sendmail -t

Does not work as expected. I get email but the HTML Table does not show up ONLY text shows.

The only difference i see if it works when this line is added to the script

print "<p>Today's report shows progress by: 999,999</p>" and fails when removed.

Can you please try to run both of the scripts and see it for yourself. Also, help explain and fix ?

And if both work for you .. still do let me know so we can debug accordingly.

Last edited by mohtashims; 08-30-2016 at 07:21 PM..
# 2  
Old 08-31-2016
I tested your script with three different recipients using GMail, Notes and Roundcube clients and in every situation the HTML table was displayed properly.
# 3  
Old 08-31-2016
maybe including opening html tag:
Code:
#!/bin/ksh

{
        print "From: moderator@myserver.com"
        print "To: randomguy@myfirm.com"
        print "MIME-Version: 1.0"
        print "Content-Type: text/html"
        print "Subject: Disk Report"
        print ""
        print "<html>"
        print "<body>"
        print "<table border=1>"
        print "<tr>"
        print "<th bgcolor=#D3D3D3>Disk</th>"
        print "<th bgcolor=#D3D3D3>Growth Monthly</th>"
        print "</tr>"
        print "</table>"
        print "</body>"
        print "</html>"
} | /usr/sbin/sendmail -t

# 4  
Old 08-31-2016
Try rdrtx1's suggestion, and use ' instead of the single quote.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Strange issue installing Java 8

I just intalled java8_64.jre and .sdk respectively installp -agXYd . Java8_64.jre Java8_64.sdk 2>&1 | tee installp.log Worked like a champ. Now I see this-- jeff@server:/usr> ls -l | grep java drwxr-xr-x 9 bin bin 512 Sep 22 2010 java14 drwxr-xr-x 7 bin bin ... (9 Replies)
Discussion started by: jeffs42885
9 Replies

2. Shell Programming and Scripting

Strange permission issue on Linux server.

Starting sendmail throws this error: I decided to see the permission on the files under /etc/mail and this is the output: # ls -ltr total 284 -rwxr-xr-x. 1 root root 1847 Jan 27 2014 virtusertable -rwxr-xr-x. 1 root root 127 Jan 27 2014 trusted-users -rwxr-xr-x. 1 root root 92... (3 Replies)
Discussion started by: mohtashims
3 Replies

3. UNIX for Dummies Questions & Answers

Strange Keyboard and Mouse Issue

Hello All, PC: CuBox-i (*i.MX6) Mini-PC OS: openSUSE 13.1 (Bottle) (armv7hl) Kernel: 3.14.14-cubox-i # uname -a Linux CuBox-HQ 3.14.14-cubox-i #1 SMP Sat Sep 13 03:48:24 UTC 2014 armv7l armv7l armv7l GNU/LinuxSo I've been having this random issue happen on this PC where a few strange... (12 Replies)
Discussion started by: mrm5102
12 Replies

4. AIX

strange route issue in powerha 5.4?

hi all we upgraded hacmp(powerha) from 5.2 to 5.4 recently . during the failover testing, we found a strange network issue. after standby node took service ip address (172.15.100.8) online at standby NIC, we were able to log in the standby node by telnet 172.15.100.8 which stays at... (1 Reply)
Discussion started by: rs6000er
1 Replies

5. Web Development

Strange Mysql issue

Hi all, I recently changed the name of my hostname from 'abc123' to 'abc456' (as an example). I then added a user in my mysql database with the new host and removed references to the old users and hostname. The strange thing is though, a process using the database still uses the old... (1 Reply)
Discussion started by: muay_tb
1 Replies

6. Solaris

strange issue with ALOM in t51...

Hi , running solaris 10 on t5120 and i see ILOM and ALOM (SC) interfaces working fine earlier and suddenly they are responding strangely, First thing , I can connect fine to ILOM or ALOM but then console -f just hangs.. resetsc error : I do not really want to poweroff and poweron... (13 Replies)
Discussion started by: upengan78
13 Replies

7. UNIX for Advanced & Expert Users

strange aunthentication issue with email

hi again i'm running a centos 4.x box with sendmail and openwebmail. I had a weird situation where users couldn't not get authenticated using a pop mail client but but were able to aunthenticate using the openwebmail webmail client. I looked through the logs and didn't see anything strange. I... (0 Replies)
Discussion started by: mcraul
0 Replies

8. UNIX for Dummies Questions & Answers

Strange issue

I have created a server monitor program in Java that connects to servers via SSH and constantly refreshes the new server load every 3 mins. The problem is that even though it is a Java app running shell commands to get the load info, the commands still appear in 'history'. The question is.. is... (1 Reply)
Discussion started by: AndrewSH
1 Replies

9. Cybersecurity

root Password ... strange issue

hi there , :cool: um facing a problem with my root passwd i want to set my root password and when i do i get the following :: # # passwd passwd: Changing password for root New Password: Re-enter new Password: passwd(SYSTEM): They don't match. Please try again New Password:... (6 Replies)
Discussion started by: badrali
6 Replies

10. UNIX for Advanced & Expert Users

Strange Number comparison issue

Hi, I am comparing two numbers, but it gives strange results: My Code: if then echo "True" else echo "False" fi This code gives False for the follwoing comparison where as True for the following: Any reason for this? Both Should have given False... I am using... (9 Replies)
Discussion started by: shihabvk
9 Replies
Login or Register to Ask a Question