![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to forward mail in /var/mail/username to external mail | unitipon | SUN Solaris | 2 | 05-27-2008 12:20 AM |
| send mail purtcular subject forward | s_sheik | Linux | 1 | 01-17-2008 10:11 AM |
| forward root mail | csaunders | SUN Solaris | 1 | 11-23-2004 04:35 PM |
| .forward file for mail redirection | giannicello | UNIX for Dummies Questions & Answers | 3 | 01-12-2002 11:06 AM |
| E-mail forwarding | BigBro | UNIX for Dummies Questions & Answers | 1 | 12-03-2000 11:40 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
.forward and alias mail forwarding questions
I am trying to configure sendmail to forward email to a PHP script. I don't know UNIX and am having trouble figuring out how to forward the mail. I think this is just a bunch of basic questions, but I have had little luck getting help elsewhere on my specific questions and it's driving me nuts. You can see the instructions I am trying to follow here: http://www.devarticles.com/c/a/PHP/I...ail-and-PHP/1/
The instructions say I need to do 3 things: 1) forward email using either a ".forward" file or a modified "alias" file (the preferable method, if I have "root access") I want to use the alias file, seeing as it's the preferred method. Supposedly the alias file should be found in my /etc directory, but using shell access to my site I see no such file in the /etc folder off the top directory. Am I looking in the wrong place? Do I have to create it? If I want to create/modify the alias file to forward mail sent to script@myurl.com to "|/our/script.php", what specific command do I use? With regard to the .forward file, I've been wandering around among the directories trying to find my mail folder so I can put the .forward file in there, but I have no idea where it should go. 2) Now the instructions say "Since our script will function as a shell script, the first line should contain the path to the PHP CGI program. This is most likely located at /usr/bin/php of /usr/local/bin/php. This tells the operating system that this script must be parsed by PHP." I'm sorry for asking such a stupid question, but what does the "of" in "/usr/bin/php of /usr/local/bin/php" mean? I see a file "php@" in the directory "/usr/local/bin/php" but I do not know what is meant by "/usr/bin/php of /usr/local/bin/php". Also, how do I tell that PHP is compiled as a CGI module? 3) Once I write and save the script, I must put it in the correct location, and make it executable with "chmod 755" Googling chmod, my understanding is that to do this, I navigate to the directory my script is in, and type "chmod 755 script.php" Is that right? Thanks for your help. |
|
||||
|
OK unfortunately I am still having some issues
1) Someone suggested I find the aliases file with "find /etc -name aliases -print", but it returned no results. (I was in the top directory) I then tried "find -name aliases -print" and got the following results: dgodshalk:/$ find -name aliases -print find: ./home/aschwartz/.ssh: Permission denied find: ./.renv/etc/default: Permission denied find: ./.renv/tmp: Permission denied find: ./.renv/var/lib/mw: Permission denied find: ./.renv/var/spool/cron: Permission denied find: ./.renv/var/state/sasl2: Permission denied ./.renv/usr/lib/perl5/site_perl/5.6.1/i386-linux/Unicode/Map8/maps/aliases find: ./.renv/usr/share/doc/sablotron-1.0: Permission denied ./.renv/usr/share/doc/bash-2.05/startup-files/apple/aliases find: ./.renv/usr/share/ssl/CA: Permission denied find: ./.renv/usr/share/fonts/cmpsfont: Permission denied ./.renv/usr/share/texmf/aliases find: ./.renv/root: Permission denied So there are three aliases files, and I don't know which one is the right one (if any). I assumed I was using Sendmail because in my hosting provider's FAQs they make reference to Sendmail. (I am hosted on modwest.com) Anyway I will try with a .forward file. I understand (perhaps wrongly) that it should go in the folder named after a given user in the home directory. I want to create a new user for this, so that mail does not get forwarded for an existing user. I searched around for 'create new user' commands in UNIX on google and found adduser, but trying to use it returns: bash: adduser: command not found So next, I create an new email account using my hosting provider's CP, and create a folder in the home directory corresponding to this user account, and create a .forward file in this home directory using pico. Strangely, I cannot see the .forward file I created (because it begins with a period, perhaps?), but if I try to save it again I get an overwrite warning, so I know it is there. The .forward file I created contained an email address instead of a link to a script, so that I could confirm that it was working. It is not working, so obviously I am still completely misunderstanding some part of this process. 2) I found the full path to php using the command ls -l /usr/bin/php which returned lrwxrwxrwx 1 root root 18 Feb 17 2005 usr/bin/php -> /usr/local/bin/php* even this is confusing to me. what does "usr/bin/php -> /usr/local/bin/php*" mean? which one is the path? there is a file called php@ in the former directory (along with a billion other files), and there is a file php@ in the latter directory also (along with a smaller number of files, many of which look like various versions of php, including php-5.0.4, php-5.0.3 etc.). I checked my version of UNIX as you suggested by using "uname -a", so for what it's worth, this returned: Linux pintlar.modwest.com 2.4.20-mw13 #1 Fri Dec 5 16:27:24 MST 2003 i686 unknown Thanks for your help so far. I will continue to hunt around for solutions to these problems, and look forward to any additional suggestions you might have that will help determine the right aliases file and get .forward to work. I have a feeling these things are not so complicated, but so far this has been somewhat confusing. |
|
|||||
|
2. That is a symbolic link. So /usr/bin/php is just an alternate way to open /usr/local/bin/php. Two paths to the same file...sort of.
1. Those permission denied messages mean you are not root. You won't have the power to edit aliases should you find it. Nor can you run adduser. And yes, files that start with a dot are hidden to a limited degree. ls -la will let you see them. |
![]() |
| Bookmarks |
| Tags |
| linux commands |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|