Setup for raabitmq-email plugin(.net)

105 views
Skip to first unread message

arvind...@gmail.com

unread,
Jul 19, 2018, 3:32:30 AM7/19/18
to rabbitmq-users
Dear RabbitMqCommunity,


I need to configure rabbitmq-email plugin, to send emails to the users by publishing messages into queue. Right now I installed the gen_smtp and rabbitmq-email plugin. Apart from it I have added some code to config file as per this document link: https://github.com/gotthardp/rabbitmq-email

rabbitmq.conf file:
[
{rabbitmq_email, [
    
    {server_config, [
        [{port, 2525}, {protocol, tcp}, {domain, "gmail.com"}, {address,{0,0,0,0}}]
    ]},

    {email_queues,
        [{{<<"/host1">>, <<"testQueue">>}, <<"gmail.com">>}
    ]},
   
    {client_sender, "my...@gmail.com"},
    
    {client_config, [
        {relay, "smtp.gmail.com"}
    ]}
]}
]

but I'm not sure I'm doing wrong or correct. 

Can you please suggest on this. What should I need to follow step wise step with some examples?

Version that I'm using : rabbitmq: 3.7.4 , Erlang: 20.3


Thanks & Regards

Arvind

Michael Klishin

unread,
Jul 19, 2018, 10:35:41 AM7/19/18
to rabbitm...@googlegroups.com
You haven't really described what you tried, what you expect and what the outcome is. Please be more specific.

rabbitmq.conf is used for the new configuration format [1]. Your example uses the classic format, so the file must be named rabbitmq.config.
rabbitmq-email doesn't support the new format AFAIK.


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Arvind S

unread,
Jul 19, 2018, 11:04:11 AM7/19/18
to rabbitm...@googlegroups.com
Hi Michael, 

Yeah apologies for that, the file name is rabbitmq.config

Actually, I'm trying to send an test email to particular recipient using rabbitmq-email plugin. What I did is: I updated the rabbitmq.config with below changes:

[
{rabbitmq_email, [
   
   {server_config, [
       [{port, 2525}, {protocol, tcp}, {domain, "gmail.com"}, {address,{0,0,0,0}}]
   ]},

    {server_auth, false},
    {server_starttls, false},

    {email_domains,
        [{<<"gmail.com">>, {<<"/">>, <<"email-in">>}}
    ]},

   {email_queues,
       [{{<<"/Subscription">>, <<"SubscriptionErrorQueue">>}, <<"gmail.com">>}
   ]},
 
   {client_sender, "arvind...@gmail.com"},
   
   {client_config, [
       {relay, "smtp.gmail.com"}
   ]}
]} 
].

and What I want is: Whenever I published a message into "SubscriptionErrorQueue"  it sends the email to another recipient. I'm passing the recipient user address through routing key. like this

 using (var advancedBus = RabbitHutch.CreateBus(CONNECTION_STRING).Advanced)
            {
                var exchange = advancedBus.ExchangeDeclare("SubscriptionMessageExchange", ExchangeType.Direct);
                var queue = advancedBus.QueueDeclare("SubscriptionErrorQueue");
                advancedBus.Bind(exchange, queue, "SubscriptionErrorQueue");

                var result = ObjectToByteArray(message);
                advancedBus.Publish(exchange, "aruns.d...@gmail.com", false, new MessageProperties(), result);
            }

but I'm not able to receive any email.

Is it a right way to do it? Can you help me out for this?  


Thanks & Regards

Arvind



To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

Michael Klishin

unread,
Jul 19, 2018, 1:47:39 PM7/19/18
to rabbitm...@googlegroups.com
Start with making sure that the plugin is enabled (`rabbitmq-plugins list`) and the config file is loaded from the path you expect [1].

Without knowing the value of CONNECTION_STRING it is impossible to tell whether the virtual host is configured
correctly.

Without the plugin enabled, are any messages routed to the queue named SubscriptionErrorQueue? If not then you have to set up
routing correctly.

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

arvind...@gmail.com

unread,
Jul 20, 2018, 2:24:37 AM7/20/18
to rabbitmq-users
Hi Michael,

Thanks for you response.

Here are the list of plugins that I enabled: [gen_smtp,rabbitmq_amqp1_0,rabbitmq_delayed_message_exchange,rabbitmq_email,rabbitmq_management,rabbitmq_shovel,rabbitmq_shovel_management].

and connection string that I used to make connection with SubscriptionErrorQueue is: host=localhost;virtualHost=/Subscription;username=guest;password=guest;port=5672;prefetchCount=1

This connection string is working fine. 

I'm getting authentication error , I checked the log file. Please find that below in the attachment

What I'm thinking is, Don't we need to provide username and password for "arvind...@gmail.com". because I'm using that email address to send emails to other.

What do you think about it? Is it correct?
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
logdetails.txt

Michael Klishin

unread,
Jul 20, 2018, 3:44:19 PM7/20/18
to rabbitm...@googlegroups.com
There are two errors in the log:

 * A Shovel fails to connect due to an "nxdomain" (a domain used in the URI does not resolve)
 * GMail SMTP server suggests that authentication is mandatory (which makes perfect sense)

To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

arvind...@gmail.com

unread,
Jul 23, 2018, 3:57:58 AM7/23/18
to rabbitmq-users
Hi Michael,


Thanks for your response. I resolved those logged issue and its perfectly working fine. Right now I'm able to send emails to single recipient.

I've another query about rabbitmq-email plugin i.e: Is it possible to send emails to multiple recipient? If yes, How can I pass list of recipient email address's so that email receive by multiple users?   


Thanks  & Regards

Arvind

Michael Klishin

unread,
Jul 23, 2018, 6:37:42 PM7/23/18
to rabbitm...@googlegroups.com
Please start new threads for new questions. This is mailing list etiquette 101.

Answered in [1].


To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages