Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Email from my VPS
PostPosted: Thu Jun 03, 2010 4:46 am 
Offline
Senior Newbie

Joined: Thu May 27, 2010 9:00 am
Posts: 14
Hi guys,

I now have a couple of sites setup on my Linode VPS. I have noticed I can't send email from any of them. I am running ubuntu 10 on my server.

I dont' know if and how apache needs to be configured to enable emailing.

Can anyone please help me out and tell me how to go about this, please ? :?: :?


Top
   
 Post subject:
PostPosted: Thu Jun 03, 2010 5:50 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
How are you trying to send the email? (php/python/ruby/whatever?), do you have postfix installed?


Top
   
 Post subject:
PostPosted: Thu Jun 03, 2010 7:19 am 
Offline
Senior Newbie

Joined: Thu May 27, 2010 9:00 am
Posts: 14
obs wrote:
How are you trying to send the email? (php/python/ruby/whatever?), do you have postfix installed?


I am using PHP. I don't know if postfix is installed, how to check and how to install if necessary ..... please help the newbie :wink:


Top
   
 Post subject:
PostPosted: Thu Jun 03, 2010 7:48 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
what distribution are you using? for debian/ubuntu it would be aptitude show postfix and next to state it will say State: Installed if you have it.


Top
   
 Post subject:
PostPosted: Thu Jun 03, 2010 7:53 am 
Offline
Senior Newbie

Joined: Thu May 27, 2010 9:00 am
Posts: 14
obs wrote:
what distribution are you using? for debian/ubuntu it would be aptitude show postfix and next to state it will say State: Installed if you have it.


It's ubuntu 10 and it is not installed.

I have been looking at this tutorial : http://library.linode.com/email/postfix ... 0.04-lucid , just researching before actually getting into it.
It seems long and rather complex.

Can you direct me to a possibly simpler and shorted installation process ?


Top
   
 Post subject:
PostPosted: Thu Jun 03, 2010 8:06 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Run the following:

Code:
apt-get install postfix


Then edit /etc/postfix/main.cf to the following

Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
myorigin = $mydomain

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = <your server hostname>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =  localhost, localhost.$mydomain, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all


You need to replace <your server hostname> with whatever your hostname is (type hostname and press enter in the terminal to find out)


Top
   
 Post subject:
PostPosted: Thu Jun 03, 2010 11:49 am 
Offline
Senior Member

Joined: Sat Mar 28, 2009 4:23 pm
Posts: 415
Website: http://jedsmith.org/
Location: Out of his depth and job-hopping without a clue about network security fundamentals
If all you need is php mail(), consider ssmtp. You'll need another mailhost somewhere that will allow you to relay through it.

_________________
Disclaimer: I am no longer employed by Linode; opinions are my own alone.


Top
   
 Post subject: Thank you .....
PostPosted: Thu Jun 03, 2010 6:27 pm 
Offline
Senior Newbie

Joined: Thu May 27, 2010 9:00 am
Posts: 14
it turns out all I had to do was apt-get install postfix.

I sampled the email at that point and it worked without any further intervention.

Thank you all :P


Top
   
 Post subject:
PostPosted: Fri Jun 04, 2010 3:53 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Just make sure

relayhost =

Is empty (it probably is) so people can't send spam through your server.


Top
   
 Post subject:
PostPosted: Fri Jun 04, 2010 4:17 am 
Offline
Senior Newbie

Joined: Thu May 27, 2010 9:00 am
Posts: 14
obs wrote:
Just make sure

relayhost =

Is empty (it probably is) so people can't send spam through your server.


Checked that immediately. It was empty as you suspected.

Thanks for the headsup :)


Top
   
 Post subject:
PostPosted: Fri Jun 04, 2010 11:49 am 
Offline
Junior Member

Joined: Thu Jun 03, 2010 4:44 pm
Posts: 35
obs wrote:
Just make sure

relayhost =

Is empty (it probably is) so people can't send spam through your server.


The "relayhost" parameter does not stop others from using your server for relaying email. This parameter defines if email will be sent directly through the internet, or if it will user another email server to send email. See http://www.postfix.org/BASIC_CONFIGURATION_README.html#relayhost.

You can disable relaying by only allowing emails to be sent only from specific origin ip addresses. See http://www.postfix.org/BASIC_CONFIGURATION_README.html#relay_from and http://www.postfix.org/postconf.5.html#mynetworks.


Top
   
 Post subject:
PostPosted: Fri Jun 04, 2010 1:32 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Whoops BiranJM's right...I shouldn't answer posts first thing in the morning.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group