Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i.e. use the quotation marks around the full path to the script you want to run and see if it works.
After editing /etc/mail/aliases, run "newaliases" and restart sendmail.
Here is a part of my aliases file.
-------------------------------------------
# Person who should get root's mail
#root: marc
root: yangg
yangg: "|/tmp/run.sh:"
-------------------------------------------
Messages sent to root can be forwarded to yangg, but if you address yangg nothing happens, yangg cannot receive this message either.
script run.sh is very simple: touch /tmp/aliases.tst, that's it.
I really don't have idea.
If you need to view my sendmail.mc file, please let me know..
Take a look at the log files /var/log/maillog, /var/log/messages or whatever other log files your distro uses to see if you find any clues why the aliases is not working.
What distro are you using btw?
I don't think you have to do anything with sendmail.mc or sendmail.cf, since normal usernames aliases work.
Yes, normal aliases works. The Aliases seemed to be triggered, but failed in running the script. It looks like that statement "|/tmp/run.sh" was treated as an address instead of a command.
For our convinience to talk, I hereby numbered the log.
What is "Distro"? Basically, besides access file and aliases it's all default in Redhat9.
Distro is the Linux distribution you use, so you've answered it's RH 9. Anyway looking at the logs smrsh looked suspicious, so doing a little googling, I found this.
So I guess you need either to create the symlink mentioned there, or disable smrsh, in that case you need to rebuild your sendmail.cf.
I created a link under /etc/smrsh pointing to my script according to the following information:
-----------------------------------------------------------------
To allow the procmail program /usr/bin/procmail, use the following commands:
[root@deep] /# cd /etc/smrsh
[root@deep ]/smrsh# ln -s /usr/bin/procmail procmail
This will allow the mail and procmail programs to be run from a user's .forward file or an aliases file which uses the program syntax.
-----------------------------------------------------------------
This information is from http://www.faqs.org/docs/securing/chap22sec182.html
But I got to switch to this link exactly from the webpage you passed to me. You have been always on the right direction, expert!!
Thank you.
I pasted all these meant to share with other people may need this.
Thank you all.
Case closed.
Thank you again Bathory!! I hope I can help people like how I was helped.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.