8

I am using Mandrill mail server for sending emails to users and I have my own domain added to Mandrill to send out mails. Suppose I have configured Mandrill to use info@mydomain.com to send out emails and then it should send mails which it does. And any reply sent to info@mydomain.com will be forwarded to traditional mailboxes.

Now I have a doubt on receiving emails via Mandrill, once I add an inbound domain and route its path to my desired location, it should be ready to receive mails. Well I have read similar questions on Stack Overflow and it has been said that if someone wants to use traditional mailboxes for receiving mails then its better not to use Mandrill or use a custom sub domain.

Also it has been said that it is not possible for Mandrill to receive mail which is already configured or forwarded to some other traditional mailboxes.

So I added a sub domain to Mandrill’s inbound domain like inbound.mydomain.com and receive emails on this domain which will be received by Mandrill and will be send to the desired route which we set up. Now I will have to change my sender domain with the same that is inbound.mydomain.com to make users reply to this domain which will be received at Mandrill. What I want is :

  1. Send mails using info@mydomain.com

  2. Receive mails to my location using inbound domains

Giacomo1968
  • 3,542
  • 27
  • 38
RoR
  • 197
  • 1
  • 1
  • 3

2 Answers2

3

Yes, it's possible to receive emails using Mandrill. I've recently set up something similar, although more like a reverse case of what you want:

  1. First I set up Mandrill to send email from info@email.mydomain.com Setting up sending domain.
  2. Next I set up the same domain for inbound emails Inbound email processing.
  3. I created a webhook on our server to process events from Mandrill, it looks something like this:

    (defn forward-email
      [request]
      (doseq [event (get-inbound-events request)]
        (let [email {:to "info@mydomain.com"
                     :from-address "info@email.mydomain.com"
                     :from-display (get-in event [:msg :from_name])
                     :reply-to (get-in event [:msg :from_email])
                     :subject (get-in event [:msg :subject])
                     :body (get-in event [:msg :text])}]
          (send-email email))))
    

    I'm not sure how versed you are in Clojure, but the basic gist is that you extract the information from the request (use Webhook structure for reference) and forward it to another email address using the SMTP from step 1. It's important to note that you are not sending it on behalf of someone else, you are just setting their address as a "Reply To".

  4. In my case info@mydomain.com is a Google Apps address, so I just use Gmail as my inbox

  5. Finally, I added info@email.mydomain.com as my sending address in Gmail

So I send all emails from info@email.healthunlocked.com, but receive all emails on info@mydomain.com. The advantage is that I'm not limited by the Gmail sending quota, but can still use Gmail to manage the emails.

You can also use Desk with this set up really easily, and it will even automatically recognise "Reply To" in the header and send an auto-acknowledgement, even if it was forwarded from Mandrill. You will need to set it to poll from info@mydomain.com and send from info@email.mydomain.com as well.

Shagglez
  • 181
  • 1
  • 7
0

Actually just released an application which has a script that will relay mandrill inbound webhook to smtp. https://github.com/huoy/webbermail

huoy
  • 11
  • 1