Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-04-2012, 07:53 PM   #1
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
Configuring SMTP to work on FreeBSD 9.0 server.

Okay, so I'm working on another project where I've set up a FreeBSD system on one of my older computers. I've set up Apache, PHP, mySQL, and myPHPadmin on the box and tested a few PHP scripts from hotscripts.com

The box is running on a local IP address of 192.168.1.77 as hostname "freebsd" and my router is set to forward it any incoming connections to port 80.

One of the scripts I am trying to install requires an SMTP server so in the config files I set it as:
$email_server = 'outgoing.verizon.net'; // What mail server (an FQDN DNS name) should emails be sent from?

However, this doesn't seem to work and I'm wondering if I need to setup my own SMTP on the box itself, or do I need to install something such as mail/ssmtp to get it to work?

Telnet into the SMTP server on port 25 is successful.
Code:
freebsd# telnet outgoing.verizon.net 25
Trying 206.46.232.12...
Connected to outgoing.verizon.net.
Escape character is '^]'.
220 vms173021pub.verizon.net -- Server ESMTP (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009))

The script I am trying to install is called BlackNova Traders and can be found at http://sourceforge.net/projects/blacknova/


Thanks.
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:02 PM   #2
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
It's difficult to tell from just a variable declaration what the script is trying to do. Does your SMTP server require authentication, or just being on the correct IP block is enough?
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:07 PM   #3
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
I browsed the code tree for occurrences of email_server, and I only see one, and it's in that file only. Maybe it's a future feature that hasn't been implemented yet?
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:10 PM   #4
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Browsing further through the code, it seems to take advantage of mail(), which is a built-in function and will use the SMTP settings of your server.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:15 PM   #5
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
Quote:
Originally Posted by edgeprod View Post
It's difficult to tell from just a variable declaration what the script is trying to do. Does your SMTP server require authentication, or just being on the correct IP block is enough?
Good question. I've used Yahoo mail for over that past 12 years so I'm not sure. I'll have to look into that further. I'm just learning as I go. I'm finding it very interesting learning to manage my own web server. Most of the time I've spent the past couple days has been troubleshooting my log files.

Quote:
Originally Posted by edgeprod View Post
I browsed the code tree for occurrences of email_server, and I only see one, and it's in that file only. Maybe it's a future feature that hasn't been implemented yet?
A new player has to create an account to play the game, and his password is sent to him VIA email.
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:17 PM   #6
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
Quote:
Originally Posted by edgeprod View Post
Browsing further through the code, it seems to take advantage of mail(), which is a built-in function and will use the SMTP settings of your server.
Okay, so if my server has no SMTP settings I would have to set something up such as this?
http://www5.us.freebsd.org/doc/handb...oing-only.html
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:17 PM   #7
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by GFED View Post
A new player has to create an account to play the game, and his password is sent to him VIA email.
Via mail() from what I can see. It doesn't use that variable anywhere that I can tell. I'm looking directly at the implementation in the code.

I'm working on MUCH more complex code in another window, and it has 85% of my focus while I wind down from a rough day of looking at said code ... so this is a welcome distraction for a bit.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:18 PM   #8
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by GFED View Post
Okay, so if my server has no SMTP settings I would have to set something up such as this?
http://www5.us.freebsd.org/doc/handb...oing-only.html
I'd recommend you create an otherwise-blank PHP file, and test the mail() function with an address you know to be valid.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:31 PM   #9
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
Quote:
Originally Posted by edgeprod View Post
I'd recommend you create an otherwise-blank PHP file, and test the mail() function with an address you know to be valid.
I tried using both of the examples at http://www.w3schools.com/php/php_mail.asp and ran them from my server. It responds that it sends the mail without giving an error, but the mail is not received.
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 08:36 PM   #10
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by GFED View Post
I tried using both of the examples at http://www.w3schools.com/php/php_mail.asp and ran them from my server. It responds that it sends the mail without giving an error, but the mail is not received.
Here's some things to get you going in your troubleshooting:

* Check your error logs.
* Check your sendmail config, if that's what you're using.
* Check if you can mail any of the local accounts on the server.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 09:37 PM   #11
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
Quote:
Originally Posted by edgeprod View Post
Here's some things to get you going in your troubleshooting:

* Check your error logs.
* Check your sendmail config, if that's what you're using.
* Check if you can mail any of the local accounts on the server.
output of the error statements per the failed transmission of email
/var/log/maillog

Code:
Dec  4 22:46:12 freebsd sendmail[3938]: qB53kC5j003938: from=www, size=125, class=0, nrcpts=1, msgid=<[email protected]>, relay=www@localhost
Dec  4 22:46:12 freebsd sm-mta[3939]: qB53kCiI003939: from=<[email protected]>, size=386, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=Daemon0, relay=localhost [127.0.0.1]
Dec  4 22:46:12 freebsd sendmail[3938]: qB53kC5j003938: to=*******@yahoo.com, ctladdr=www (80/80), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30125, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (qB53kCiI003939 Message acce
all settings are default. assuming these might be relevant to my problem? should port 587 be port 25 or is port 25 no longer used for smtp?
/etc/mail/sendmail.cf

Code:
O DaemonPortOptions=Name=IPv4, Family=inet
O DaemonPortOptions=Name=IPv6, Family=inet6, Modifiers=O
O DaemonPortOptions=Port=587, Name=MSA, M=E

# SMTP client options
#O ClientPortOptions=Family=inet, Address=0.0.0.0
changing the php script to send mail to root@freebsd was sucessful in transmitting.

Code:
freebsd# sendmail -bv root
root... deliverable: mailer local, user root
freebsd# sendmail -bv *******
*******... deliverable: mailer local, user *******
Code:
freebsd# mail
Mail version 8.1 6/6/93.  Type ? for help.
"/var/mail/root": 1 message 1 new
>N  1 *******@yahoo.com     Tue Dec  4 23:28  23/746   "testing mailform to root@freebsd"
& 1
Message 1:
From [email protected] Tue Dec  4 23:28:26 2012
Date: Tue, 4 Dec 2012 23:28:26 -0500 (EST)
To: [email protected]
Subject: testing mailform to root@freebsd
X-PHP-Originating-Script: 0:mailform.php
From:*******@yahoo.com

this
is
a
test


&

mail seems to be working fine internally just not outbound.
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 09:40 PM   #12
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
587, if I remember correctly, is the "alternate" SMTP port, designed to get around the ISP blocking port 25.

In your case, sendmail probably isn't properly configured to talk to the outside world. It may need ports exposed (or forwarded) on the router, or some other settings. Next thing on your list should be checking out the sendmail docs, specifically for FreeBSD.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 09:51 PM   #13
Supz
Arthur Flegenheimer
 
Supz's Avatar
 
Industry Role:
Join Date: Jul 2006
Location: New York City
Posts: 11,056
wouldnt any outbound email server need a public ip address?
Supz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 10:54 PM   #14
sandman!
Icq: 14420613
 
sandman!'s Avatar
 
Industry Role:
Join Date: Mar 2001
Location: chicago
Posts: 15,432
when you ready for a managed freebsd 9 box let me know
__________________
Need WebHosting ? Email me for some great deals [email protected]
sandman! is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-04-2012, 11:52 PM   #15
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
Quote:
Originally Posted by edgeprod View Post
587, if I remember correctly, is the "alternate" SMTP port, designed to get around the ISP blocking port 25.

In your case, sendmail probably isn't properly configured to talk to the outside world. It may need ports exposed (or forwarded) on the router, or some other settings. Next thing on your list should be checking out the sendmail docs, specifically for FreeBSD.
Okay, according to http://www.freebsd.org/doc/en_US.ISO.../sendmail.html

Code:
29.3.1 /etc/mail/access
The access database defines what host(s) or IP addresses have access to the local mail server and what kind of access they have. Hosts can be listed as OK, REJECT, RELAY or simply passed to sendmail's error handling routine with a given mailer error. Hosts that are listed as OK, which is the default, are allowed to send mail to this host as long as the mail's final destination is the local machine. Hosts that are listed as REJECT are rejected for all mail connections. Hosts that have the RELAY option for their hostname are allowed to send mail for any destination through this mail server.
so I added the following to /etc/mail/access
Code:
localhost.localdomain                   RELAY
localhost                               RELAY
127.0.0.1                               RELAY
192.168.1                               RELAY
and compile the db
Code:
freebsd# pwd
/etc/mail
freebsd# make
/usr/sbin/makemap hash access.db < access
chmod 0640 access.db
Still not working... I'll continue researching and post an update when I find something else...

Quote:
Originally Posted by sandman! View Post
when you ready for a managed freebsd 9 box let me know
Yes, I have a managed box but I decided to make my own for fun.
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2012, 02:25 AM   #16
GFED
Confirmed User
 
GFED's Avatar
 
Industry Role:
Join Date: May 2002
Posts: 8,098
After editing the /etc/mail/access entries I began receiving the following errors:

Code:
Dec  5 03:03:45 freebsd sm-mta[1106]: My unqualified host name (localhost) unknown; sleeping for retry
Dec  5 03:04:45 freebsd sm-mta[1106]: unable to qualify my own domain name (localhost) -- using short name
This was resolved by editing the /etc/hosts file and changing

Code:
::1                     localhost freebsd
127.0.0.1               localhost freebsd
to

Code:
::1                     localhost freebsd freebsd.local freebsd.local.home
127.0.0.1               localhost freebsd freebsd.local freebsd.local.home
Additionally, I added this line to /etc/rc.conf to load the sendmail daemon:

Code:
sendmail_enable="YES"
and verified that it had opened up the SMTP ports 25 and 587

Code:
freebsd# sockstat -4 -l
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
www      httpd      1216  4  tcp4   *:80                  *:*
www      httpd      1215  4  tcp4   *:80                  *:*
www      httpd      1214  4  tcp4   *:80                  *:*
www      httpd      1213  4  tcp4   *:80                  *:*
www      httpd      1212  4  tcp4   *:80                  *:*
root     sendmail   1104  3  tcp4   *:25                  *:*
root     sendmail   1104  6  tcp4   *:587                 *:*
root     sshd       1099  4  tcp4   *:22                  *:*
root     httpd      1076  4  tcp4   *:80                  *:*
mysql    mysqld     1063  10 tcp4   *:3306                *:*
root     syslogd    755   7  udp4   *:514                 *:*
but still not receiving messages sent via terminal to an outside destination...

Code:
freebsd# sendmail *******@yahoo.com
test
test
test
.
freebsd#
GFED is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2012, 02:39 AM   #17
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Check your spam folder. Generally speaking, emails sent from a machine without a FQDM tend to be spam.
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.