I have installed Postfix on a Docker container and Postgresql on another one. When sending emails between two users, everything is OK but when I tried to invoke a Shell script on mail receipt (using this tutorial: Iredmail hooks), I got the following message (in the log file /var/log/iredapd/iredapd.log):

ERROR: Unexpected error: (OperationalError) could not connect to server connection refused 
    Is the server running on host "" ... ?

Why Iredmail is looking locally when using hooks ? How to configure it to enable hooks ?

  • You're missing a lot of information. First, what are you doing with the script? Second, couldn't connect to what server (postfix/postgres)? – NickW May 2 '17 at 16:34
  • OK: I have a bash script which will echo a string in a text file. Postfix container and postgresql container communicate very well when sending an e-mail. The problem appears when I added a hook to a recipient Y (using master.cf of postfix), the above error appears ! Seems like Postfix is searching locally (inside its container) ! How to fix that issue ? – sfaxiano May 3 '17 at 8:23
  • Well, I imagine you'll need to specify where it actually is, could you paste the line you put in your master.cf? – NickW May 3 '17 at 8:49
  • external-pipe unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/var/script.sh – sfaxiano May 3 '17 at 9:10
  • Well, a pipe command is literally a local command, does postfix use the vmail user, and is that file there and available in /var/ ? – NickW May 3 '17 at 9:14

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.