Link to home
Start Free TrialLog in
Avatar of jdailey59
jdailey59

asked on

Exim Rewrite for anonymous member list remailing

Hi,

I wonder if somebody could shed some light on whether it is possible to rewrite the From field of an outbound message to the BCC field on certain domains.

Example:
anyuser@anyexternaldomain.com sends a message to abc@internaldomain.com, for the BCC field he uses user1@internaldomain.com

Exim then rewrites the the From field of the message from anyuser@anyexternaldomain.com to the value of the BCC (user1@internaldomain.com) before the message is processed through /etc/valiases

I came across Exim Specification - 33 Address rewriting, but I don't see how I would fetch the value of the BCC field in the rewrite.

Any pointers are appreciated. Ideally, if you could show an example, you'd make my day!
Avatar of jdailey59
jdailey59

ASKER

I have 2 lists
1. alias: real email and 2. real email: alias
I tried this Exim configuration to accomplish what I'm trying to do but it doesn't work - if anyone knows how to make this work it would be a good solution as well:

Remail Configuration.


Part 1)    - Registered Users
    # /etc/freeport.aliases
    # (standard alias file)
    local_username:    your.real@???


part 2) - Reply Address
    # /etc/freeport.users
    # (basically, the reverse of the above file)
    your.real@???:        Local.username


part 3) - The Exim Director
   remailer:
    domains = freeport.itmagic.ltd.uk  (or whatever)
    driver = aliasfile
    search_type = lsearch
    file = /etc/freeport.aliases
    headers_remove = From:Reply_To
    headers_add = "From: ${lookup{$sender_address}\
        lsearch{/etc/freeport.users}\
        {${value}@???}\
        {${sender_address}}}"
Avatar of ArneLovius
I'm going to ask the dumb question here, what is the bigger picture that you are trying to achieve ?

As an example, I asked a question recently (not on here) detailing the overall end result I wanted, the way I was trying to do it and a problem that I had encountered, the first reply suggested a huge simplification which removed the problem that I had encountered, it was also a particularly obvious method which I simply hadn't seen until it was pointed out, sometimes you can't see the wood for the trees...
We have a subscription network with members who need to send messages to each other anonymously. There is an internal messaging system in place but it's problematic for certain member configurations. We decided to let them communicate with each other using their own email and email clients, however each member's true email must remain undisclosed. We have a forwarding list in place which works fine, it's simple - member_number@domain.com: true_email@anotherdomain.com, so if you send and email to member_number@domain.com it will be redirected to true_email@anotherdomain.com, but your true email will be visible as the sender to the member you send it to, which is normal because your email client provides this information. In theory Exim is capable of rewriting the email headers and replacing the FROM before delivering the message - this is what we're trying to accomplish, so when member A sends an email to member B, member B will see as sender member_number_A@domain.com and when member B replies (using his own email client), member A will receive a message from member_number_B@domain.com. I know I can easily modify the email header info with PHP but I want to avoid using a web form and do this simply through a mailto link and have Exim change the FROM before sending.
You are using aliases for delivery. You can do a similar thing for sender address substitution, usually it would be used to change $username to $fullname, but you could have "anything" there.

This would however means that people couldn't send from "any" email client, they would have to send using a mail client that used the "internaldomain" as the from, this could be enforced by only accepting emails that were "From:" the internal domain.

What you are trying to achieve is close to a "nym server" but without the encryption, I've had a quick search but not found much apart from http://blog.phrog.org/2007/05/12/nymserv-install-notes/ and the github page linked from it.
I couldn't control which email client the members use.

I've never heard of a nym server but will look into this.

Exim is supposed to be able to do this, are there any Exim experts out there who could clarify why this example doesn't work? It doesn't throw any errors and there's nothing in the logs.

Part 1) - Registered Users
# /etc/freeport.aliases
# (standard alias file)
local_username: your.real@???


part 2) - Reply Address
# /etc/freeport.users
# (basically, the reverse of the above file)
your.real@???: Local.username


part 3) - The Exim Director
remailer:
domains = freeport.itmagic.ltd.uk (or whatever)
driver = aliasfile
search_type = lsearch
file = /etc/freeport.aliases
headers_remove = From:Reply_To
headers_add = "From: ${lookup{$sender_address}\
lsearch{/etc/freeport.users}\
{${value}@???}\
{${sender_address}}}"
Maybe this helps, it uses exim as mailer, but a special server to process the mails.

https://github.com/pymander/nymserv

There are more places where the users identity can be revealed like the unique mail hash for getting conversation together.
@noci as linked to in the link that I posted...
Ok didn't read that link though.
not a problem :-)

If two of use could only find the same pages, then there quite possibly is very little source out there...
Hi jdailey59,

I'd like to have the same service at my site.
If you came up with anything useful since, I would appreciate if you can share.

Kind Regards,
Eran.
ASKER CERTIFIED SOLUTION
Avatar of jdailey59
jdailey59

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No solution was found to accomplish exactly what was needed, so the project was abandoned.