Solved

Exim Rewrite for anonymous member list remailing

Posted on 2013-01-18
14
318 Views
Last Modified: 2014-01-30
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!
0
Comment
Question by:jdailey59
  • 5
  • 4
  • 2
  • +1
14 Comments
 

Author Comment

by:jdailey59
ID: 38793518
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}}}"
0
 
LVL 37

Expert Comment

by:ArneLovius
ID: 38802737
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...
0
 

Author Comment

by:jdailey59
ID: 38804240
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.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 37

Expert Comment

by:ArneLovius
ID: 38804585
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.
0
 

Author Comment

by:jdailey59
ID: 38804982
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}}}"
0
 
LVL 40

Expert Comment

by:noci
ID: 38805585
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.
0
 
LVL 37

Expert Comment

by:ArneLovius
ID: 38805782
@noci as linked to in the link that I posted...
0
 
LVL 40

Expert Comment

by:noci
ID: 38806595
Ok didn't read that link though.
0
 
LVL 37

Expert Comment

by:ArneLovius
ID: 38807091
not a problem :-)

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

Expert Comment

by:eran123
ID: 38993445
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.
0
 

Accepted Solution

by:
jdailey59 earned 0 total points
ID: 39809159
No solution was found to accomplish exactly what was needed, so the project was abandoned.
0
 

Author Closing Comment

by:jdailey59
ID: 39820332
No solution was found to accomplish exactly what was needed, so the project was abandoned.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question