Hi all. I have been banging my head against the wall for two days. Hoping you can help; this isn''t strictly a rails problem, but something I''m encountering in trying to get rails and postfix to work together. I want to automate dealing with bounced messages, so I have bounced emails bounce back to "bounces-3Q2Tfjf0mewU04JRNCRQjg@public.gmane.org" I want to do this in my /etc/aliases file: bounces: | "RAILS_ENV=production /usr/bin/ruby /home/rails/appname/ current/script/runner ''BouncedEmail.receive(STDIN.read)'' so that I can process the email in rails. But it''s not working, and I don''t know what I''m doing wrong, so I tried the following: If I have "bounces: root", then the email gets properly directed to root''s email folder fine, so the alias stuff should be working, but piping to a trivial command doesn''t seem to work at all. If I do bounces: | "echo ''hi'' > /tmp/test" I see nothing when I send an email to bounces. Anybody have any ideas?
On Mon, May 18, 2009 at 1:38 PM, rcs <rsarvis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to automate dealing with bounced messages, so I have bounced > emails bounce back to "bounces-3Q2Tfjf0mewU04JRNCRQjg@public.gmane.org" > > I want to do this in my /etc/aliases file: > > bounces: | "RAILS_ENV=production /usr/bin/ruby /home/rails/appname/ > current/script/runner ''BouncedEmail.receive(STDIN.read)''I would think that would be iffy just because of the startup time. Personally I would create an actual "bounces" user, let the mails go to that account normally, and run a cron job to process the mail file. YMMV! -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
On Mon, May 18, 2009 at 3:38 PM, rcs <rsarvis-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to do this in my /etc/aliases file: > > bounces: | "RAILS_ENV=production /usr/bin/ruby /home/rails/appname/ > current/script/runner ''BouncedEmail.receive(STDIN.read)''You need to use procmail, and put something almost exactly like that in your .procmailrc. http://userpages.umbc.edu/~ian/procmail.html -- Greg Donald http://destiney.com/
Two things - the | character should be inside the quotes. And, take a look at this: http://forum.symfony-project.org/index.php/m/26063/ for discussion on getting a similar setup running (postfix needs to be delivering as a user other than nobody). --Matt Jones On May 18, 4:38 pm, rcs <rsar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all. I have been banging my head against the wall for two days. > Hoping you can help; this isn''t strictly a rails problem, but > something I''m encountering in trying to get rails and postfix to work > together. > > I want to automate dealing with bounced messages, so I have bounced > emails bounce back to "boun...-3Q2Tfjf0mewU04JRNCRQjg@public.gmane.org" > > I want to do this in my /etc/aliases file: > > bounces: | "RAILS_ENV=production /usr/bin/ruby /home/rails/appname/ > current/script/runner ''BouncedEmail.receive(STDIN.read)'' > > so that I can process the email in rails. > > But it''s not working, and I don''t know what I''m doing wrong, so I > tried the following: > If I have "bounces: root", then the email gets properly directed to > root''s email folder fine, so the alias stuff should be working, but > piping to a trivial command doesn''t seem to work at all. If I do > > bounces: | "echo ''hi'' > /tmp/test" > > I see nothing when I send an email to bounces. > > Anybody have any ideas?
hello! Can you help me out in implementing bouncing?? Regards, Harish (erharish43.malik-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org) rcs wrote in post #817505:> Hi all. I have been banging my head against the wall for two days. > Hoping you can help; this isn''t strictly a rails problem, but > something I''m encountering in trying to get rails and postfix to work > together. > > I want to automate dealing with bounced messages, so I have bounced > emails bounce back to "bounces-3Q2Tfjf0mewU04JRNCRQjg@public.gmane.org" > > I want to do this in my /etc/aliases file: > > bounces: | "RAILS_ENV=production /usr/bin/ruby /home/rails/appname/ > current/script/runner ''BouncedEmail.receive(STDIN.read)'' > > so that I can process the email in rails. > > But it''s not working, and I don''t know what I''m doing wrong, so I > tried the following: > If I have "bounces: root", then the email gets properly directed to > root''s email folder fine, so the alias stuff should be working, but > piping to a trivial command doesn''t seem to work at all. If I do > > bounces: | "echo ''hi'' > /tmp/test" > > I see nothing when I send an email to bounces. > > Anybody have any ideas?-- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.