LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-23-2006, 05:42 AM   #16
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30

Hi Billmyday

I have gone through all of the transport map options and configuration, the problem is that all the users, remote and local have the same email address, that is user@example.com (local), and user1@example.com (remote).Now as the hostname is mail.example.com, the Postfix delivers it locally no matter what i specify in the main.cf file.

I am actually thinking of changing the hostname of the Server to mail.example.net, and then mapping these mail addresses to the local user.
(if this can be done,lots more reading ahead of me!!)

What it boils down to is, I want to tell postfix, these 10 email addresses are local, these 50 need to leave via the smtp...even though their domain name are the same eg, @example.com
 
Old 10-23-2006, 07:07 AM   #17
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'd have thought you could set entries like:

user1@example.com smtp:[mail.your.isp]
user2.... etc

example.com :

But as I said, you can always put the external users in your alias file (or alias_extenal or whatever) with entries like post 14
 
Old 10-27-2006, 05:12 AM   #18
shawnbishop
Member
 
Registered: Dec 2005
Location: South Africa
Distribution: CentOS,Ubuntu,Fedora
Posts: 249

Original Poster
Rep: Reputation: 30
Just to update you guys

Thanks for the help, but none of them worked, I also found out that M$ Exchange has the same problem.

Cheers
 
Old 10-27-2006, 09:27 PM   #19
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Did yyou try aliasing, because I got it to work for me the other day before I posted the suggestion?
 
Old 10-28-2006, 11:59 AM   #20
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
Quote:
Originally Posted by shawnbishop
Just to update you guys

Thanks for the help, but none of them worked, I also found out that M$ Exchange has the same problem.

Cheers
Berhanie presented you with the exact solution to your problem in posts #8 and #11. Let's focus on what he said and how you can implement that solution, and why it will work.

I'll just reiterate what you should do. The following commands set the relevant parameters:
Code:
postconf -e "mydomain = company.com"
postconf -e "mydestination = $myhostname localhost.$mydomain localhost $mydomain"
postconf -e "local_recipient_maps = proxy:unix:passwd.byname $alias_maps hash:/etc/postfix/remote_users"
postconf -e "fallback_transport = smtp:[isp.smtp.server]"
The following commands are to unset parameters that have been suggested in this thread, but that should not be set:
Code:
postconf -e "transport_maps = "
postconf -e "relay_domains = "
NOTE: replace isp.smtp.server above with the hostname of your ISP's SMTP server. I put it in brackets so it will not do a DNS lookup for the domain named smtp.server , and will just deliver it to the named server directly.

This is assuming a few things.
1. That your 10 users (user1-user10) who should be delivered locally are defined as local users in the /etc/passwd file.
2. That the file /etc/postfix/remote_users is a table with users that should be sent to the ISP's server on the left-hand-side (LHS), and an arbitrary value on the right-hand-side (RHS).
For instance:
/etc/postfix/remote_users:
Quote:
user11 x
user12 x
user13 x
Notice that the left-hand side only lists the user part, and not the @domain part.

Then hash the file with the following command, to make it usable by postfix:
Code:
postmap /etc/postfix/remote_users
Now that the file is indexed and ready to use, refresh postfix with
Code:
postfix reload
Now that we're all setup, here's how a typical SMTP transaction will play out.

1. Incoming SMTP connection is accepted by postfix.
2. mail addressed to user1 - user10 will be accepted by SMTP because the "local_recipient_maps" parameter says that local users are defined in the /etc/passwd file. Mail addressed to user11-user60 will be accepted because the "local_recipient_maps" parameter says that these users are listed in the LHS of the /etc/postfix/remote_users file.
3. SMTP accepts the message, and hands it over to the cleanup server, which removes extra headers, adds missing headers, performs address rewriting per "canonical_maps", "masquerade_domains", etc. Cleanup puts the email into the incoming queue and notifies the queue manager (qmgr).
4. qmgr asks trivial-rewrite to resolve the recipient's address into a delivery agent.
5. Trivial-rewrite will resolve the address to a domain class. In this case the local domain class, since they're addressed to a domain that you have listed in the "mydestination" parameter. If there's no overriding transports listed in "transport_maps" (which there isn't if you executed the commands I listed above), then the delivery agent returned will be "local_transport".
6. qmgr will submit a delivery request to local(8), who will try to deliver the mail to a local user's mailbox.
7. For user1-user10, local(8) will succeed since these users exist on the local system.
8. For user11-user60 local(8) will fail, and notify qmgr of the failure.
9. qmgr will see the "fallback_transport" setting, and submit a delivery request to smtp for delivery to isp.smtp.server.
10. If isp.smtp.server accepts the message, qmgr will remove it from the queue and we're done.
11. If not, it will put the mail into the deferred queue and try again sometime in the future.

I left out a lot of details, but I think you can see how the mail should flow thru Postfix, and how the relevant parameters are used for proper delivery.

Now, be as specific as possible in explaining why this setup doesn't work, and where it fails. Especially by posting the relevant parameters. In fact, if it doens't work, please post the output of the following command so we can see what you're doing wrong:
Code:
postconf mydomain mydestination fallback_transport local_recipient_maps transport_maps local_transport relay_domains
and
Code:
ls -l /etc/postfix/remote_users*

Last edited by WindowBreaker; 10-28-2006 at 12:10 PM.
 
Old 10-28-2006, 01:11 PM   #21
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Maybe this is an out of the box idea. Why not get a commercial account from your ISP with a fixed address?
 
  


Reply



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
Exim4 only local delivery ALInux Linux - Networking 0 05-02-2006 09:06 AM
qmail local delivery lag branden_burger Linux - Networking 0 01-20-2006 04:14 AM
exim4: fetchmail and local delivery thw Linux - Networking 3 07-16-2005 04:54 PM
Sendmail local delivery watchamaka Linux - Networking 6 12-13-2003 01:32 PM
sendmail local delivery problems jhildebrand Linux - Networking 0 04-24-2003 03:56 PM

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

All times are GMT -5. The time now is 02:34 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