PDA

View Full Version : Postfix configuration for small home network



antechinus55
10th March 2008, 12:37 PM
I am pulling my (remaining) hair out over postfix!

I have a G4 400/1gb ram running a standard install of 10.4.11 (not 10.4.server) specifically set up as a mail server for a small network.

I DO NOT have either an official fqdn or a static ip address, rather I am using the non de plume 'home.net' behind a firewall/router/nat server (192.168.0.1). On a separate machine I have a working dhcp server serving address range 192.168.0.10-20. The mail server (mule.home.net) has a fixed ip address of 192.168.0.4, the dhcp server (macserver.home.net) is fixed as 192.168.0.2
I have installed macports and downloaded postfix and fetchmail. Macports installs into a folder /opt, so all the other files are below this, ie postfix is in /opt/local/bin/ config files in /opt/local/etc/postfix, otherwise its a pretty standard install of postfix.
Fetchmails works, except that it fails to deliver because it cant find a mail server to deliver too.
But I cannot seem to get Postfix right. I have read all the example pages at postfix.org.
here is my main.cf file

command_directory = /opt/local/sbin
daemon_directory = /opt/local/libexec/postfix
etc_directory = /opt/local/etc/postfix
share_directory = /opt/local/share/postfix
man_directory = /opt/local/man

myhostname = mail.home.net
mydomain = home.net
myorigin = $mydomain

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks_style = subnet
relay_domains =
relayhost = [mail.bigpond.com]
mynetworks = 192.168.0.0/24, 127.0.0.0/8

smtp_generic_maps = hash:/opt/local/etc/postfix/generic

notify_classes = resource, software

debug_peer_level = 2

debugger_command =
PATH=/opt/local/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /opt/local/sbin/sendmail
newaliases_path = /opt/local/bin/newaliases
mailq_path = /opt/local/bin/mailq

and my master.cf file is unchanged, but here anyway

================================================== ========================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ================================================== ========================
smtp inet n - n - - smtpd
#submission inet n - n - - smtpd
# -o smtpd_enforce_tls=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#smtps inet n - n - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
#628 inet n - n - - qmqpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - n - - smtp
-o fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
#
# ================================================== ==================

Thanks in advance for any help/suggestions
My refs were postfix'x standard and basic config pages.
Richard

purana
10th March 2008, 12:45 PM
I would of recommended using Postfix Enabler, rather then goto the effort you have done.

antechinus55
10th March 2008, 12:50 PM
I would of recommended using Postfix Enabler, rather then goto the effort you have done.
I would but it only works with an install in the usual places, as I noted my install is a macports install, hence in a different directory, hence enabler wont work with it.

purana
10th March 2008, 12:56 PM
I would but it only works with an install in the usual places, as I noted my install is a macports install, hence in a different directory, hence enabler wont work with it.

I'd drop the relay line, whats the point of relaying messages which will originate from a domain that you don't own and the person getting it cannot reply too.

I'd also suggest changing the domain to something like, home.local (rather then adding .net/.com/.org) etc.

Further more, I'd seriously suggest you setup DNS resolution, as it's required. The mail server will attempt an MX record lookup and this is where it might be failing.

antechinus55
10th March 2008, 01:04 PM
I'd drop the relay line, whats the point of relaying messages which will originate from a domain that you don't own and the person getting it cannot reply too.

I'd also suggest changing the domain to something like, home.local (rather then adding .net/.com/.org) etc.

Further more, I'd seriously suggest you setup DNS resolution, as it's required. The mail server will attempt an MX record lookup and this is where it might be failing.
thanks very much
macserver has a working dns server with an mx record, but I will certainly try the first 2 suggestions. I can also move the dns server to mule, I had already thought of doint that (its currently the secondary server, I can just swap them around).

purana
10th March 2008, 01:07 PM
Then I guess you need to start showing us some REAL world examples of the error in your logs relating to delivery issues.

antechinus55
10th March 2008, 01:26 PM
Then I guess you need to start showing us some REAL world examples of the error in your logs relating to delivery issues.
what log files am I looking for? Postfix/fetchmail or the mail client?
PS I just ran 'telnet localhost 25' and connected to postfix with the correct mail server name (mule.home.net) so Postfix seems to be working.

purana
10th March 2008, 01:38 PM
what log files am I looking for? Postfix/fetchmail or the mail client?
PS I just ran 'telnet localhost 25' and connected to postfix with the correct mail server name (mule.home.net) so Postfix seems to be working.

Umm nevermind. I don't have the time to direct you in detail to resolve the issue. If you contribute more to the issue, then I am happy to help. But I can't spoon feed you. I am sure you understand.

MacDave
10th March 2008, 01:46 PM
I would of recommended using Postfix Enabler, rather then goto the effort you have done.

I fully agree on this point. I'd just uninstall the MacPorts version and go with Postfix Enabler. I've been using it over two years on my production Xserve with no issues whatsoever. One of the beautiful things about it is that there is no conflict in editing files like main.cf in the CLI and using Postfix Enabler.

Dave