LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2014, 05:17 AM   #1
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Rep: Reputation: 1
Modify sender domain address in Postfix


Hi All,

I have configured Postfix relay server to send mail to external mail server so if someone is using my relay to send mail to external client then its domain should get change.

Like

server A is my relay server.
Station1 is client which will use server A relay to send mail.

now if i am sending mail from station1 then it is going to Server A and when server A send mail to external client then it domain address is not getting change.

If i am sending mail from relay server itself then it is working. Why is it not working from station1?

I do not want to do this for specific domain or any address so whatever domain is that should get convert to my defined domain.

Please suggest on this.

Regards
Sandeep Sharma
 
Old 10-30-2014, 11:46 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,113

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Quote:
Originally Posted by sandeep_hello View Post
Hi All,
I have configured Postfix relay server to send mail to external mail server so if someone is using my relay to send mail to external client then its domain should get change.

Like
server A is my relay server.
Station1 is client which will use server A relay to send mail.

now if i am sending mail from station1 then it is going to Server A and when server A send mail to external client then it domain address is not getting change. If i am sending mail from relay server itself then it is working. Why is it not working from station1? I do not want to do this for specific domain or any address so whatever domain is that should get convert to my defined domain.

Please suggest on this.
You've been using Linux for six years now, and have been working with postfix a good while too. We can suggest the postfix documentation as your first step:
http://www.postfix.org/BASIC_CONFIGURATION_README.html
http://www.postfix.org/STANDARD_CONF...ON_README.html
http://askubuntu.com/questions/27715...ing-meaningful
http://www.postfix.org/VIRTUAL_README.html

You don't say how 'station1' is sending mail now (using Postfix? Or attaching directly via IMAP/POP3 client?), or what station1's operating system is. But changing the domain name for all emails going through a server is fairly simple, and covered in the basic configuration documentation.
 
Old 10-30-2014, 01:28 PM   #3
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Original Poster
Rep: Reputation: 1
thanks for your reply.

I have already tired these links but no luck.

station1 is sending mail through postfix and using server1 as a relay host.

Regards
Sandeep Sharma
 
Old 10-30-2014, 02:25 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,113

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Quote:
Originally Posted by sandeep_hello View Post
thanks for your reply.
I have already tired these links but no luck.

station1 is sending mail through postfix and using server1 as a relay host.
Then you didn't read them, or do things correctly. Changing domain-names is trivial, and is contained in BOTH the first two links, with an example in the third (for the originating station), and additionally, the option of virtual hosting in the fourth.

Sorry, but you just didn't read/try what was in those links. The third link has a VERY CLEAR example on what to do.
 
Old 10-31-2014, 07:03 AM   #5
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Original Poster
Rep: Reputation: 1
ok fine.

i have checked multiple options like

masquerade_domains = $mydomain
rewrite_service_name = rewrite
swap_bangpath = yes
allow_percent_hack = yes
append_at_myorigin = yes
append_dot_mydomain = yes

but these parameters will only work if your sender domain address is incomplete. I want to force postfix to change the domain to my defined domain because i am not aware what domain will be used by sender. Whatever domain would be that should get convert to my domain.

Please suggest if there is any feature.

Regards
Sandeep Sharma
 
Old 10-31-2014, 10:12 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,113

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Quote:
Originally Posted by sandeep_hello View Post
ok fine.
i have checked multiple options like

masquerade_domains = $mydomain
rewrite_service_name = rewrite
swap_bangpath = yes
allow_percent_hack = yes
append_at_myorigin = yes
append_dot_mydomain = yes

but these parameters will only work if your sender domain address is incomplete. I want to force postfix to change the domain to my defined domain because i am not aware what domain will be used by sender. Whatever domain would be that should get convert to my domain.
Please suggest if there is any feature.
I did, twice now, and this makes the third. You're either not reading or understanding the documentation. AGAIN, if you read the third link I looked up for you and sent you, you'd have seen:
Code:
myhostname = example.com
Change that on station1. Restart postfix. Done.
 
Old 10-31-2014, 11:56 AM   #7
sandeep_hello
Member
 
Registered: Feb 2008
Posts: 62

Original Poster
Rep: Reputation: 1
What if i dont want to do any setting at station1 end. If station1 is sending mail with any other domain then it should get convert into my defined domain on server1 and that's i am trying to do.

Regards
Sandeep Sharma
 
Old 10-31-2014, 02:37 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,113

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Quote:
Originally Posted by sandeep_hello View Post
What if i dont want to do any setting at station1 end. If station1 is sending mail with any other domain then it should get convert into my defined domain on server1 and that's i am trying to do.
You said station1 was under your control, and you're relaying email for it, so making that small modification is the simplest way to do it. And AGAIN, the Postfix documentation has many other options for rewriting addresses/domains.
http://www.postfix.org/ADDRESS_REWRI...E.html#generic

Since you say you've already read the instructions, I'm surprised you haven't found the answer. One of the ways:
Code:
 Put into main.cf file:
recipient_canonical_maps = hash:/etc/postfix/domainmap
Code:
Put into the domainmap file:
@mydomain.com @mydomain.local
Then run "postmap /etc/postfix/domainmap", and reload postfix.

This changes user@domain.com to user@mydomain.local.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rewrite sender address in postfix williebens Linux - Server 27 11-07-2014 06:29 AM
[Postfix] 450 Sender address rejected: Domain not found pestka Linux - Server 4 05-17-2013 01:35 AM
[SOLVED] [Postfix] Sender address rejected: Domain not found WojtekO Linux - Networking 5 05-19-2011 11:40 AM
Sendmail: Domain of sender address does not exist 360 Linux - Networking 1 02-02-2003 09:40 PM
Sendmail Domain of sender address does not exist mantiev Linux - Networking 0 05-08-2001 08:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration