Simple postfix installation
Is it possible to configure postfix to send emails without setting up a domain for the server? I am using Ubuntu 10.04.
In this guide
Thank you
11 Replies
@fernandoch:
In this guide
it asks for a FQDN. I just want to test sending emails. http://library.linode.com/email/postfix … 0.04-lucid">http://library.linode.com/email/postfix/gateway-ubuntu-10.04-lucid
For testing purposes, you could use the default reverser dns for your static IP address as your FQDN, such as li-x-x.members.linode.com.
–
Travis
Thank you
There are any number of mail user agent packages that you can use on top of postfix for delivery (and you can install more than one), but if you're just looking for a very basic/traditional "mail" command, try the bsd-mailx package.
– David
You mean I can use postfix alone to send emails from a web application like wordpress or drupal because it is sendmail-compatible?
I just want my server to be able to send emails, only that…
I will try it with exim by following this guide
@fernandoch:
It can be done, but mailutils has to be installed too.
That will depend on just what is generating the mail (you haven't mentioned any specifics). If your application stack and/or scripts need a command line "mail" command to be able to prepare and queue a message to be sent, then yes, you'll need another package. I think on Ubuntu, any of bsd-mailx (what I typically use), heirloom-mailx, or mailutils (gnu version along with other tools) would all work at least. It's not like installing one of these hurts if you end up not using it, so if it solved your issue, that's great.
However, that fact doesn't imply that you must install such a package to be able to configure an outbound only server.
While it's not that uncommon for shell scripts or other simpler stuff to want to use "mail", I would expect most larger application stacks to format messages themselves and either deliver through a sendmail interface or directly to an SMTP server (which can also be your local Postfix installation). In the latter case no extra packages would be required.
– David
@db3l:
While it's not that uncommon for shell scripts or other simpler stuff to want to use "mail", I would expect most larger application stacks to format messages themselves and either deliver through a sendmail interface or directly to an SMTP server (which can also be your local Postfix installation). In the latter case no extra packages would be required.
– David
And how can you test it easily?
@fernandoch:
And how can you test it easily?
In general terms, configure your application stack to send mail - for which instructions should be available as part of its installation - and see what happens :-)
If trying to diagnose issues, you can use log files like /var/log/mail.* for the various logs Postfix generates while processing messages, check the mail queue (for stuck items) with "mailq", or if the application fails when trying to send, check out any logs specific to that application.
If instead, by "test it" you meant manually test outbound mail interactively (without your application), assuming it's primarily a setup time check, it's easy enough to just use sendmail yourself, as in:
$ sendmail user@dom.ain [ user@dom.ain ...]
and just enter some dummy text for the message (end with a line with just a period(.) or Ctrl-D). You need to manually put in headers like Subject: or To: but I usually don't bother - at worst the message will end up in a spam folder, which still shows successful receipt. Or just check the mail log to verify that it was at least properly delivered off of your host, which is really all you need to care about.
Or you can install any MUA (either one of the previously discussed simple mail utilities or a more complete mail agent like mutt) to let you interactively create messages. But this step is still optional.
I do generally end up installing bsd-mailx on my systems so I have a very simple interactive tool for generating a quick message. But that's really a choice for my own interactive use, and not something required by the applications I install. (Well, sometimes my own quick 'n dirty shell scripts)
– David
I will try that.