2019-09-20 - hschneider, Admin
Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.
XMail Forum · Newbies read here ! All about SMTP,MX-Records,DNS etc. | Help Search Members Calendar |
Welcome Guest ( Log In | Register ) | Resend Validation Email |
wmikrut |
Posted: Sep 21 2001, 07:02 PM
|
Newbie Group: Members Posts: 3 Member No.: 70 Joined: 21-September 01 |
Ok, I previously posted that I was having some trouble recieving mail externally and internally. I have fixed that problem and all is working well.
I do have a question about filtering though. I have a file setup in the /filters directory named nightingale.com.tab. Here is the content of this file: "/var/MailRoot/bin/nightingale.sh"[TAB]"@@FROM" Here is what the nightingale.sh script file looks like: #!/bin/bash echo "Script nightingale.sh executed" >> /tmp/smtperror.log if [ $1 = "user@nightingale.com" ] then exit 99 fi My goal here would be to block any mail from user@nightingale.com - perhaps more users in the future if I required it. Any reason why this does not work? I added the echo just to see if the script was at least being called...and it's not. William W. Mikrut wmikrut@wmikrut.com Edited by - wmikrut on 22 September 2001 08:23:05 |
Aram |
Posted: Sep 22 2001, 01:33 PM
|
Administrator Group: Moderators Posts: 142 Member No.: 1 Joined: 15-February 01 |
Hi William,
I guess you know that '[TAB]' is a control key and not meant literally, so you should use the Tabulator key. Another problem could be that you didn't terminate the line with a linefeed. The syntax of the file is : "command"[TAB]"arg-or-macro"[TAB]...[NEWLINE] I presume the script is ok since I've no experience in scripting on Unix/Linux. - Aram Tutunciyan - |
wmikrut |
Posted: Sep 23 2001, 05:16 AM
|
Newbie Group: Members Posts: 3 Member No.: 70 Joined: 21-September 01 |
Hi Aram,
Thanks for the reply! I used the [TAB] keyword in my example for documentation purposes only. Here is the location and content of my .tab file /var/MailRoot/filters/nightingale.com.tab "/var/MailRoot/bin/default.sh" "@@FROM" I made sure there was a newline in the .tab file, and I have executed the nightingale.sh script to make sure it works. I even opened up RWX authority for everyone to make sure access was not denied when the script was run. |
wmikrut |
Posted: Sep 24 2001, 08:31 PM
|
Newbie Group: Members Posts: 3 Member No.: 70 Joined: 21-September 01 |
Ok, I figured out what I was going wrong... (exactly why I souldn't work on these things until I get some sleep).
I learned how to read this weekend --- and I realized I was setting up my filter incorrectly. I needed to have a .tab file in the /filters directory for the account receiving mail. In my example - I needed a wmikrut@wmikrut.com.tab file --- then I can pass parameters and handle filtering. I added this file - and everything works just fine. |