Discussion:
losing address of recipient of bcc
(too old to reply)
Warren H. Prince
2016-07-19 15:54:29 UTC
Permalink
Our business has many clients, each of which is assigned a number. Using that number, we assign an email address to receive and store email communications for that client. So, for example ***@mydomain.com is received by a wildcard alias and deposited into one email account for all aliases. I have a ruby routine that then grabs each new email, filters for unknown senders or spam, parses the headers to find the number of the original recipient, and processes the email from there.

This all works wonderfully, except when the client’s folder is the recipient of a BCC. Because of the alias, there is no trace of the original BCC address. The email gets ignored because there is no address to parse.

I understand the reason that the BCC is striped from the headers when viewed by the original recipient. It wouldn’t be “blind” if the BCC was in the header, obviously. My situation is preserving the BCC header info for the BCC recipient, in the header of the copy of the email received by the BCC recipient, either as a new header or any other method.

I’ve been asked why I want to do this. Perhaps an example would help. John hates George. A situation arises that involves both of them and I want to send email to John with a BCC to George because I don’t want to fight with John about sending a copy to George. Maybe it’s an employee/employer situation and I’m chastising an employee and want to save a copy in their personnel folder, but don’t want to add to the discord by letting them know I’m saving a copy to their personnel folder.

Anyone have any suggestions?
/dev/rob0
2016-07-19 16:34:07 UTC
Permalink
Post by Warren H. Prince
Our business has many clients, each of which is assigned a number.
Using that number, we assign an email address to receive and store
email communications for that client. So, for example
into one email account for all aliases. I have a ruby routine that
Ouch, a wildcard was a bad idea. Better would have been to make a
system user, "client" for example, and to invoke a script from the
~client/.forward file. Set recipient_delimiter (a common choice
would be "recipient_delimiter=+") and send your mail to
client+***@example.com (where "example.com" is a domain listed in
$mydestination.)

See postconf.5.html#recipient_delimiter and also the aliases(5) and
local(8) manuals about .forward files and how to pipe mail to a
script. Your script will see the "12345" part in its environment,
specifically as "$EXTENSION".
Post by Warren H. Prince
then grabs each new email, filters for unknown senders or spam,
parses the headers to find the number of the original recipient,
and processes the email from there.
Ouch again. Mail routing is not controlled by headers. That's your
problem: you assumed otherwise.
Post by Warren H. Prince
Anyone have any suggestions?
It will take some work to do this all again, the right way, but you
should be able to copy over all the existing mail folders to the new
"client" user. Don't forget to chown all the mail!
--
http://rob0.nodns4.us/
Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
Continue reading on narkive:
Loading...