Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a SMTP server that can start on localhost without root privileges? Postfix and sendmail both require root to start.

Update: To clarify both Postfix and sendmail require root to start even if port is changed to above 1024.

share|improve this question
    
What fails when you try to start Postfix on a high port? You'd need to turn off the chrooting, and make sure everything that Postfix needs is owned by your user, but with enough custom config it should be doable. Useless, but doable. –  womble Mar 3 '12 at 23:05
    
Postfix source code specifically requires superuser to start daemon and smtp so not possible. –  vamur Mar 4 '12 at 1:16
    
After some research solution is to install exim, change SMTP port number, chown exim spool directory for the required user, then modify exim source code to remove the requirement for root and chowns. –  vamur Mar 4 '12 at 1:20
    
Can you narrow it down a bit? "Postfix source code" is a pretty big haystack. –  womble Mar 4 '12 at 1:20
1  
src/postfix/master.c look for "msg_fatal("the master command is reserved for the superuser");". This message is also present in other locations in postfix source code –  vamur Mar 4 '12 at 1:27
add comment

3 Answers

Root privileges are required to listen on ports <1024. Usage of these ports is restricted to root or a user running with the CAP_NET_BIND_SERVICE privilege (which requires root to configure).

Your other option is to run a server on a port >1024.

share|improve this answer
    
Postfix/Sendmail still require root to start on port > 1024 –  vamur Mar 3 '12 at 19:45
add comment

After some research solution is to install exim, change SMTP port number, chown exim spool directory for the required user, then modify exim source code to remove the requirement for root and chowns.

share|improve this answer
add comment

I can recommend Haraka - you can use it as non-root on a high port without modifying the source code.

Disclaimer: I wrote Haraka.

share|improve this answer
    
Haraka is a pleasant alternative to Postfix. Great work. –  ghayes Sep 12 '12 at 8:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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