Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for mail forwarding - recipients can now override to, cc, and bcc #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

oysteinjakobsen
Copy link

MOTIVATION

Sometimes, for example when expanding a mailing list address and forwarding a mail to each member, it is useful to be able to override what's given in :to, :cc, and :bcc by explicitly setting which recipients should get the forwarded mail. It is however important that the original mail headers remain intact so that the recipients see who received the original mail and is able to reply (to all).

HOW TO USE IT

You can now specify :recipients. If given, the mail will be sent to them instead to those given in :to, :cc, and :bcc:

postal.core> (send-message {:from "foo@bar.dom"
                            :to "mailinglist@bar.dom"
                            :cc "another@another.dom"
                            :recipients ["member1@foo.dom" "member2@another.dom"]
                            :subject "An announcement to all members!"
                            :body "Regards."}

CHANGES

The most effective way to implement this was to change make-jmessage to do the job. This function was renamed to make-jmessage-with-recipients and now returns a map:

{:jmsg the-jmessage-object :recipients array-of-internet-addresses }

The recipients are either those given in :recipients, if any, or those given in :to, :cc, and :bcc.

The function recipients was removed.

I also added functions smtp-send-single* and smtp-connect* in order to write tests.

@drewr
Copy link
Owner

drewr commented Dec 3, 2014

Thanks @oysteinjakobsen! I've wanted better envelope support but hadn't done it. Couple of thoughts. I'm not sure I like implementing it in make-jmessage. I think it should really return a jmessage. I wonder if it's worth promoting the internal notion of a message to its own Message type and have the envelope (sender and recipients) info be a first-class part of that?

@sr1234
Copy link

sr1234 commented Dec 4, 2014

Hi Drew,

I am running into an urgent matter - need support asap. Could I ask for someone from your support team to call me? It is so urgent that just need to get someone on the phone. Happy to discuss support options for our business with them, but I need to have our ES up by tomorrow. Rebooted it, and getting an error. Won't start anymore!! Can't stress how urgent this is. Many thanks. I couldn't find a number to call from your website.

[FYI, This project is unrelated to Elasticsearch. --Drew]

@drewr drewr force-pushed the master branch 4 times, most recently from b199c5a to 382cb0e Compare November 18, 2020 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants