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/main.cf
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?
EDIT
I am looking for SMTP Hostname, SMTP Username, SMTP Password, Port(Its 25 for default)
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 http://www.postfix.org/postconf.5.html
You must to open port 25 on firewall for smtp. In next link you can find basic configuration for postfix. http://www.postfix.org/STANDARD_CONFIGURATION_README.html
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.
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)
__postfix_configuration_checks
you can check the policies by running postconf like this:
and the output you will see should be the same with:
you should also (double-) check that your postfix is listening only on loopback interface, port 25:
now you're ready to configure your rail app:
you should be able to send emails from your ror app thru your postfix install
Mail postfix configuration file is
/etc/postfix/main.cf
. 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.