Action mailer receive email

35 views
Skip to first unread message

Aqib Hameed

unread,
Sep 28, 2017, 3:36:43 AM9/28/17
to Ruby on Rails: Talk
I am following this rails guide http://guides.rubyonrails.org/action_mailer_basics.html#receiving-emails. But i am not able to understand what should it means
"Configure your email server to forward emails from the address(es) you would like your app to receive to /path/to/app/bin/rails runner 'UserMailer.receive(STDIN.read)'."
Is there any screen-cast which explain these things ???

Norbert Melzer

unread,
Sep 28, 2017, 4:36:36 AM9/28/17
to Aqib Hameed, rubyonra...@googlegroups.com
Please do not reply to me privately but to the mailinglist!

Am 28.09.2017 um 10:30 schrieb Aqib Hameed:
> receive to |/path/to/app/bin/rails runner 'UserMailer.receive(STDIN.read)'|.
> where i should run this command and where define outgoing server
> configuration ???

This totally depends on which MTA/MUA you are using, you need to
configure it in the MTA/MUA you are using and how you do it totally
depends on the software uised. Perhaps someone else is able to help you
after you have provided necessary information.

> On Thu, Sep 28, 2017 at 12:52 PM, Norbert Melzer <timm...@gmail.com
> <mailto:timm...@gmail.com>> wrote:
>
> Am 28.09.2017 um 09:36 schrieb Aqib Hameed:
> > I am following this rails
> >
> guide http://guides.rubyonrails.org/action_mailer_basics.html#receiving-emails
> <http://guides.rubyonrails.org/action_mailer_basics.html#receiving-emails>.
> > But i am not able to understand what should it means
> > "Configure your email server to forward emails from the
> address(es) you
> > would like your app to receive to |/path/to/app/bin/rails runner
> > 'UserMailer.receive(STDIN.read)'|."
> > Is there any screen-cast which explain these things ???
>
> I'm not sure if there is a screencast explaining this, but basically it
> means, that you have to tell your *locally run* mail transfer agent, to
> pipe all mails that should be handled by your rails app to the
> mailhandler.
>
> If you were writing a bash script doing this and the mailcontent is in
> the variable `$MAILCONTENT` it were roughly like this:
>
> ```
> echo $MAILCONTENT | /path/to/app/bin/rails runner \
>   'UserMailer.receive(STDIN.read)'
> ```
>
> How to do this exactly does massively depend on the MTA you use.
>
> Of course you do not need to run a mailserver locally, any scriptable
> headless client should do as well. But I do asume that the guide is does
> asume that the application runs on the exact same server that handles
> emails for the domain as well.
>
>


signature.asc
Message has been deleted

Hassan Schroeder

unread,
Sep 29, 2017, 11:20:56 AM9/29/17
to rubyonrails-talk
On Fri, Sep 29, 2017 at 8:10 AM, Ben Edwards <lo...@funkytwig.com> wrote:
> Not read the guide but I simply set up the details of my outgoing SMTP
> server

which is completely irrelevant to the question of *receiving* mail...

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

Ben Edwards

unread,
Sep 29, 2017, 11:26:39 AM9/29/17
to Ruby on Rails: Talk
good point, deleted the post.
Reply all
Reply to author
Forward
0 new messages