Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This may be a lame question..

All the time I was using postfix to send mails via my rails app. I just install postfix via these commands, cause i never really thought about the what actually going in this postfix thing. I was more concerned about the application of the code and all.

  sudo apt-get install postfix
  sudo apt-get install bsd-mailx

If you use postfix, then you fix it quickly by disabling tls by setting “smtpd_use_tls=no” in /etc/postfix/

sudo /etc/init.d/postfix start

Thats it. My rails app automatically start sending mails for me via postfix. But now i need smtp settings for this postfix. How can i find out that? Can anybody tell me?


I am looking for SMTP Hostname, SMTP Username, SMTP Password, Port(Its 25 for default)

share|improve this question
there are more than 700 postfix configuration parameters in. 95 of these are for configuring smtp sending rules. maybe you can be a little more explicit about what you need to do? – sysfault Nov 9 '11 at 8:09
@adirau check edit part.. – Mohit Jain Nov 9 '11 at 9:55
up vote -1 down vote accepted

Mail postfix configuration file is /etc/postfix/ Default one (most probably you have default file there) is well-commented and describes defaults for most of the parameters listed there (that's not all params, but it's a good start).

I'd suggest reading this file together with postfix documentation.

BTW, what problem you are actually trying to solve? It's often not necessary to touch any postfix config for just sending mail from localhost.

share|improve this answer

This ma be a lame answer:

You can find out the default configuration by postconf -d this is what Postfix assumes if you have no configuration. But you asked for the defaults!

If you want to find out the current(!) configured settings then you can do this with postconf -n.

When you then need to know what each setting means then you are guided to read the explanation at

share|improve this answer

You must to open port 25 on firewall for smtp. In next link you can find basic configuration for postfix.

share|improve this answer
How to do that?? Can u guide me?? – Mohit Jain Nov 9 '11 at 9:54
@MohitJain NO! How should we know what firewall you have. And even if we know, this is not related to your original question. And even if you open a new question asking that: This is no help forum. – mailq Nov 9 '11 at 13:46

ok, so you have a default postfix install and one piece of r0r app that must be configured to send emails. I will assume you will install postfix on the same server you are running your ror application. If you are planning to host the postfix install on a remote server, don't. I advise on using a local postfix installation as described below, mostly for security purposes.

to make sure you installed postfix correctly do a fresh postfix install IF and only if you are ok with completely deleting the current postfix installation. If you're not ok with this just skip to __postfix_configuration_checks paragraph.

apt-get purge postfix
apt-get install postfix

On debian (and I guess on ubuntu as well) the installer will ask you how do you want to use postfix. choose "local only". That is, "the only delivered mail is the mail for local users", just as a security measure.

when the install process finishes you should have a postfix instance listening on localhost, port 25, allowing mail sent from localhost to be queued unconditionally (default settings)


you can check the policies by running postconf like this:

postconf smtpd_recipient_restrictions mynetworks

and the output you will see should be the same with:

smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
mynetworks = [::ffff:]/104 [::1]/128

you should also (double-) check that your postfix is listening only on loopback interface, port 25:

netstat -nltp  |grep master
tcp        0      0  *               LISTEN      4713/master     

now you're ready to configure your rail app:

hostname='localhost' #or ''
password='' #or nil, dunno
username='' #or nil?

you should be able to send emails from your ror app thru your postfix install

share|improve this answer
don't "purge" the current postfix install unless you're ok to loose the current postfix files and configuration. purging and reinstalling is the easy way to make sure postfix will run as you need for local clients, since debian/ubuntu gives preconfigured usecase installs and it will save you time from reading a lot of documentation and messing with – sysfault Nov 9 '11 at 10:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.