views:

20

answers:

1

I have a linux server, where I just installed postfix.

I have done nothing more with the email server config.

My website is a classifieds website, where users may put ads, delete ads etc etc. No login and no member functions at all.

Only place I need to use email is this:

  • When posting a new classified a confirmation email will be sent out
  • When deleting a classified a confirmation email will be sent out
  • When contacting the support
  • users are able to email the seller by clicking "email seller" and filling out a form.

My Q is, how should I configure Postfix?

Do I need SASL, and TLS? What else do I need to know?

Btw, PHP is used to mail...

+1  A: 

This means postfix will only be used locally, so in order to be safe prevent outside users from contacting your mailer by configuring your firewall to block port 25 incoming.

Edit postfix' main.cf and set the following, I think this should be enough to get you up and running. Make sure to study the other settings too if they also apply to your situation.

# The inet_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on.  By default,
# the software claims all active interfaces on the machine. The
# parameter also controls delivery of mail to user@[ip.address].
# 
# See also the proxy_interfaces parameter, for network addresses that
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter changes.
#
#inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
inet_interfaces = localhost

# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
# 
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld

# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
#mydomain = domain.tld

# The relayhost parameter specifies the default host to send mail to
# when no entry is matched in the optional transport(5) table. When
# no relayhost is given, mail is routed directly to the destination.
# 
# On an intranet, specify the organizational domain name. If your
# internal DNS uses no MX records, specify the name of the intranet
# gateway host instead.
#
# In the case of SMTP, specify a domain, host, host:port, [host]:port,
# [address] or [address]:port; the form [host] turns off MX lookups.
# 
# If you're connected via UUCP, see also the default_transport parameter.
# 
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
Marc van Kempen
PS Since you are using this as a local server with no logins, there is no point in configuring TLS/SASL.
Marc van Kempen
Thanks.... One more question about incoming email. If I block incoming, will I then be able to have conversations with other users? For example, when users reply to us, will the emails be delivered to us if incoming is blocked? If not, what should I do about this? Thanks again
Camran
I was assuming that the outgoing email is handled by another server (the relay host in the configuration example above). This would also imply that receiving your email is also handled by another server. Is this not correct? Will your email be received by the same server? Is so, then you cannot block port 25, but you will also need to make sure your email server cannot be used as a relay host (i.e. used as a spam host). I just realised that given the configuration example above, you might as well contact the relay host directly from your webpage. Are you using smtp from your webpage?
Marc van Kempen
Sorry for the late response... I have no experience in email servers, so I was hoping for you to give me a good solution here. Is two email-servers preferred maybe, one for incoming, one for outgoing? And I don't quite understand what you mean by contacting relayhost from my webpage. I need the most basic information to get this running. Smtp isn't anything I am using now, but if I need it then I will get it. What would you do in my case? As I said, I am a novice on email-servers. Thanks again
Camran
Let's take a step back then, what is your situation and what do you need to accomplish? So what email domain will you be using for the new server, where is that domain hosted. How will you send the email from your webpage?
Marc van Kempen
I have a VPS, which has the Ubunti 9.10 OS. On this I have postfix installed with default config. I will be sending mail using php:s mail function from my webpages. The postfix server I created is called server1.domain.com.
Camran
In this case it is probably best to configure postfix on your server as outlined in my original answer. Just try to find out the hostname of the mailserver of your isp (where you rent your VPS) and set that as the relayhost in main.cf. Set the 'myhostname' parameter to server1.domain.com, and set 'mydomain' to domain.com. You will probably need to restart your mailserver after reconfiguration, use 'sudo service postfix restart' for that.
Marc van Kempen