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-27-2009, 08:21 PM   #1
iamgreenlee
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Rep: Reputation: 0
SOS Postfix, please help !!!


Hi guys,

I have been trying to set my Postfix mail server working like this below.

I want all emails sent out from my server exactly arriving at a specific address like test@domain.com.
How can I make this happen by setting Postfix mail server?

Please help me, thank you.

GREEN

Last edited by iamgreenlee; 10-27-2009 at 09:15 PM.
 
Old 10-27-2009, 08:28 PM   #2
wfh
Member
 
Registered: Sep 2009
Location: Northern California
Distribution: Ubuntu Debian CentOS RHEL Suse
Posts: 164

Rep: Reputation: 44
You need to create an alias for each of those addressees. Check the manpage for 'postalias'

man 1 postalias
 
Old 10-27-2009, 08:52 PM   #3
iamgreenlee
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wfh View Post
You need to create an alias for each of those addressees. Check the manpage for 'postalias'

man 1 postalias

Thanks for your post.

But what if I want to set all email addresses to arrive at the same address?

I don't want a@domain1.com or b@domain2.com or c@domain3.com or d@domain4.com to receive the email. I just want test@domain.com to receive the email.

It's more like changing the TO addresses to a specific one like test@domain.com.

Can I make this happen by using "postalias"?

Thank you.

Last edited by iamgreenlee; 10-27-2009 at 09:15 PM.
 
Old 10-27-2009, 10:48 PM   #4
wfh
Member
 
Registered: Sep 2009
Location: Northern California
Distribution: Ubuntu Debian CentOS RHEL Suse
Posts: 164

Rep: Reputation: 44
Quote:
Originally Posted by iamgreenlee View Post
But what if I want to set all email addresses to arrive at the same address?

I don't want a@domain1.com or b@domain2.com or c@domain3.com or d@domain4.com to receive the email.
Code:
zless /usr/share/doc/postfix-doc/examples/aliases.gz
Try looking at your postfix documentation related to aliases.

Simply stated, you can direct any incoming mail using aliases, so yes, your a@domain3.com will be redirected to user test@domain.com. You must set up something like this in the flat file "aliases" (this varies between installations...check your local.cf for the correct alias file):

------- snip ---------

a: test
b: test
c: test
d: test
...etc.

------- /snip ---------

As you will see in aliases.gz, you must run postmap to map the aliases into aliases.db before going live.

You must already be consolidating and receiving mail for each of the subdomains listed; domain2.com, domain3.com, etc. so that these users will receive mail at domain.com. But that's a separate issue.

I have a group of users for whom I want all their mail to come to a single "student@my.domain". I set it up exactly as shown.
 
Old 10-28-2009, 12:03 AM   #5
iamgreenlee
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wfh View Post
Code:
zless /usr/share/doc/postfix-doc/examples/aliases.gz
Try looking at your postfix documentation related to aliases.

Simply stated, you can direct any incoming mail using aliases, so yes, your a@domain3.com will be redirected to user test@domain.com. You must set up something like this in the flat file "aliases" (this varies between installations...check your local.cf for the correct alias file):

------- snip ---------

a: test
b: test
c: test
d: test
...etc.

------- /snip ---------

As you will see in aliases.gz, you must run postmap to map the aliases into aliases.db before going live.

You must already be consolidating and receiving mail for each of the subdomains listed; domain2.com, domain3.com, etc. so that these users will receive mail at domain.com. But that's a separate issue.

I have a group of users for whom I want all their mail to come to a single "student@my.domain". I set it up exactly as shown.




Thank you very much for your post.
Probably I did not explain my situation very clearly.

For example, from my server I send 2 emails to
hello1@hotmail.com
hello2@gmail.com
And here I want all my emails that I have sent arriving at a specific email address like "hello3@yahoo.com".

hello1@hotmail.com -> hello3@yahoo.com
hello2@gmail.com -> hello3@yahoo.com
... -> hello3@yahoo.com
... -> hello3@yahoo.com
... -> hello3@yahoo.com

I want all emails from my server arriving at "hello3@yahoo.com"
There is nothing to do with user accounts in my server or my domain. My server does not need to receive emails, it only sends emails to other servers.

I know this is a really awkward question, but please help, I really need it.

Thank you.

Last edited by iamgreenlee; 10-28-2009 at 12:11 AM.
 
Old 10-28-2009, 12:24 AM   #6
wfh
Member
 
Registered: Sep 2009
Location: Northern California
Distribution: Ubuntu Debian CentOS RHEL Suse
Posts: 164

Rep: Reputation: 44
Quote:
Originally Posted by iamgreenlee View Post
I want all emails from my server arriving at "hello3@yahoo.com"
Okay. So there's really nothing Postfix can do to help you. You can't really *ROUTE* email through different MTA's unless you control the transfer agents that you're hopping to.


Quote:
Originally Posted by iamgreenlee View Post
My server does not need to receive emails, it only sends emails to other servers.

I know this is a really awkward question, but please help, I really need it.
Do you control "hello3@yahoo.com"? Are you sending unsolicited email to other users?
 
Old 10-28-2009, 12:42 AM   #7
iamgreenlee
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wfh View Post
Okay. So there's really nothing Postfix can do to help you. You can't really *ROUTE* email through different MTA's unless you control the transfer agents that you're hopping to.




Do you control "hello3@yahoo.com"? Are you sending unsolicited email to other users?


The reason why I am trying to do this is that in my company we have a web system to test, but every developer has written their own email addresses to test while they were developing the system.

I want to receive all emails for test in a specific address while testing, even there is a different email address in every program.

Probably we are totally wrong with the way writing programs or even testing.

I thought there was something that I could do before the emails have been sent, something like rewriting "TO email address" in Postfix. I have been searching on line for a while, but I did not find any suitable solution to this issue.

I do control hello3@yahoo.com, all emails I want arriving at another server in my company, which means all email from server A replacing to hello3@yahoo.com to arrive at server B in my company.

Sending 2 emails from sever A to
hello1@hotmail.com
hello2@gmail.com
Sever B receives those 2 emails that I have sent as test@serverB.com
I must do something in Server A before emails have been sent.

Anyway really thanks for your precious time.

Last edited by iamgreenlee; 10-28-2009 at 01:03 AM.
 
Old 10-28-2009, 09:17 PM   #8
wfh
Member
 
Registered: Sep 2009
Location: Northern California
Distribution: Ubuntu Debian CentOS RHEL Suse
Posts: 164

Rep: Reputation: 44
Have you thought about adding cc: to each email? Send them to your hello1@hotmail.com user and cc: to test@serverB.com user as the second addressee?

Perhaps this isn't going to tell you what you need to know, but at least you would see all emails, gathered at a central email 'hub'.
 
Old 10-28-2009, 11:58 PM   #9
iamgreenlee
LQ Newbie
 
Registered: Oct 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wfh View Post
Have you thought about adding cc: to each email? Send them to your hello1@hotmail.com user and cc: to test@serverB.com user as the second addressee?

Perhaps this isn't going to tell you what you need to know, but at least you would see all emails, gathered at a central email 'hub'.


I finally got what I needed by adding "canonical".

This was how I figured.

1.Add the line below to "main.cf"
recipient_canonical_maps = regexp:/etc/postfix/canonical

2.Set "canonical" (/etc/postfix/canonical)
# Replaces all recipients to hello3@serverB.com
/^(.*)$/ hello3@serverB.com

3.Update map
postmap /etc/postfix/canonical


The settings above help me rewriting all emails' addresses to "hello3@serverB.com" before sending.

Thank you very much for your advice and support.

Last edited by iamgreenlee; 10-29-2009 at 03:40 AM.
 
Old 10-29-2009, 01:54 AM   #10
wfh
Member
 
Registered: Sep 2009
Location: Northern California
Distribution: Ubuntu Debian CentOS RHEL Suse
Posts: 164

Rep: Reputation: 44
Well played!
 
  


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
Sos jojo67 Linux - Newbie 4 12-22-2006 10:39 AM
Help!! Sos!! aru_04 Linux - Software 3 01-02-2006 06:26 AM
sos!help! phoenix-2004 Linux - Newbie 5 12-24-2004 10:49 AM
DNS need help ? pls help me ! SOS SOS AngelOfTheDamn Linux - Networking 2 02-23-2004 12:13 PM
sos i need help xnet_online Linux - Distributions 4 10-23-2002 01:32 AM

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

All times are GMT -5. The time now is 09:01 PM.

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
Open Source Consulting | Domain Registration