Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a content filter for Postfix (2.9.3 package installed via apt on an Ubuntu 12.04 test VM) and I'm starting with a very basic Ruby (1.9.3) template and building up functionality. Strangely, when the script is enabled, messages sent are being forwarded on as normal, but also sent back to the sender which is not normal. Disabling the script disables this behavior. Any suggestions about what I have to change to stop that from happening? Thanks for any advice!

/etc/postfix/ (only the lines changed from the default)

smtp inet  n  -  -  -  -  smtpd -o content_filter=dumper:dummy
dumper unix - n n - 10 pipe
    flags=RF user=mailuser argv=/home/mailuser/mailfilter/dumper.rb ${sender} ${recipient}`


#!/usr/bin/env ruby
require 'open3'
message = $
cmd = "/usr/sbin/sendmail -G -i  #{ARGV[0]} #{ARGV[1]}" 
stdin, stdouterr, wait_thr = Open3.popen2e(cmd)
logfile ="#{dir}/#{logfile}", 'a')
share|improve this question
up vote 2 down vote accepted

That's because you forgot -r in front of #{ARGV[0]} :)

share|improve this answer
I think this sums it up best: (╯°□°)╯︵ ┻━┻ (thanks!) – mjbraun Nov 14 '12 at 16:54

Your Answer


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.