Excerpts from Martin Bähr's message of 2015-01-29 09:37:28 +0100: > hi, > > i'd like to be able to send an email to a number of people without sharing the > addresses in the To: or Cc: headers. i can do that with Bcc: but i'd like the > people to note that the mail is for them personally. and not something copied > to them as fyi. > > so what i would like to do is to have a mail sent to each recipient separately, > with their own address on the To: field. > > greetings, martin. > > -- > eKita - the online platform for your entire academic life > -- > chief engineer eKita.co > pike programmer pike.lysator.liu.se caudium.net societyserver.org > secretary beijinglug.org > mentor fossasia.org > foresight developer foresightlinux.org realss.com > unix sysadmin > Martin Bähr working in china http://societyserver.org/mbaehr/ > Hello Martin, That's an interesting use case. Just out of interest, is there an MUA/MTA out there that does it ? There is a "sendmail" hook that takes the message object to be sent [1] and does whatever logic to actually handle delivery of said message. You can write a hook that loops over the addresses in Bcc and sets the addresses as a recipient before shelling out to sendmail/msmtp/your MTA of choice. Very roughly, something like that (untested): ``` # The hook is responsible for _all_ sendings, so we also need to manage # the "standard" sendings bcc = message.bcc message.bcc = [] IO.popen("msmtp -t --read-recipient-from") {|p| p.puts message} # We need to save anything we modify, because we will put it back at the # end so that sup saves a relevant message internally to = message.to cc = message.cc # A specialized message, only for (each of) you message.to = [] message.cc = [] bcc.each do |recipient| message.to = [recipient] IO.popen("msmtp -t --read-recipient-from") {|p| p.puts message} end message.to = to message.cc = cc message.bcc = bcc ``` As I write this, I realize that messages can't be encrypted to the specified email address. To people more familiar with hooks: I don't presume methods in the Redwood module are available ? Is it possible to call CryptoManager.encrypt in a hook ? [1] https://github.com/sup-heliotrope/sup/wiki/SendEmail -- Matthieu Rakotojaona