Excuse me if this has been answered before… I couldn’t find the
solution anywhere. I’m really having a problem with Postfix I believe,
but I expect the Rails community to be the friendliest source of
information, especially since I suspect someone has dealt with this
I have Postfix set up to deliver all mail to a specific domain to
ActionMailer in my Rails app. This works beautifully, except for one
hitch. From what I can tell, Postfix delivers mail sent to more than
one address in parallel, meaning at the exact same time with
multiple threads. No matter what kind of checking I do in my
ActionMailer “receive” method, I cannot catch duplicate incoming
messages, thus weird things happen in my app.
Basically, I need a way to disable multi-threaded/parallel mail
delivery in Postfix, or a way to guarantee that ActionMailer will
catch duplicate messages.
Just in case this doesn’t make sense, let me explain further…
ActionMailer receives all mail for example.com and does something with
- John D. sends a message to both email@example.com and
- Postfix delivers one copy of the message to ActionMailer for each
recipient, thus the Rails app gets two copies of the message at the
same time, in two completely separate running processes.
Any help with this would be greatly appreciated. I’ve tried numerous
things on the Rails side to no avail, and the Postfix docs are
confusing for me.