Sending mail only for several websites (Postfix?)

Hi all linoders!

I have a question that may seem simple for you all, but I am stuck a little.

I had a wordpress installation on my linode, used msmtprc for sending mail. The domain itself was at google apps and I had no problem receiving emails.

What happened next is I started growing and offered wordpress sites for my clients, friends, etc. (domains pointed using virtual directories).

It all works, but emails sent are only from the single address in my msmtprc config file.

As far as I understand, I need to start using postfix or other software for the server to start sending emails.

What would be the solutions easiest in setup and usage? If postfix, then how do I use that for all my wordpress installations?

Thanks for bearing with my questions :)

7 Replies

Postfix can do this fine. You'll set it up like a normal internet mail host, then make a few configuration changes so that it doesn't accept mail from outside. In main.cf, set:

myorigin = $mydomain
inet_interfaces = loopback-only
local_transport = error:local delivery is disabled

In master.cf, you would comment out the entry for the local delivery agent. Don't bother with installing Dovecot or Courier since you're not handling local mail.

Exim can do this also.

In either case, you need to remove msmtp before installing Postfix or Exim.

You may also look into configuring msmtp to use different account configurations for different sites.

@Vance:

Postfix can do this fine. You'll set it up like a normal internet mail host, then make a few configuration changes so that it doesn't accept mail from outside. In main.cf, set:

myorigin = $mydomain
inet_interfaces = loopback-only
local_transport = error:local delivery is disabled

In master.cf, you would comment out the entry for the local delivery agent. Don't bother with installing Dovecot or Courier since you're not handling local mail.

Exim can do this also.

In either case, you need to remove msmtp before installing Postfix or Exim.

You may also look into configuring msmtp to use different account configurations for different sites.

Thanx, Vance!

I removed msmtp, installed and configured Exim. Now it does send emails from command line, so things seem OK. But neither one wordpress installation now sends emails. Do I need to configure anything in Wordpress itself? Sorry for noob questions!

The file /usr/sbin/sendmail should exist on your system and be runnable by ordinary users. Try

/usr/sbin/sendmail -t -i <

(substituting your own e-mail address) and see if this sends a test message to you.

BTW, it will be easier to provide help if you let us know what distribution and version you are running.

Yes, sorry, I am running Ubuntu 12.04.

I tried using sendmail - the file itself does exist, it allowed me to run the command you quoted, but no mail arrived.

So I believe that is about permissions for sendmail, right?

The mailq command will show the pending mail queue - see if your outgoing message is in there. Looking at /var/log/mail.log should tell you what happened to the test message.

@Vance:

The mailq command will show the pending mail queue - see if your outgoing message is in there. Looking at /var/log/mail.log should tell you what happened to the test message.

Mail gets frozen and this is what I get in the exim4 log:

> <root@liXXX-XX.members.linode.com>: Unrouteable address

2012-10-25 13:19:33 1TRNLR-0004l6-UG Frozen (delivery error message)

Really stuck here :(

I am not familiar with Exim so I can't offer detailed suggestions. However, I would imagine that your mail log file contains more entries that would be helpful. The line you posted appears to relate to local delivery failure of a status message. There should be other lines showing the fate of outgoing messages. (You sent your test message to an external address, right?)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct