LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-01-2013, 03:03 AM   #16
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389

Quote:
Originally Posted by sysmicuser View Post
I say attachment means I say that I am not getting email with those two files.
Yes I looked in the email there is nothing in that.
Code:
begin 640 script1-part-1_31-Aug-2013.csv
<unreadable stuff>
end
begin 640 script1-part-2_31-Aug-2013.csv
<unreadable stuff>
end
Instead of 640 I see 700 because I have explicitly changed the permissions. yes I could see like that, why you ask? Is that the reason it is unable to send an attachment?
Your answer is confusing. You say you see nothing like the above and you say 640 is 700, which indicates that there is something present like the above.

I can only assume that the attachments _are_ part of the email and that your script works as it should.

Quote:
Originally Posted by sysmicuser
Further investigation reveals that even if I do something like this

uuencode file1.csv file1.csv|mailx -s "test" user@test.com

I am not getting email at all? However same email can be sent "outside" the shell script. I did echo $? just after this command and get return code as 0 ! all confusing
I'm at a loss to be honest, the script seems to be working. Only thing that comes to mind is a possible mail problem, but I'm not sure what problem that might be.

I would try to break things down in smaller pieces and try to trouble-shoot the problem that way.

- try using mail (without an attachment) from the command line.
- try using mail with an attachment from the command line.
- try a simple script that only mails a simple message (no attachment):
Code:
#!/bin/bash
echo "testing 1 2 3" | mailx -s "Testing" user@valid.address
If that works try a simple script that uses uuencode:
Code:
#!/bin/bash
echo "testing 1 2 3" > /tmp/testing
uuencode /tmp/testing /tmp/testing | mailx -s "Testing" user@valid.address
rm /tmp/testing
Do have a look at the log files to see if there are any messages related to the above (mail log comes to mind, but do check other logs as well).

BTW: Its druuna and not druna or drunna.
 
1 members found this post helpful.
Old 09-01-2013, 07:58 AM   #17
sysmicuser
Member
 
Registered: Mar 2010
Posts: 353

Original Poster
Rep: Reputation: 0
@druuna
Quote:
Your answer is confusing. You say you see nothing like the above and you say 640 is 700, which indicates that there is something present like the above.

I can only assume that the attachments _are_ part of the email and that your script works as it should.
Apologies for incorrect spelling your name and thank you for bringing it to my attention.

I am not articulative when it comes to communication. Yes I agree my response is indeed confusing.
Kindly allow me to elaborate on the problem, I guess you have got it what the problem is.

Script is able to generate the csv file that is true but I am NOT getting any email with those attachments(csv files)

Quote:
- try using mail (without an attachment) from the command line.
- try using mail with an attachment from the command line.
- try a simple script that only mails a simple message (no attachment):
All the above works on command line also I could successfully run your script but I have absolutely no idea why the heck it is not working for script

I have no idea what the problem could be, it could be with uuencode itself or mailx.

If I run manually the uuencode and pipe it with mailx I am get that attachment but why not inside the script? what is that which is blocking? is there any way to further debug? There is no log file because it is just matter of running report by connecting to database and exporting those reports to users.
 
Old 09-01-2013, 09:38 AM   #18
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
If, looking at post #16, both the command line tests and the simple script tests work on your machine then there is nothing wrong with either mail or uuencode.

That leaves one thing that I can think of: You are getting the attachments, but they are "empty". That in turn would point to the sql statements not doing their job.

Run the script (the one from post #9, with the correct password and .ora file) and check the content of report_1 and report_2

About checking the logs: I'm not talking about logs generated by the script (their aren't any), but the mail/oracle(sql) logs. Most of the logs can be found in /var/log (not sure where the oracle/sql logging takes place on your box).
 
1 members found this post helpful.
Old 09-01-2013, 10:03 AM   #19
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,688

Rep: Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259Reputation: 1259
Is it possible that your mail server is stripping attachments when they are formatted as uuencode files?

You should be able to see what being sent by mailx (use the -v option). If you see the attachments in the verbose output, then the mail server has to be stripping them.
 
1 members found this post helpful.
Old 09-03-2013, 07:20 AM   #20
sysmicuser
Member
 
Registered: Mar 2010
Posts: 353

Original Poster
Rep: Reputation: 0
@all

It is quite embarrassing to say it was a simple user error. There was a typo in domain of email address causing it to fail. Learnt it the hard way though
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
totem-pps plugin doesn't seem to work (doesn't show up) prushik Linux - Software 1 07-29-2013 09:51 AM
Google Hangout doesn't work, and Mplayer doesm't work without -ao alsa flagGoogle H ranban282 Linux - Software 0 02-20-2012 04:23 AM
Keyboard doesn't work right click on mouse doesn't work ramblinrick Linux Mint 2 10-15-2010 01:10 AM
DNS lookup doesn't work, ping, firefox will not work properly lovemov Linux - Networking 2 04-23-2009 02:30 PM
logout in x doesn't work and nvidia doesn't boot Meriadoc Linux - Newbie 2 06-18-2004 12:32 PM


All times are GMT -5. The time now is 08:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration