LINUX programming

Moderators: ITA
Number of threads: 1339
Number of posts: 2924

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
POSTFIX help wanted Posted by antons on 2 Sept 2008 at 7:49 AM
Hi all
I am a novice Linux user. We use IBM Universe BASIC on a Linux platform.
An administrator configured POSTFIX, then I googled until I figured out how to use the thing, manually. Now I'm trying to send email from a Universe program. It almost works perfectly. Here is the source code:

DATA ""
DATA "."
EXECUTE 'SH -c "nail antons@leobs.co.za -r antons@leobs.co.za -s testing123"'

DATA will put "keyboard input" on a stack, until the system 'prompts' for it, and then it just takes it from the stack. The first DATA is just an ENTER keypress, the second is supposed to be CTRL-D, but the full stop does the same, except that is does not attach junk to the email.
Instead, the message body contains ".", which is fine kind of, but I would like it to be 100%.
It's almost like when the Linux shell runs, it does not care anymore about DATA or any other Universe command, because control is now at a different level. To be honest, I'm not even sure why the "." works.
Anyone, how can I 'feed' the CTRL-D along with the rest of the email data to the Linux level (oterwise it just hangs, waiting for it..)??
I know this is kind of a weird one, but any insights or advice would be great.
Thanks a lot

Report
Re: POSTFIX help wanted Posted by antons on 30 Sept 2008 at 5:49 AM
The Linux consultant said I should try adding “</dev/null” at the end of the nail command. I tried it and it resolved all my ctrl-D and related issues.
My test program now looks like this:

DATA ""
DATA CHAR(4)
EXECUTE 'SH -c "nail antons@leobs.co.za -r antons@leobs.co.za -s testing123 </dev/null"'




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.