# \[OT\] is there an alternative to putting an MTA on each serve

**URL:** <https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404>\
**Category:** Deployment\
**Created:** [March 28, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404 "2007-03-28T14:13:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 28, 2007, 2:13pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/1 "2007-03-28T14:13:23Z")

</div>

This is really pretty much OT so feel free to ignore.

I’ve got a group of servers I’m setting up (well a bunch of xen  
instances on a dedicated box, to be precise). I’ve set up one of them as  
a dedicated MTA (postfix). I don’t need (and don’t want) MTAs on the  
other servers, but do want to be emailed cron reports and logs from  
logrotate. Is there any good, standard solution to this? Sorry, probably  
dead obvious, but I’ve google for an hour or so now and haven’t come up  
with anything, and this group has been v helpful in he past.  
Thanks  
Chris

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 28, 2007, 3:13pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/2 "2007-03-28T15:13:52Z")

</div>

Chris T wrote, circa 2007-03-28 8:12 AM:

> This is really pretty much OT so feel free to ignore.
> 
> I’ve got a group of servers I’m setting up (well a bunch of xen  
> instances on a dedicated box, to be precise). I’ve set up one of them as  
> a dedicated MTA (postfix). I don’t need (and don’t want) MTAs on the  
> other servers, but do want to be emailed cron reports and logs from  
> logrotate. Is there any good, standard solution to this? Sorry, probably  
> dead obvious, but I’ve google for an hour or so now and haven’t come up  
> with anything, and this group has been v helpful in he past.

I’ve used ssmtp for that effect in the past. It appears to be part of  
the Debian project since its homepage is:

[Debian -- Error](http://packages.debian.org/stable/mail/ssmtp.html)

I know it’s available out of the box in Gentoo (emerge mail-mta/ssmtp),  
and Ubuntu and Debian (apt-get install ssmtp). It’s also available in  
Fedora Extras which means it could probably be rebuilt pretty easily for  
CentOS, Red Hat Enterprise Linux, or other RHEL derivatives.

All it does is takes mail and foists it off to another host,  
configurable in /etc/ssmtp/ssmtp.conf (or possibly  
/usr/local/etc/ssmtp/ssmtp.conf if you’ve built from source).

You _can_ also use Postfix to do that, with the relayhost parameter in  
main.cf, but that’d probably be overkill for what you’re after. I’m  
also positive that Sendmail can do it, too, provided you have high  
enough a skill rating in Arcane Sendmail Configuration Black Arts.

Hope that helps,  
Jeff

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 29, 2007, 10:24am UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/3 "2007-03-29T10:24:39Z")

</div>

Jeff A. wrote:

> > dead obvious, but I’ve google for an hour or so now and haven’t come up  
> > Fedora Extras which means it could probably be rebuilt pretty easily for
> 
> Hope that helps,  
> Jeff
> 
> >

Jeff  
Yup. That seemed to work fine, although I’m struggling to get the  
authentication to work with the postfix relay. Do you happen to know if  
you need to compile from source with auth built in if you want  
authentication to work. The docs are a little… basic  
Thanks for your help  
Chris

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 29, 2007, 2:34pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/4 "2007-03-29T14:34:02Z")

</div>

Jeff A. wrote:

> It also looks like it only supports LOGIN and CRAM-MD5 according to
> 
> Jeff
> 
> >

Sounds good. Thanks for the suggestions

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 30, 2007, 3:32pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/5 "2007-03-30T15:32:34Z")

</div>

You can also control authentication from /etc/ssmtp/ssmtp.conf  
with the following parameters:

AuthUser=  
AuthPass=  
AuthMethod=

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 29, 2007, 2:24pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/6 "2007-03-29T14:24:45Z")

</div>

Chris T wrote:

> Yup. That seemed to work fine, although I’m struggling to get the  
> authentication to work with the postfix relay. Do you happen to know if  
> you need to compile from source with auth built in if you want  
> authentication to work. The docs are a little… basic

I honestly do not know, since I’ve never tried to do authN SMTP with it.  
It also looks like it only supports LOGIN and CRAM-MD5 according to  
the man page, so I can’t really test it as our SMTP server doesn’t do  
either of those. Try this, though:

/usr/sbin/ssmtp -auUSERNAME -apPASSWORD root

Enter some data and hit enter twice to end. For me, this spat out the  
error:

ssmtp: Server didn’t accept AUTH LOGIN (504 5.3.3 AUTH mechanism  
LOGIN not available)

Maybe it’ll give you something equally useful. Hopefully, if it’s  
compiled without authN support, it’ll complain about that. You may also  
want to do:

export HISTCONTROL=ignorespace

first. If you then put a space before /usr/sbin/ssmtp it won’t save  
that command in your shell history, so your password won’t be written in  
your history file for anyone with the right perms to see. Mmmmmm.  
bash.

> Thanks for your help

Sure thing. Sorry I can’t be of more assistance, but I suspect that  
ssmtp is supposed to solve a very simple problem and thus doesn’t offer  
much in the way of advanced SMTP capabilities. If you can’t get it to  
do this, I’d suggest looking into setting up Postfix as a satellite host  
and not listening on port 25 for the world to hit.

Thanks,  
Jeff

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [March 30, 2007, 5:33pm UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/7 "2007-03-30T17:33:55Z")

</div>

Ah, cool. I figured there was a way to do that, but didn’t know the  
directives to use.

Thanks,  
Jeff

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [April 3, 2007, 12:37am UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/8 "2007-04-03T00:37:57Z")

</div>

Scott wrote:

> >

Scott  
Thanks for that. For some reason I can get the authentication working  
with Cram-MD5, but suspect I’m just being dim. However, checking this  
out has led me to a couple of other options, nullmailer and an improved  
version of mailx (was nail, now called Heirloom mailx) which skips a  
local MTA altogether.  
Thanks  
Chris

---

<div class="post-metadata">

**Author:** ![Chris\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a8b319/32.png) [@Chris\_T](https://www.ruby-forum.com/u/Chris_T)\
**Post date:** [April 3, 2007, 1:38am UTC](https://www.ruby-forum.com/t/ot-is-there-an-alternative-to-putting-an-mta-on-each-serve/90404/9 "2007-04-03T01:38:01Z")

</div>

Chris T wrote:

> Thanks for that. For some reason I can get the authentication working  
> with Cram-MD5, but suspect I’m just being dim. However, checking this  
> out has led me to a couple of other options, nullmailer and an improved  
> version of mailx (was nail, now called Heirloom mailx) which skips a  
> local MTA altogether.

Chris,

I hadn’t heard about nullmailer – thanks for bringing it to our  
attention. I’ll look into it in the future if I need such a thing. I’m  
also glad you found something that met your needs!

Thanks,  
Jeff
