hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Dedicated Server : pipe mail
Reply

Dedicated Server Current and past experiences with dedicated server providers, bandwidth, and server performance. Review managed and unmanaged dedicated web servers, discuss both Windows and Unix dedicated server solutions, and discuss dedicated hosting providers. If your service is unavailable, please click here.
Forum Jump

pipe mail

Reply Post New Thread In Dedicated Server Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 09-01-2001, 06:13 AM
Omair Haroon Omair Haroon is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: Pakistan Baby!
Posts: 455

pipe mail


Hello,

Can anyone help me pipe a user mail to a file..


Actually, I am setting Ticket Smith and don't know how to pipe or procmail whatever a user mail like support@domain.com to go to gateway.pl of Ticket Smith..


Please help..

Reply With Quote


Sponsored Links
  #2  
Old 09-01-2001, 07:54 AM
mikeknoxv mikeknoxv is offline
Aspiring Evangelist
 
Join Date: Jul 2001
Location: Boston
Posts: 354
Re: pipe mail

Quote:
Originally posted by Omair Haroon
Hello,

Can anyone help me pipe a user mail to a file..


Actually, I am setting Ticket Smith and don't know how to pipe or procmail whatever a user mail like support@domain.com to go to gateway.pl of Ticket Smith..


Please help..
I apolgize for yesterday.

Assuming you are using sendmail...

* Put gateway.pl in a non-web-accessible directory and CHMOD it 777
* Edit /etc/aliases (pico /etc/aliases)
* Make sure you do not already have an entry for "support" (if you do, remove it)
* Add the following line into /etc/aliases: support: "|/path/to/gateway.pl" (be sure to replace "/path/to/" with the location to gateway.pl)
* Save /etc/aliases
* Find "newaliases" on your system and execute it

You should be up and running from this point.

Reply With Quote
  #3  
Old 09-01-2001, 10:22 AM
Omair Haroon Omair Haroon is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: Pakistan Baby!
Posts: 455
Hey...

I have a question..


How would the /etc/aliases know which domain name I am talking about ??


Becuase

Quote:
support: "|/path/to/gateway.pl"
Does'nt have anything in it which shows which domain we are referring it to...

Thanks in advance..

Reply With Quote
Sponsored Links
  #4  
Old 09-01-2001, 10:41 AM
cperciva cperciva is offline
Retired Moderator
 
Join Date: Jan 2001
Posts: 2,603
Re: Re: pipe mail

Quote:
Originally posted by mikeknoxv

* Put gateway.pl in a non-web-accessible directory and CHMOD it 777
*sob*

PLEASE don't do that. Posting your root password on IRC would be less suicidal than doing that. You really don't want to have everyone able to edit programs which are going to be executed by root.

A better solution than the above is to create a .forward file in the home directory of the user to whom the email is directed; a simple `echo "|/path/to/script" >> ~/.forward` will do the job.

__________________
Dr. Colin Percival, FreeBSD Security Officer
Online backups for the truly paranoid: http://www.tarsnap.com/

Reply With Quote
  #5  
Old 09-01-2001, 03:40 PM
Omair Haroon Omair Haroon is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: Pakistan Baby!
Posts: 455
Cperciva,


Thanks for the advice.. But I don't know how do you, where do you and why do you create a .forward file..

Can you please be more detail ?? Or infact give a step by step guide?? It would be very helpful for all of us..


Thanks,
Omair

Reply With Quote
  #6  
Old 09-01-2001, 08:58 PM
cgisupp cgisupp is offline
WHT Addict
 
Join Date: Dec 2000
Location: OZ
Posts: 120
First up the RAQ runs smrsh so piping email to the script from a .forward file will result in errors. The errors will look like:
sh: perl not available for sendmail programs 554

Here is what you need to do.

create a symlink from /usr/adm/sm.bin
to the script in question.
cd /usr/adm/sm.bin
ln -s /path/to/gateway.pl

