[SuSE Linux] sendmail / .forward / executables ???
I've got an aliase setup (vote@benham.net) that's supposed to filter all mail through a custom filter. I have a one-line .forward file: /home/vote/bin/test.sh test.sh consists of two lines #!/bin/bash cat > test endmail uses /bin/sh as it's mail shell and -r is NOT turned on... so... why does the mail get bounced with the following respone:? 550 /home/debian-vote/.forward: line 2: /home/vote/bin/test.sh... Can't create output: Executable files not allowed ---------------------------------- <A HREF="http://benham.net/index.html"><A HREF="http://benham.net/index.html</A">http://benham.net/index.html</A</A>> -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d+(-) s:+ a29 C++$ UL++>++++ P+++$ L++>++++ E? W+++$ N+(-) o? K- w+++$(--) O M-- V- PS-- PE++ Y++ PGP++ t+ 5 X R+ !tv b++++ DI+++ D++ G++>G+++ e h+ r* y+ ------END GEEK CODE BLOCK------ ---------------------------------- - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Hi, everyone! I just noticed this today. I telneted to my machine from work and ran w --> it showed no one logged in. ?????? Same result was reported by finger and who. I ran ps aux --> there is a telnet session open (in.telnetd owned by root). I opened another telnet session. w, finger, who showed one user. But there were two in.telnetd processes. I closed all sessions and opened a new one --> now back to normal (w shows one user). Any ideas? Any help is appreciated, alexm - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Your are missing one character in your .forward file. When you want to run a program that is specified in the .forward, you must preceed the executable file must be preceeded with a pipe, i.e. .forward is a single line file containing: |/home/vote/bin/test.sh Of course, you could just make it the following: |cat > test Sometimes you have to specify the name of the interpreter, as in |/bin/sh /home/vote/bin/test.sh This is in case the paths aren't set properly, but in linux (at least redhat linux), I know from experience that the paths are set correctly. Good luck! Bill Coffman On Mon, 24 Aug 1998, Darren Benham wrote:
I've got an aliase setup (vote@benham.net) that's supposed to filter all mail through a custom filter.
I have a one-line .forward file: /home/vote/bin/test.sh
test.sh consists of two lines #!/bin/bash cat > test
sendmail uses /bin/sh as it's mail shell and -r is NOT turned on... so...
why does the mail get bounced with the following respone:?
550 /home/debian-vote/.forward: line 2: /home/vote/bin/test.sh... Can't create output: Executable files not allowed
---------------------------------- <A HREF="http://benham.net/index.html"><A HREF="http://benham.net/index.html</A">http://benham.net/index.html</A</A>> -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d+(-) s:+ a29 C++$ UL++>++++ P+++$ L++>++++ E? W+++$ N+(-) o? K- w+++$(--) O M-- V- PS-- PE++ Y++ PGP++ t+ 5 X R+ !tv b++++ DI+++ D++ G++>G+++ e h+ r* y+ ------END GEEK CODE BLOCK------ ---------------------------------- - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
- To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Thanks Bill. You know. I was thinking of the pipe on the way into work this morning :/ On 25-Aug-98 Bill Coffman wrote:
Your are missing one character in your .forward file. When you want to run a program that is specified in the .forward, you must preceed the executable file must be preceeded with a pipe, i.e. .forward is a single line file containing:
|/home/vote/bin/test.sh
Of course, you could just make it the following:
|cat > test but in my case, the real script I want run is more complicated then that.
Darren ---------------------------------- <A HREF="http://benham.net/index.html"><A HREF="http://benham.net/index.html</A">http://benham.net/index.html</A</A>> -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d+(-) s:+ a29 C++$ UL++>++++ P+++$ L++>++++ E? W+++$ N+(-) o? K- w+++$(--) O M-- V- PS-- PE++ Y++ PGP++ t+ 5 X R+ !tv b++++ DI+++ D++ G++>G+++ e h+ r* y+ ------END GEEK CODE BLOCK------ ---------------------------------- - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Hi, On Tue, 25 Aug 1998, Darren Benham wrote:
but in my case, the real script I want run is more complicated then that.
Have you looked at procmail? Maybe this will do what you need. LenZ ------------------------------------------------------------------ Lenz Grimmer S.u.S.E. GmbH <A HREF="mailto:grimmer@suse.de">mailto:grimmer@suse.de</A> Gebhardtstrasse 2 <A HREF="http://www.suse.de"><A HREF="http://www.suse.de</A">http://www.suse.de</A</A>> 90762 Fuerth, Germany - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Possible could but I don't know procmail. I do know, however, scripting. On 25-Aug-98 Lenz Grimmer wrote:
Have you looked at procmail? Maybe this will do what you need.
---------------------------------- <A HREF="http://benham.net/index.html"><A HREF="http://benham.net/index.html</A">http://benham.net/index.html</A</A>> -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d+(-) s:+ a29 C++$ UL++>++++ P+++$ L++>++++ E? W+++$ N+(-) o? K- w+++$(--) O M-- V- PS-- PE++ Y++ PGP++ t+ 5 X R+ !tv b++++ DI+++ D++ G++>G+++ e h+ r* y+ ------END GEEK CODE BLOCK------ ---------------------------------- - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Hi! Trying to kill the keyboard, gecko@benham.net produced:
Possible could but I don't know procmail. I do know, however, scripting.
You should really have a look at man promailex (examples) and man procmailrc to see if whatever you want is already there. Procmail (and formail) is faster than shell scripting and thus won't hurt if you get tons of email all at the same time, either. And it's for processing and filtering mail. -Wolfgang -- PGP 2 welcome: Mail me, subject "send PGP-key". If you've nothing at all to hide, you must be boring. Unsolicited Bulk E-Mails: *You* pay for ads you never wanted. Is our economy _so_ weak we have to tolerate SPAMMERS? I guess not. - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
+----- On Mon, 24 Aug 1998 16:44:19 PDT, Darren Benham writes: | | I've got an aliase setup (vote@benham.net) that's supposed to filter all mail | through a custom filter. | | I have a one-line .forward file: | /home/vote/bin/test.sh | | test.sh consists of two lines | #!/bin/bash | cat > test | | sendmail uses /bin/sh as it's mail shell and -r is NOT turned on... so... | | why does the mail get bounced with the following respone:? | | 550 /home/debian-vote/.forward: line 2: /home/vote/bin/test.sh... Can't | create output: Executable files not allowed Sendmail uses some special characters to determine how to deliver mail, a destination that begins with / is expected to be a file, a | means a program. In general it is not a good idea to do what you have done as sendmail expects all programs that it invokes to exit with one of the codes in /usr/include/sysexits.h and your script is nearly guaranteed to not do that. If something goes wrong you will send a lot of "unknown mailer error" error messages. A better approach is: |"/home/vote/bin/test.sh || exit 75" which will cause sendmail to requeue your mail (75 works for most systems but check sysexits first to be sure). I have learned after much wailing and gnashing of teeth that sendmail always does what you tell it to but that isn't always what you wanted in the first place ;^). /Michael - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
How about if, instead, I change the script to exit error codes? The *real* script I want used it more complicated.. On 25-Aug-98 Michael Salmon wrote:
In general it is not a good idea to do what you have done as sendmail expects all programs that it invokes to exit with one of the codes in /usr/include/sysexits.h and your script is nearly guaranteed to not do that. If something goes wrong you will send a lot of "unknown mailer error" error messages. A better approach is:
|"/home/vote/bin/test.sh || exit 75"
which will cause sendmail to requeue your mail (75 works for most systems but check sysexits first to be sure).
---------------------------------- <A HREF="http://benham.net/index.html"><A HREF="http://benham.net/index.html</A">http://benham.net/index.html</A</A>> -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS d+(-) s:+ a29 C++$ UL++>++++ P+++$ L++>++++ E? W+++$ N+(-) o? K- w+++$(--) O M-- V- PS-- PE++ Y++ PGP++ t+ 5 X R+ !tv b++++ DI+++ D++ G++>G+++ e h+ r* y+ ------END GEEK CODE BLOCK------ ---------------------------------- - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
+----- On Tue, 25 Aug 1998 09:16:14 PDT, Darren Benham writes: | | How about if, instead, I change the script to exit error codes? The *real* | script I want used it more complicated.. | | On 25-Aug-98 Michael Salmon wrote: | > In general it is not a good idea to do what you have done as sendmail | > expects all programs that it invokes to exit with one of the codes in | > /usr/include/sysexits.h and your script is nearly guaranteed to not do | > that. If something goes wrong you will send a lot of "unknown mailer | > error" error messages. A better approach is: | > | >|"/home/vote/bin/test.sh || exit 75" | > | > which will cause sendmail to requeue your mail (75 works for most | > systems but check sysexits first to be sure). | > It is always best to do that of course, the problem is that scripts in particular sometimes have unusual ways of exiting and you have to catch them all otherwise you'll end up sending an "unknown mailer error" sooner or later. /Michael - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Hi! Trying to kill the keyboard, gecko@benham.net produced:
How about if, instead, I change the script to exit error codes? The *real* script I want used it more complicated..
error" error messages. A better approach is:
|"/home/vote/bin/test.sh || exit 75"
Still you want that ... because your script may be unaviable for a second (or locked, you want to do mail locking, don't you?) and 75 is usually a 'temporary error'. -Wolfgang PS: Procmail can even start scripts on condition and does proper locking, too ... ;-> -- PGP 2 welcome: Mail me, subject "send PGP-key". If you've nothing at all to hide, you must be boring. Unsolicited Bulk E-Mails: *You* pay for ads you never wanted. Is our economy _so_ weak we have to tolerate SPAMMERS? I guess not. - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Hi all, I'm running SuSE 5.1 with KDE 1.0. I would like to mount automagically a floppy disk from the icon on my desktop: what entry shall I add to the /etc/fstab? TIA Maurizio - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
Maurizio Firmani ha scritto:
Hi all, I'm running SuSE 5.1 with KDE 1.0. I would like to mount automagically a floppy disk from the icon on my desktop: what entry shall I add to the /etc/fstab?
TIA
Since I got no answer to my question I assume you don't know the answer and you may be interested in how I solved my problem. I add the following entry to /etc/fstab: /dev/fd0 /mnt/floppy vfat rw,noauto,user 0 0 where /dev/fd0 is the device, /mnt/floppy is where the device is mounted, vfat is the filesystem type, rw means read and write, noauto means do not mount at boot (actually I'm not sure about it, but I noticed that if I do not put "noauto" the kernel complain about the fd0 device). I have no idea about the meaning of user and the couple of zeros at the end of the record. Then, following the instruction in KDE help I put a nice icon on my desktop and with just a click of the mouse I have the floppy automagically mounted (I insist on "automagically" because I'm not 100ure on what I did). Ciao Maurizio - To get out of this list, please send email to majordomo@suse.com with this text in its body: unsubscribe suse-linux-e
participants (7)
-
alexm@hr60.tx.symbio.net
-
coffman@ece.ucdavis.edu
-
gecko@benham.net
-
grimmer@suse.de
-
maurizio@adriatico.ced.rm.cnr.it
-
Michael.Salmon@uab.ericsson.se
-
weissel@jupiter.ph-cip.uni-koeln.de