LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-04-2013, 02:18 AM   #1
wheelnut
LQ Newbie
 
Registered: Mar 2013
Location: UK
Distribution: Fedora 18
Posts: 3

Rep: Reputation: Disabled
Postfix - local area LAN and internet problems


Hi everyone,

I am attempting, and failing to setup Postfix for local and internet mailing. My configuration may be weird to some and perhaps there are any number of better ways to do this, but I am also trying to learn why and how things they are put together and the more examples I have, the better I become. So, here it is:

internet
|
|
|
|
Machine1.example.com ------------ Machine2.example.com
(mail.example.com) |
| |
| |
Machine3.example.com ------------ Machine4.example.com


I am after trying to achieve the following:
1) Any email that starts on machine1 and goes to machine1 should do so without any form of relaying to the internet - that I can get to work.
2) Any email that starts on machine1 and goes to machines2, 3, or 4 should do so without any form of relaying to the internet - that I can also get to work, however,
3) Any email that starts on machine1 and goes to anywhere else other than any machine on example.com (i.e. outside) should relay to the internet via my ISP. That is the problem.
In the mail log, it is saying that the relay being used is the username@localhost... but I cannot do that because I need to authenticate my email to my ISP using smtp_sasl_password_maps first.

I have set the relayhost = [my.isp.com] and
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_maps
but it appears to be being ignored. I currently have no entries in the transport maps table. The main.cf file is as follows:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = machine1.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = $myhostname, localhost
inet_protocols = ipv4
mydestination = $myhostname, $mydomain, localhost, localhost.$mydomain
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8 10.1.1.0/24 10.1.2.0/24 10.1.3.0/24
relayhost = [my.isp.com]
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.9.6/samples
readme_directory = /usr/share/doc/postfix-2.9.6/README_FILES
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_maps
#transport_maps = hash:/etc/postfix/transport

the master.cf is unchanged from the default.

and the MX record in my DNS is as follows:

.example.com IN MX 10 mail.example.com

Is what I am trying to do even possible? I would think it would be, but I am struggling to understand what I have done wrong.

Many thanks in advance,

Martin

Last edited by wheelnut; 03-04-2013 at 02:20 AM. Reason: Formatting not quite right...
 
Old 03-04-2013, 07:09 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
OK so you have an issue here, you can either have Postfix deliver the mail itself OR relay. You can't do both, you can have it deliver to local mailboxes and then relay for everything else.

If you have multiple systems like this and you want internal delivery for some and relay for others it becomes very tricky, the easiest way is to have all the mailboxes be local and then use nfs or cifs to mount the mail files on the remote systems so they are accessible. Other ways to skin the cat but that seems easiest.
 
Old 03-05-2013, 01:37 AM   #3
wheelnut
LQ Newbie
 
Registered: Mar 2013
Location: UK
Distribution: Fedora 18
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for that Kustom42 - I had a feeling that would be the outcome, I was just hopeful that perhaps there was a way. Never mind. I will do some more research. Your NFS idea seems to be a direction to go in. When I was at college (what seems to be a million years ago), I am sure we were able to do this, but then postfix did not exist and I am guessing it was all done with some clever stuff and sendmail (we had Sun machines there).

Thank you for your advice,

Martin
 
  


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
bluetooth device connect/share to internet ? LAN vs Personal Area Network‏ fhleung Linux - Newbie 3 08-04-2016 10:17 PM
how to make postfix send email to another postfix in local network (LAN)? h4k33m Linux - Server 9 06-04-2015 05:33 PM
Setting up POP3 and SMTP server on Dovecot and Postfix over local area network ngkangjin Linux - Server 5 10-02-2010 06:41 AM
Can access local LAN Webserver, but not Internet spaceuser Debian 11 08-23-2005 01:54 AM
Does anyone know how to use postfix in The LAN NOT having internet connection. gajaykrishnan Programming 4 08-07-2005 05:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:42 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration