2 beautifull postfix problems

1. Someone with email user1@domain.com sends email to client@other.com. I want to know if there is a way in postfix to change user1@domain.com email address in user2@domain.com at sending time?

2. I have a virtual email address media@domain.com that expands to a lot of clients' email addresses, and when a user user1@domain.com sends email to this address it goes to all his clients. Now if he sets To: to media@domain.com the clients can see that and if one of the clients sends email to media@domain.com then all the clients will receive that email, and that must not happen. So the question is: how can i forbidd in postfix that only user1@domain.com can send email to media@domain.com and no other. Right now I have a workaround and he sends email with To: to a bogus email address and Bcc: to media@domain.com, but I would like to know if there is also another way to do it.

Thanks in advance for any answers or directions.

4 Replies

@jlinos:

1. Someone with email user1@domain.com sends email to client@other.com. I want to know if there is a way in postfix to change user1@domain.com email address in user2@domain.com at sending time?

Yes, there is a way. What you need to do is create a sender canonical map which maps raw addresses onto rewritten addresses. I use one for local accounts on my mail server which contains the following:

@dorothy.movealong.org  @movealong.org

MUAs on my server will produce email with the FQDN of the server as the sender domain, which I rewrite to just the domain. The canonical map can map whole domains, like I do, or specific addresses. In your case, the map you need will look like this:

user1@domain.com user2@domain.com

Once you have created the map, you can refer to it in your main.cf with this:

sender_canonical_maps = hash:/etc/postfix/

@jlinos:

2. I have a virtual email address media@domain.com that expands to a lot of clients' email addresses, and when a user user1@domain.com sends email to this address it goes to all his clients. Now if he sets To: to media@domain.com the clients can see that and if one of the clients sends email to media@domain.com then all the clients will receive that email, and that must not happen. So the question is: how can i forbidd in postfix that only user1@domain.com can send email to media@domain.com and no other. Right now I have a workaround and he sends email with To: to a bogus email address and Bcc: to media@domain.com, but I would like to know if there is also another way to do it.

Postfix also has recipient canonical maps, which will do the same thing as sender canonical maps except on the recipient address instead of the sender. I don't know if this will solve your problem, though, because I think after the address is rewritten the message is delivered to the new address and not the old. You may want to play around with this, though and see what you can get.

If there's no way to do this in Postfix, you could try setting up media@domain.com as a proper mailing list, for example using Mailman. I know that Mailman allows very fine-grained control over who is allowed to post messages to the list and who is not. I expect pretty much any mailing list manager would support that feature.

Good luck!

@inkblot:

Yes, there is a way. What you need to do is create a sender canonical map which maps raw addresses onto rewritten addresses. I use one for local accounts on my mail server which contains the following:

@dorothy.movealong.org  @movealong.org

You don't need canonical maps for that. Just put

masquerade_domains = $mydomain
masquerade_exceptions = webmaster, root

in your main.cf

@jlinos:

2. I have a virtual email address media@domain.com that expands to a lot of clients' email addresses, and when a user user1@domain.com sends email to this address it goes to all his clients. Now if he sets To: to media@domain.com the clients can see that and if one of the clients sends email to media@domain.com then all the clients will receive that email, and that must not happen. So the question is: how can i forbidd in postfix that only user1@domain.com can send email to media@domain.com and no other. Right now I have a workaround and he sends email with To: to a bogus email address and Bcc: to media@domain.com, but I would like to know if there is also another way to do it.

Set reply-to in your mailer to your email address?

It won't deny access to media@domain.com but it will stop people mailing it by accident.

@sednet:

Set reply-to in your mailer to your email address?

It won't deny access to media@domain.com but it will stop people mailing it by accident.

You've never exchanged email with people who use Lotus Notes, have you? Notes doesn't handle Reply-To correctly. I don't know if that's true of all versions of Notes or just some, but there is a guy on my flying club mailing list who keeps sending his reply to the administrative address because of Notes.

Actually, for the original poster, I'd suggest he continue with BCCing, or set up a proper mailing list.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct