Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
Lightweight outgoing SMTP server

I am looking for a minimal mail solution (MTA) for a headless server which generate e-mails for local users and and fully qualified addresses from cron-jobs, etc. Ideally all mails to local user foo should be mapped to foo@mydomain, with possible modifications for uid<1024, and sent off to an external smtp server without involving /var/mail.

Some years ago, I used sSMTP for a similar task, and I was wondering if this is still the way ahead? Also, how much of the default debian mail system should/could I remove?


Update Ended up Googling a bit, and the obvious candidates seem to be

Even though eSMTP is not developed anymore, it seems to have the nicest documentation. It doesn't quite fit my needs though, at it seems to insist on delivering mail to local user foo via a Mail Delivery Agent (MDA) instead of pushing it out over smtp to foo@some.domain. Or maybe it does do the mapping if I add qualify_domain to the config. Might have to try it out...
nullmailer appears to be running a queue in /var, which is not something I want.

Does anybody have experience with any of these?

share|improve this question

marked as duplicate by Michael Mrozek Jan 14 '11 at 22:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
Oops -- possible dupe of this question: unix.stackexchange.com/questions/1449/… –  Janus Jan 14 '11 at 15:16
    
I closed as a duplicate, but I don't think it can be cleanly merged; most of these answers reference the question in ways that won't make sense on the other post –  Michael Mrozek Jan 14 '11 at 22:39

3 Answers 3

Nullmailer might fit the bill:

Nullmailer is a mail transport agent designed to only relay all its messages through a fixed set of "upstream" hosts.

If you just install the Debian package, it will replace whatever MTA was there before.

share|improve this answer
    
Thanks. Seems nullmailer does queuing in /var which is something I want to avoid. l3jane.net/cgi-bin/man/man2html?8+nullmailer-send . Now I got googling, so I'll expand the question with a few alternatives :) –  Janus Jan 13 '11 at 16:10

My recommendation would be nullmailer too. We were in a similar situation before (need to use a second MTA in Zimbra boxes for system-generated mail) and it fits the bill nicely.

However, your requisite of not using /var is a hurdle. Could you elaborate on the reasons why? If the problem is using the disk at all, you could mount nullmailer's queue on tmpfs. It wouldn't be quite safe, but at least it wouldn't touch the disk at all.

share|improve this answer
    
Thanks. Yes, I want to avoid var to keep the disk idle. You are right about tmpfs of course, but I'd like to keep it as simple as possible... –  Janus Jan 14 '11 at 5:36

IMHO, the easiest way to do this is to install postfix (if debconf asks you questions, pick "internet site"), then run these commands:

postconf -e relayhost=other.mailserver.com
postconf -e mailname=my.domainname.com

As long as the SMTP server specified in relayhost doesn't require authentication, allows you to relay or is a valid destination for the recipient address this will work.

The mailname parameter will be the default domain name. So if you send mail to foo it will go to foo@my.domainname.com. Mail sent by user bar will be from bar@my.domainname.com.

If you do need to authenticate and want to support TLS, also run the following commands:

postconf -e smtp_tls_security_level=may
postconf -e smtp_sasl_auth_enable=yes
postconf -e smtp_sasl_password_maps=pcre:/etc/postfix/sasl_password_maps

Then in /etc/postfix/sasl_password_maps have this content:

/./ username:password

All mail will be sent to your relayhost with the specified username and password.

share|improve this answer
    
I'll need the authentication. Plain could work, but StartTLS would probably be nice. But installing postfix seems like it would be massive overkill?! –  Janus Jan 14 '11 at 5:41
    
I updated my answer to include client auth and TLS support. –  bahamat Jan 16 '11 at 19:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.