LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-30-2007, 10:08 PM   #1
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Rep: Reputation: 15
Outside Mail Server


Hi,

I have CentOS 4.4 and I would like to set up PHP so it will email a remote SMTP server when it sends mail. This being my ISPs SMTP server.

I did this on my test windows box:

Code:
[mail function]
; For Win32 only.
SMTP = mail.optonline.net

; For Win32 only.
sendmail_from = jcink@jcink.com

; SMTP port
smtp_port=25
My current email server is sendmail. That's what PHP is configured to use.

And this worked fine, it sent mail without a problem at all. But what is the Linux way to get this done? I've tried google searching, and I didn't come up with a lot of helpful results. I tried configuring a program called minisendmail, but it didn't work for me.

Any ideas would be greatly appreciated. Thanks.

Last edited by Dan8080; 04-30-2007 at 10:11 PM.
 
Old 05-01-2007, 02:01 AM   #2
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Do you mean you want to specify the mail server that the mail() function will use, or you just a method to do it - not necessarily with mail() function?
 
Old 05-01-2007, 02:42 PM   #3
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
Do you mean you want to specify the mail server that the mail() function will use, or you just a method to do it - not necessarily with mail() function?
Hi,

I would like just the mail(); function to work. It has to be mail();, not something like phpmailer package.

I've been trying to get sendmail to send to a remote host but I've been pulling my hair out. My ISP doesn't require auth, and I have sent numerous emails through just telnet just fine. Yet whenever I try

define(`SMART_HOST',`mail.optonline.net')

it doesn't work. no emails get sent.

Quote:
[root@localhost ~]# echo hello | sendmail -v jcink2k@gmail.com
jcink2k@gmail.com... Connecting to [127.0.0.1] via relay...
220 localhost.localdomain ESMTP Sendmail 8.13.1/8.13.1; Tue, 1 May 2007 15:40:26 -0400
>>> EHLO localhost.localdomain
250-localhost.localdomain Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root@localhost.localdomain> SIZE=6 AUTH=root@localhost.localdomain
250 2.1.0 <root@localhost.localdomain>... Sender ok
>>> RCPT To:<jcink2k@gmail.com>
>>> DATA
250 2.1.5 <jcink2k@gmail.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 l41JeQdv016831 Message accepted for delivery
jcink2k@gmail.com... Sent (l41JeQdv016831 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 localhost.localdomain closing connection
It seems to be totally igoring my smart host (?) also, no email gets delivered, even though it says it was sent and accepted... I have tried even turning off the firewalls and no luck.

I have this working if I remove the SMART_HOST. I've been running this mail server the whole time off port 25 and it is working fine, but my issue is that I've been blacklisted and have put up with it for the longest time. Then I discovered this method could be used to get around the blacklist, use my ISP instead of my own. Which is why I'm doing this.

Last edited by Dan8080; 05-01-2007 at 02:43 PM.
 
Old 05-01-2007, 06:01 PM   #4
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Have you recompiled the sendmail config file with m4 and restarted sendmail?
 
Old 05-01-2007, 11:37 PM   #5
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
Have you recompiled the sendmail config file with m4 and restarted sendmail?
Yea, I have. I even see the change in the sendmail.cf file when I do it.

DSmail.optonline.net

which seems to be correct... right?
 
Old 05-02-2007, 08:14 PM   #6
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Well I can't access that server:

Code:
[phillips@poweredge2400 ~]$ telnet DSmail.optonline.net 25
Trying 208.67.219.130...
telnet: connect to address 208.67.219.130: Connection refused
telnet: Unable to connect to remote host: Connection refused
Perhaps sendmail reverts to doing it's own thing when it can't contact your ISP's SMTP server?
 
Old 05-03-2007, 04:45 PM   #7
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
Well I can't access that server:

Code:
[phillips@poweredge2400 ~]$ telnet DSmail.optonline.net 25
Trying 208.67.219.130...
telnet: connect to address 208.67.219.130: Connection refused
telnet: Unable to connect to remote host: Connection refused
Perhaps sendmail reverts to doing it's own thing when it can't contact your ISP's SMTP server?
Thing is, it isn't DSmail.optonline.net

It's just mail.optonline.net

When I do the changes, in sendmail.cf, on the DS line, it shows DSmail.optonline.net

I have also tried editing sendmail.cf directly, and making it DS mail.optonline.net, but no luck...
 
Old 05-03-2007, 06:20 PM   #8
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Whoops - wasn't focusing, lol

I still can't connect to that server:
Code:
[phillips@poweredge2400 ~]$ telnet mail.optonline.net 25
Trying 167.206.5.250...
It just times out... I tried from 3 different computers on 2 independant networks...
 
Old 05-03-2007, 11:36 PM   #9
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
Whoops - wasn't focusing, lol

I still can't connect to that server:
Code:
[phillips@poweredge2400 ~]$ telnet mail.optonline.net 25
Trying 167.206.5.250...
It just times out... I tried from 3 different computers on 2 independant networks...
I am able to connect though. The ISP is probably rejecting your connection because you're outside their network.
 
Old 05-04-2007, 12:19 AM   #10
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Can you post /var/log/mail after sending one of your test e-mails for us?
 
Old 05-14-2007, 11:14 PM   #11
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
Can you post /var/log/mail after sending one of your test e-mails for us?
Hi, sorry for the late reply.

I don't have anything in /var/log/mail except a statistics file...
 
Old 05-15-2007, 12:51 AM   #12
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Interesting... I can't explain that one... Anyone else?
 
Old 05-15-2007, 11:06 PM   #13
Dan8080
LQ Newbie
 
Registered: Jun 2006
Distribution: CentOS 4.3
Posts: 25

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by fukawi2
Interesting... I can't explain that one... Anyone else?
Hi,

It's ok, thanks anyway. I'm not sure why, but it decided to start working today. Heh... mail is sending fine, and when I do the test, it picks up optimums information. I'm not sure what happened, but I'm glad it works.
 
Old 05-16-2007, 02:27 AM   #14
digitalnerds
Member
 
Registered: May 2007
Distribution: Debian
Posts: 103

Rep: Reputation: 15
I recommend using a third party software. I am using XPM2 for sending mails from within php under linux. It is a mail class written by the folks at xpertmailer.com. I am using it currently to send mails by gmail using TLS. It works flawlesly.
 
  


Reply



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
Internal/External Mail Server Aeiedil Linux - Software 27 10-13-2009 09:16 AM
sendmail server unable to receive external mail goonfui_wong Linux - Networking 7 07-01-2005 02:15 AM
sendmail and external mail server levand Linux - Networking 10 12-17-2004 09:45 AM
configure sendmail to use external mail server Drogo Linux - Software 0 09-16-2004 09:16 PM
Postfix mail server not accepting incoming mail from the external interface rexmundi Linux - Networking 7 12-22-2003 03:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:17 PM.

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