Hi,

I'm running the combination of Postfix, Postfix-GLD (Greylisting) and 
DBMail(MDA) as a stand-alone
Internet host on a Ubuntu-9.04 system. The file 'sql-recipients.cf' provides 
the MySQL access
information for the list of mail-aliases in DBMail and 'sql-domains.cf' 
provides the list of
virtual domains extracted from the mail-aliases.


What Postfix shall do:

- listen on all public and private IPs for incoming SMTP-connections

- relay mail from the internet to DBmail via LMTP on loopback device if the 
recipient address
matches a mail-alias and the recipient restrictions are met (FQDN, GLD, SPF, 
etc.)

- relay mail from private networks to DBMail via LMTP on loopback device if the 
recipient address
matches a mail-alias an the sender domain matches a virtual domain. No other 
restrictions

- relay from private networks to the internet if the sender domain matches a 
virtual domain. No
other restrictions

- Do NOT relay anything from internet to internet (avoid open relay)

- use only public IP xxx.xxx.xxx.xxx for relaying mail to the internet

- Use TLS-encryption and -authentification whenever possible on internet 
connections (does it make
sense to force TLS or are there too many non-TLS mail servers out there?) but 
don't use it with
private networks



What Postfix currently doesn't do:

- it relays mail to the internet but only accepts mail for 'mydomain' 
('mydestination' commented out)
- it accepts mail for all virtual domains but does not relay to the internet
    (Message not sent. Server replied:

       Action not performed: mailbox not available
       550 5.1.1 <x...@xxxxx.org>: Recipient address rejected: User unknown in 
local recipient table)
  ('mydestination' NOT commented out)

- it uses TLS on any connection and does not allow unecrypted and 
unauthenticated access to
private networks

Thanx for any hint,

Renne




master.cf:

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

#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master").
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
#smtp      inet  n       -       -       -       -       smtpd
smtp      inet  n       -       n       -       -       smtpd
#submission inet n       -       -       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#smtps     inet  n       -       -       -       -       smtpd
#  -o smtpd_tls_wrappermode=yes
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix                                  2 pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} 
${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}
# DBMail
dbmail-lmtp unix  -       -       n       -       -       lmtp

# SPF checks
policy-spf  unix  -       n       n       -       -       spawn
     user=nobody argv=/usr/bin/policyd-spf

------------------------------------ snap 
-------------------------------------------------------


main.cf:


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

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)

biff = no

append_dot_mydomain = no

readme_directory = no

recipient_delimiter = +

mail_owner    = postfix
setgid_group  = postdrop

mydomain      = <mydomain>
myhostname    = $mydomain
myorigin      = $mydomain
mynetworks    = 10.214.224.0/24 10.214.234.0/24 127.0.0.0/8
mydestination = mysql:/etc/postfix/sql-domains.cf

relay_domains =
relayhost     =

inet_interfaces = all

message_size_limit = 67108864
mailbox_size_limit = 134217728

mailbox_transport    = dbmail-lmtp:127.0.0.1:24
local_transport      = dbmail-lmtp:127.0.0.1:24
local_recipient_maps = mysql:/etc/postfix/sql-recipients.cf

spf-policyd_time_limit = 3600s

smtpd_recipient_restrictions =
    permit_mynetworks,
    reject_non_fqdn_sender,
    reject_non_fqdn_recipient,
    reject_unknown_sender_domain,
    reject_unknown_recipient_domain,
    reject_unauth_destination,
    reject_unlisted_recipient,
    check_client_access cidr:/etc/postfix/dnswl/postfix-dnswl-header,
    check_client_access cidr:/etc/postfix/dnswl/postfix-dnswl-permit,
    check_policy_service unix:private/policy-spf,
    check_policy_service inet:127.0.0.1:2525,
    permit

## Disable NIS support (superfluos log warnings)
#alias_maps =

smtp_tls_security_level  = encrypt
smtpd_tls_security_level = encrypt
##smtp_tls_security_level = may
##smtpd_tls_security_level = may

smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file =  /etc/ssl/private/<my>.key
smtpd_tls_cert_file = /etc/ssl/certs/<my>.crt
smtpd_tls_CApath    = /etc/ssl/certs
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom


------------------------------------ snap 
-------------------------------------------------------


Reply via email to