Linode Forum
https://forum.linode.com/

Sending mail only for several websites (Postfix?)
https://forum.linode.com/viewtopic.php?f=11&t=9471
Page 1 of 1

Author:  arsenico [ Thu Oct 18, 2012 5:05 am ]
Post subject:  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 :)

Author:  Vance [ Fri Oct 19, 2012 12:34 am ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

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:
Code:
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.

Author:  arsenico [ Mon Oct 22, 2012 5:04 am ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

Vance wrote:
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:
Code:
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!

Author:  Vance [ Mon Oct 22, 2012 11:13 pm ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

The file /usr/sbin/sendmail should exist on your system and be runnable by ordinary users. Try
Code:
/usr/sbin/sendmail -t -i <<EOT
To: me@example.org
Subject: simple test

This is only a test.
EOT

(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.

Author:  arsenico [ Wed Oct 24, 2012 5:38 am ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

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?

Author:  Vance [ Wed Oct 24, 2012 10:17 pm ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

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.

Author:  arsenico [ Thu Oct 25, 2012 9:21 am ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

Vance wrote:
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:

Quote:
<root@liXXX-XX.members.linode.com>: Unrouteable address
2012-10-25 13:19:33 1TRNLR-0004l6-UG Frozen (delivery error message)


Really stuck here :(

Author:  Vance [ Thu Oct 25, 2012 11:45 pm ]
Post subject:  Re: Sending mail only for several websites (Postfix?)

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?)

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/