republican-creole
Search:  

 
 
   All ForumsHot TopicsGallery






how-to block ads


 
Forums » Tech and Talk » OS and Software » All Things Unix » 'find' and 'sendmail'
Uniqs:
449
Share Topic:
RSS topic:
toggle:
flat / full
normal / watch
Posting:
Post a:
Post a:
Can Linux Survive? »
« [FreeBSD] Disk read corruption issues on server.  
DprssdIsntFn
Premium
join:2004-01-12
Pompton Lakes, NJ


2 edits

'find' and 'sendmail'

I'm working on a very old version of DG-UX (1994) using the Bourne shell: 'sh'

The ultimate goal is to create a daemon which will invoke sendmail (v8.4.x) to send all the emails in a directory.

The version of 'sh' is quite primitive. I can manually invoke sendmail using the command:
I had thought that some variation such as:
would find and send all the emails in the directory. However, I get some variation on
no matter what I try.

Could someone please let me know what I'm doing wrong or suggest alternative ways of doing the same thing?

Thanx!!

edit

The problem is that I always end up with a space between angle bracket and the expansion of '{}' like so:
sendmail requires that there be no space between angle bracket and the expanded argument. e.g.

Thoughts? Advice?

I'm currently looking at building an interim file and using sed on it and then pulling up each resulting line as the full command to be executed but ... that would certainly not be elegant!

PetePuma
How many lumps do you want
Premium,MVM
join:2002-06-13
Arlington, VA

Re: 'find' and 'sendmail'

said by DprssdIsntFn See Profile :

sendmail requires that there be no space between angle bracket and the expanded argument. e.g.

I'm curious to see what other folks say. However I can't see why Sendmail would have any visibility into what the shell does in terms of redirection. Are you sure the space is the only problem?

nwrickert
sand groper
Premium,MVM
join:2004-09-04
Geneva, IL
·AT&T U-Verse
·AT&T Midwest

Re: 'find' and 'sendmail'

You are correct. The space is a bogus issue.

I think the problem here is that "<" is a shell meta-character, but "find" is passing that directly to sendmail, bypassing the shell. So there is nothing to interpret "<" as file redirection.

Simplest would be to write a short shell script to mail one file, and then use that shell script as command that is run by "find ... -exec".
--
AT&T dsl; Westell 2200 modem/router; SuSE 10.1; firefox 2.0.0.4

nixen
Rockin' the Boxen
Premium
join:2002-10-04
Alexandria, VA
·Cox HSI
·Speakeasy

Umm... are these queue files or regular text files you're looking to mail. If the former, why not simply invoke sendmail with the QueueDirectory option and the "run queue now" option?
--
Everyday, thousands of new cars are delivered to their new owners with poorly-selected radio station presets.
DprssdIsntFn
Premium
join:2004-01-12
Pompton Lakes, NJ

Re: 'find' and 'sendmail'

Thanx for the responses so far. To answer some of the questions:

These are regular files.

Here are some sample attempts and corresponding results:

1} This example works:
result:
None of the following example(s) work. What you see here are different combinations of different things I've tried. i.e. one from column A, one from column B ...

The results below are typical.

Results part 1. Here, I've not answered 'y' to the 'xarg' prompts. This is just to show that the command to be executed is properly formed as in the working example above.
This is a snip of actual results.
The problem I had with the automatic insertion of the space between '' and 'email/file' I got around through the use of sed and temporary files.

If I execute the sendmail command directly in a script, it works fine. If I attempt to use either 'exec' or 'xargs', it fails.

This version of the DG-UX OS was last updated in 1998. This box was installed in 1994. I really, really don't like working with antique OSes!

Ugh!

Any more thoughts or ideas?

nixen
Rockin' the Boxen
Premium
join:2002-10-04
Alexandria, VA

Re: 'find' and 'sendmail'

Why not use mailx instead of trying to figure out sendmail?
DprssdIsntFn
Premium
join:2004-01-12
Pompton Lakes, NJ

Re: 'find' and 'sendmail'

said by nixen See Profile :

Why not use mailx instead of trying to figure out sendmail?
I actually started out with mail(x). On this system, mail(x) calls sendmail to send mail. I got absolutely nowhere with it.

The problem isn't with sendmail. It's with this version of 'sh'. I've finally tracked the problem down to how 'xarg' and 'exec' are parsed from within a 'sh' script. The parsing is not correct when redirection of a file to standard input is involved. For most cases, the parsing works fine. Just not in this case.

I'm taking a different approach entirely. Instead of writing just emails to a directory, I'm also writing short, 3-line 'sh' scripts to another directory. Then I select that directory and execute the scripts there.

Fortunately, this is a relatively low volume application.
Forums » Tech and Talk » OS and Software » All Things UnixCan Linux Survive? »
« [FreeBSD] Disk read corruption issues on server.  


Saturday, 28-Nov 10:03:42 Terms of Use | Privacy Policy | Hosting by www.nac.net - DSL,Hosting & Co-lo | feedback | contact
over 10 years online! © 1999-2009 dslreports.com.
page compression OFF
Most commented news this week
· [121] Time Warner Cable Fires Broadside At Broadcasters
· [112] New AT&T Ad Campaign Hits Back At Verizon
· [96] Apple Joins AT&T Verizon Snark Fest
· [87] New Bill Takes Aim At Higher Verizon ETFs
· [72] TiVo Sees Record Customer Losses
· [69] In-Flight Internet Headed For Bumpy Landing?
· [69] Verizon CEO: Hulu Will Be Dead Soon
· [62] Thanksgiving Open Thread
· [54] Weekend Open Thread
· [40] EFF Wages War On Fine Print
Most people now reading
· Windows 7 boot manager editing questions [Microsoft Help]
· Backstab vs screws (not which to use) [Home Repair & Improvement]
· [Extreme Plus] Issues hosting on Xbox Live [Rogers]
· Motion Sickness Solutions? [General Questions]
· Using AirMax to provide triple play services? [Wireless Service Providers]
· 5 hour energy for diabetic [General Questions]
· [Newsgroups] Newzleech down? [Filesharing Software]
· Why not just turn off the ignition? [Automotive]
· Is Gear Score now the new requirement to get pug invite? [World of Warcraft]
· Why does it take so long? Mail question [General Questions]