Score:1

postfix smtpd process bound to unix domain socket

us flag

To utilize a special cleanup daemon for outgoing emails only, I defined a special smtpd process in master.cf that is used as default_transport. (Only postfix should be able to submit emails through this daemon!)

127.0.0.1:10027 inet    n       -       -       -       -       smtpd
  -o syslog_name=postfix-smtpout
  -o cleanup_service_name=srscleanup
  -o smtpd_tls_security_level=none
  -o content_filter=smtp:
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o smtpd_sender_restrictions=permit

This works fine. However, it is open to any local user/process on the machine connecting to this port and submitting mail without authentication (due to the relaxed sender/recipient restrictions), which is not very secure.

Therefore, I would like to run this special smtpd as a unix domain socket (which only processes running under the postfix user can access).

I set default_transport = smtpout and created a service in master.cf like this:

smtpout     unix  -       -       -       -       -       smtpd
  -o syslog_name=postfix-smtpout
  -o cleanup_service_name=srscleanup
  -o smtpd_tls_security_level=none
  -o content_filter=smtp:
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o smtpd_sender_restrictions=permit

However, this results in emails getting stuck in the queue and log messages like this: warning: unexpected end-of-input from private/smtpout socket while reading input attribute name.

How can I fix this and use a smtpd process bound to a unix domain socket (instead of binding to inet)?

Paul avatar
cn flag
I'm weak on `master.cf`, but if you are running `postfix` in a `chroot`, have you placed the socket within the `chroot` and can `postfix` write to it?
us flag
@Paul Yes. I have also tried not chrooting the `smtpout` smtpd, but that didn't help either.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.