Place the .forward file in the home directory for that user.
ie.
/home/sites/<site_number>/users/myuserdir/.forward.

chmod the users dir to chmod 2711
ie.
chmod 2711 /home/sites/<site_number>/users/username
the chmod 600 the .forward file

The forward file needs to look like:

\username, "|/usr/adm/sm.bin/gateway.pl"

This does actually work on a RAQ2 and RAQ3

HTH

__________________
CGI Supply


Reply With Quote
  #7  
Old 09-01-2001, 09:31 PM
mikeknoxv mikeknoxv is offline
Aspiring Evangelist
 
Join Date: Jul 2001
Location: Boston
Posts: 354
Re: Re: Re: pipe mail

Quote:
Originally posted by cperciva


*sob*

PLEASE don't do that. Posting your root password on IRC would be less suicidal than doing that. You really don't want to have everyone able to edit programs which are going to be executed by root.

A better solution than the above is to create a .forward file in the home directory of the user to whom the email is directed; a simple `echo "|/path/to/script" >> ~/.forward` will do the job.
<edit> Nevermind my last post... 777 was incorrect. 755 should do</edit>

Reply With Quote
  #8  
Old 09-02-2001, 04:31 AM
Omair Haroon Omair Haroon is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: Pakistan Baby!
Posts: 455
Quote:
Nevermind my last post... 777 was incorrect. 755 should do
That even worked either


cgisupp :

Here is what I did..

create a symlink from /usr/adm/sm.bin
to the script in question.
cd /usr/adm/sm.bin
ln -s /path/to/gateway.pl

Then I created a .forward file with the below line in it replacing the username :

\ticket, "|/usr/adm/sm.bin/gateway.pl"

Then I uploaded it to

/home/sites/home/users/ticket/.forward

Then I chmod it to 600

chmod 600 /home/sites/home/users/ticket/.forward

and then I chmodded the user directory to 2711

chmod 2711 /home/sites/home/users/ticket

But after doing all of this when I sent an e-mail to ticket@domain.com it did not worked..

Is there anything that is left ?? Or is there anything that I am doing wrong ??


Please correct me


' Omair

Reply With Quote
  #9  
Old 09-03-2001, 08:06 AM
Omair Haroon Omair Haroon is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: Pakistan Baby!
Posts: 455
Anyone ??

Reply With Quote
  #10  
Old 09-03-2001, 10:22 AM
swissmonk swissmonk is offline
Junior Guru Wannabe
 
Join Date: Apr 2001
Location: Switzerland
Posts: 33
Try this:

1. Create a normal user on your account
2. Change the user directory to 2711
3. Create a file named .procmailrc in the user directory

:0c
* (^To:|^CC:|^Cc:) .support@domain.com
| /home/sites/sitexx/web/script.pl

4. chmod .procmailrc to 600

And try again

Reply With Quote
  #11  
Old 09-03-2001, 12:22 PM
Omair Haroon Omair Haroon is offline
Web Hosting Evangelist
 
Join Date: Feb 2001
Location: Pakistan Baby!
Posts: 455
Swissmonk,

Thanks I did it.. But that did'nt worked either..

I remember having catch-all-email account on this domain..

Would having catch-all-email causing some problems ???


Please help guys...

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Yahoo Integrates Email Client with Dropbox Cloud Storage Web Hosting News 2013-04-04 14:31:40
Web Hosting Control Panel cPanel and WHM Version 11.32 Adds Features, Fixes Web Hosting News 2012-04-08 11:51:35
cPanel Launches Version 11.32 of Control Panel and Web Host Manager Web Hosting News 2012-02-15 12:46:33
SpamExperts IPv6 Whitelist Foundation Wins IPv6 Task Force Award Web Hosting News 2011-11-18 22:21:53
Email Provider OpenXchange Partners with Openwave Web Hosting News 2011-10-12 17:23:08


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?