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.

When I run the sendmail -bs command as root, I get the expected output:

$ sudo sendmail -bs
220 mydomain.com ESMTP Postfix
ehlo localhost
250-mydomain.com
250-PIPELINING
250-SIZE 15728640
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

But when I run the same command without sudo, I get no output at all and sendmail doesn't respond to any commands:

$ sendmail -bs
ehlo localhost
quit
wtf
^C
$ 

How can I configure Postfix so that sendmail works for every user (or at least for some specific users)? I need this because SwiftMailer for PHP uses sendmail -bs for sending mails and fails when it can't find any output.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

As documented, sendmail -bs is implemented by running the smtpd(8) daemon.
Since this binds to port 25, it requires root privileges.

Consider using SwiftMailer instead with one of the other sending options, such as batched mode or SMTP mode.

As also documented, sendmail -bs will not act like a "real" postfix SMTP server unless you run it with the mail_owner personality.

The only advantage over batch mode is that SMTP mode allows you to run messages through postfix' access controls. Since you cannot do that the way you are currently using it, use batch mode instead.

share|improve this answer
    
I was under the assumption that the only way I could send mail through the local SMTP server was to use sendmail - that SmtpTransport was used only to connect to remote systems. But SmtpTransport::newInstance('localhost', 25); works just as fine. Thanks! –  Tatu Ulmanen Dec 6 '12 at 10:21

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.