LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2003, 10:33 PM   #1
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Rep: Reputation: 30
email forwarding


situation:

in a php script i wrote the mail function mails an email to a specified email. but the university system won't let the script send to anyone but people on the network. i.e. if i sent an email to my friend living down the hall through this script it'd work fine, but to a yahoo.com address it gets bounced back to the sysadmin.

so i wanted to have the emails first sent to an account on the server, and then forwarded to the specified user.

any thoughts of how i could go about doing this?
 
Old 08-17-2003, 08:07 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
My guess is that you are using sendmail to send it and the sysadmins have only let you send to lcoal accounts. Try connecting directly to the university smtp server.
 
Old 08-17-2003, 11:31 AM   #3
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
i have no idea how to do that.
 
Old 08-17-2003, 12:09 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I think you just need to edit your sendmail config to use the university smtp server as it's relay and make the user that apache runs as a trusted mail user (lets it send mail with a name other than it's own).
 
Old 08-17-2003, 01:23 PM   #5
sk8guitar
Member
 
Registered: Jul 2003
Location: DC
Distribution: mandrake 9.1
Posts: 415

Original Poster
Rep: Reputation: 30
i don't think the university allows relays, which is the problem. but i'll play with that idea, thanks
 
Old 08-19-2003, 02:44 PM   #6
Electric_Blue
Member
 
Registered: Aug 2003
Distribution: RedHat
Posts: 35

Rep: Reputation: 15
I think what you are saying is that you need to have that email leave your server as a local account (i.e. sk8guitar@university.edu), and they are probably leaving with something like apache@your.box.com and getting bounced.

Is that right?
If so, you'd be better off to give the email a different "from" address that the server is allowed to relay. You just need to add it to the header info in your php email script.

Maybe something like:
$announce_to_email = "joe@yahoo.com";
$announce_from_email = "sk8guitar@university.edu";
$announce_from_name = "Your Name";

$mail_header = "MIME-Version: 1.0\r\n");
$mail_header .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mail_header .= "To: Someone <$announce_to_email>\n";
$mail_header .= "From: $announce_from_name <$announce_from_email>\n");

I think your university server just isn't relaying it, but if you can post more info about what's going on (error messages etc), I could be more help.

good luck!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forwarding email Boffy Linux - General 2 03-18-2005 09:43 AM
EMail forwarding Brother Michael Debian 2 05-13-2004 09:19 AM
Forwarding Email sw1tchb0ard Linux - Newbie 1 10-26-2003 07:28 PM
Email Forwarding Nezar Linux - Networking 2 06-12-2001 02:16 PM
FORWARDING EMAIL FROM Lunix drudnev Programming 2 05-30-2001 11:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration