LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-04-2008, 10:06 AM   #1
apinta10
Member
 
Registered: Nov 2004
Location: Croatia, Hrvatska
Distribution: Slackware 10.1 + Debian Sarge 3.1 (testing)
Posts: 35

Rep: Reputation: 15
Postfix Local users and Users on another server...


Hello. I am wondering how can i make the following:

Example:

10 Users that access mail locally on a local domain: mydomain.com
-relayhost is set up for forwarding
-users use local SMTP
-dovecot IMAP with plaintext
-Local System Users / PAM
-mydomain=localhost,mydomain.com (so postfix listens to mydomain.com)


Now lets say I got 5 users outside whitch are using pop3 on a real domain mydomain.com.

Now since I am trying to send e-mail to my five outside users we get an error that A USER DOES NOT EXIST ON LOCAL ADDRESS TABLE!

Is there any way to cheat that... So postfix will know when users are local and when it must use a relayhost to forward mail on ISP smarthost.

luser_relay - heard for this trick, but I could end up spamming my smarthost if I catch viruses and so on... (MY LAST OPTION)

local_address_transport_maps - still can't make it work

virtual users and domain - not tryed yet!

Thank you!
 
Old 08-04-2008, 05:57 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Postfix considers users to be local when their domain is in mydestination..

Read:
http://www.postfix.org/BASIC_CONFIGURATION_README.html
http://www.postfix.org/SOHO_README.html
http://www.postfix.org/STANDARD_CONF...ON_README.html
http://www.postfix.org/DEBUG_README.html
 
Old 08-04-2008, 07:10 PM   #3
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
You could create a file (e.g. outside_users) containing those extra users:
Code:
user1  # some comment
user2  # some comment
...
Then, in main.cf:
Code:
mydestination = mydomain.com, ...
local_recipient_maps = proxy:unix:passwd.byname, $alias_maps, hash:/etc/postfix/outside_users
fallback_transport = smtp:[smtp.myisp.com]

Last edited by Berhanie; 08-04-2008 at 07:36 PM. Reason: corrected as per Mr. C.'s comment below
 
Old 08-04-2008, 07:31 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
For local recipient maps, only the local part of an email address is checked; the domain is not used.

Use virtual aliases for your offsite users.

Postfix will relay for all addresses not in one of the four address classes: local, relay, virtual alias, and virtual mailbox.
 
Old 08-04-2008, 07:36 PM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Good point. Corrected. Virtual alias isn't a good idea here, since we're keeping the domain name on the address.
 
Old 08-04-2008, 07:39 PM   #6
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Any address in the local address class will be delivered via the local (or pipe)) agent; no remote connection will be made. These users must have a local mailbox.
Misunderstood question - ignore this.

Last edited by Mr. C.; 08-04-2008 at 09:30 PM.
 
Old 08-04-2008, 07:50 PM   #7
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Au contraire, mon ami:
Code:
fallback_transport (default: empty)
       Optional  message  delivery  transport that the local(8) delivery agent
       should use for names that are not found in the aliases(5) or UNIX pass-
       word database.
We are defining a new transport for local recipient not in passwd or aliases.
 
Old 08-04-2008, 08:04 PM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Never mind, I think I've misunderstood that the OP seems to be using the exact same domain internally and externally (example.com and example.com), where the internal domain usurps the WAN-visible example.com. I was reading these as example domains that were different.

Last edited by Mr. C.; 08-04-2008 at 08:26 PM.
 
Old 08-04-2008, 08:21 PM   #9
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Not so, Mr. C.

We are defining local_recipient_maps, which means that only those users are considered valid local
local addresses. Of those, users in passwd and aliases use the 'local' transport. The rest (in the example above, those listed in extra_users) use the transport defined in
fallback_transport. Mail to users not listed in local_recipient_maps is rejected.
 
Old 08-04-2008, 09:04 PM   #10
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Quote:
I think I've misunderstood that the OP seems to be using the exact same domain internally and externally (example.com and example.com), where the internal domain usurps the WAN-visible example.com.
Ah, ok. Now I understand why you proposed virtual aliases.
 
  


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
Postfix Error with Virtual domains and local Users shawnbishop Linux - Software 0 09-13-2007 10:43 PM
Postfix: Do not allow local users to send mail Termina Linux - Server 1 03-22-2007 05:15 PM
Restrict Postfix Users from sending mail to outside the local network gugabaga Linux - Software 4 07-20-2006 05:23 AM
Struggling to setup a Debian/etch desktop: LDAP users and LOCAL users jferrando Linux - Networking 1 05-05-2006 03:44 PM
to restrict rules of postfix, for some users (or local net). stomach Linux - General 1 03-14-2006 08:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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