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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-30-2014, 04:17 AM
|
#1
|
Member
Registered: Feb 2008
Posts: 62
Rep:
|
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
|
|
|
10-30-2014, 10:46 AM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,189
|
Quote:
Originally Posted by sandeep_hello
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.
|
|
|
10-30-2014, 12:28 PM
|
#3
|
Member
Registered: Feb 2008
Posts: 62
Original Poster
Rep:
|
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
|
|
|
10-30-2014, 01:25 PM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,189
|
Quote:
Originally Posted by sandeep_hello
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.
|
|
|
10-31-2014, 06:03 AM
|
#5
|
Member
Registered: Feb 2008
Posts: 62
Original Poster
Rep:
|
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
|
|
|
10-31-2014, 09:12 AM
|
#6
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,189
|
Quote:
Originally Posted by sandeep_hello
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.
|
|
|
10-31-2014, 10:56 AM
|
#7
|
Member
Registered: Feb 2008
Posts: 62
Original Poster
Rep:
|
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
|
|
|
10-31-2014, 01:37 PM
|
#8
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,189
|
Quote:
Originally Posted by sandeep_hello
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.
|
|
|
All times are GMT -5. The time now is 06:01 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|