OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
postconf not displaying all options

From: Alain Spineux (aspineuxgmail.com)
Date: Mon Jul 23 2007 - 15:18:16 CDT


My main.cf contains some "virtual" definitions

# grep virtual /kolab/etc/postfix/main.cf
virtual_maps = hash:/kolab/etc/postfix/virtual,
ldap:/kolab/etc/postfix/ldapdistlist.cf,
ldap:/kolab/etc/postfix/ldapvirtual.cf
#virtual_mailbox_maps = $virtual_maps
local_recipient_maps = $virtual_maps, $alias_maps

I restart postfix

[rootfc6-eg trunk]# /kolab/sbin/postfix -c /kolab/etc/postfix stop
postfix/postfix-script: stopping the Postfix mail system
[rootfc6-eg trunk]# /kolab/sbin/postfix -c /kolab/etc/postfix start
postfix/postfix-script: warning: not owned by root:
/kolab/etc/postfix/ldapdistlist.cf
postfix/postfix-script: warning: not owned by root:
/kolab/etc/postfix/ldaptransport.cf
postfix/postfix-script: warning: not owned by root:
/kolab/etc/postfix/ldapvirtual.cf
postfix/postfix-script: warning: not owned by root: /kolab/etc/postfix/main.cf
postfix/postfix-script: warning: not owned by root: /kolab/etc/postfix/master.cf
postfix/postfix-script: starting the Postfix mail system

I check postconf output

# /kolab/sbin/postconf -c /kolab/etc/postfix -n | grep virtual
local_recipient_maps = $virtual_maps, $alias_maps

I check the "full" output, this time using the .cf file

# /kolab/sbin/postconf -c /kolab/etc/postfix | grep ldapvirtual.cf
NOTHING

I recheck the main.cf, the same way

# grep ldapvirtual.cf /kolab/etc/postfix/main.cf
virtual_maps = hash:/kolab/etc/postfix/virtual,
ldap:/kolab/etc/postfix/ldapdistlist.cf,
ldap:/kolab/etc/postfix/ldapvirtual.cf

Whereas the virtual mapping is working :

# postmap -q alain.spineuxalpha.loc ldap:/kolab/etc/postfix/ldapvirtual.cf
asxalpha.loc
# echo hello | mail -s Hello alain.spineuxalpha.loc
# tail -n 10 /kolab/var/postfix/log/postfix.log
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/smtpd[25376]: connect
from localhost.localdomain[127.0.0.1]
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/smtpd[25376]:
7841E7FBD: client=localhost.localdomain[127.0.0.1]
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/cleanup[25383]:
7841E7FBD: message-id=<200707231939.l6NJdnX3025370fc6-eg.asxnet.loc>
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/qmgr[25312]:
7841E7FBD: from=<postmasterasxnet.loc>, size=965, nrcpt=1 (queue
active)
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/smtpd[25376]:
disconnect from localhost.localdomain[127.0.0.1]
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/lmtp[25384]:
7841E7FBD: to=<asxalpha.loc>,
relay=/kolab/var/kolab/lmtp[/kolab/var/kolab/lmtp], delay=0,
status=sent (250 2.1.5 Ok)
Jul 23 21:39:49 fc6-eg.asxnet.loc <info> postfix/qmgr[25312]: 7841E7FBD: removed

Here are more info

main.cf, master.cf, postconf -n

======================postconf -n ==============================

# /kolab/sbin/postconf -c /kolab/etc/postfix -n
alias_database = hash:/kolab/etc/postfix/aliases
alias_maps = hash:/kolab/etc/postfix/aliases
alternate_config_directories = /kolab/etc/postfix_front
broken_sasl_auth_clients = yes
canonical_maps = hash:/kolab/etc/postfix/canonical
command_directory = /kolab/sbin
config_directory = /kolab/etc/postfix
content_filter =
daemon_directory = /kolab/libexec/postfix
default_privs = kolab-n
empty_address_recipient = alain.spineux
enable_original_recipient = no
local_recipient_maps = $virtual_maps, $alias_maps
local_transport = lmtp:unix:/kolab/var/kolab/lmtp
mail_owner = kolab
masquerade_classes = envelope_sender, envelope_recipient,
       header_sender, header_recipient
masquerade_domains = $mydomain
message_size_limit = 20971520
mydestination = asxnet.loc mydomain.loc alpha.loc gamma.loc beta.loc
mydomain = asxnet.loc
myhostname = fc6-eg.asxnet.loc
mynetworks =
myorigin = $mydomain
queue_directory = /kolab/var/postfix
recipient_delimiter = +
relay_domains =
relocated_maps = hash:/kolab/etc/postfix/relocated
setgid_group = kolab-r
smtpd_recipient_restrictions =
permit_mynetworks,permit_sasl_authenticated,
reject_unauth_destination, reject_unlisted_recipient,
check_policy_service unix:private/kolabpolicy
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_mynetworks, check_policy_service
unix:private/kolabpolicy
smtpd_starttls_timeout = 300s
smtpd_timeout = 300s
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /kolab/etc/kolab/cert.pem
smtpd_tls_key_file = /kolab/etc/kolab/key.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = no
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = hash:/kolab/etc/postfix/transport,
ldap:/kolab/etc/postfix/ldaptransport.cf

===================== main.cf ================================

# cat /kolab/etc/postfix/main.cf
# (c) 2004 Steffen Hansen <steffenklaralvdalens-datakonsult.se>
(Klaralvdalens Datakonsult AB)
# (c) 2003 Tassilo Erlewein <tassilo.erleweinerfrakon.de>
# (c) 2003 Martin Konold <martin.konolderfrakon.de >
# (c) 2003 Achim Frank <achim.frankerfrakon.de>
# This program is Free Software under the GNU General Public License (>=v2).
# Read the file COPYING that comes with this packages for details.

# this file is automatically written by the Kolab config backend
# manual additions are lost unless made to the template in the Kolab
config directory

# postfix default is 10 240 000 Byte = 10.24 Megabyte,
# we use 20 Mebibyte = 20*2^20 Byte
message_size_limit = 20971520

# paths
command_directory = /kolab/sbin
daemon_directory = /kolab/libexec/postfix
queue_directory = /kolab/var/postfix

# users
mail_owner= kolab
setgid_group= kolab-r
default_privs= kolab-n

# local host
myhostname = fc6-eg.asxnet.loc
mydomain = asxnet.loc
myorigin = $mydomain

#
masquerade_domains = $mydomain
# Kolab Server does _not_ want to forward to local machines by default,
# so we can add "envelope_recipient" to masquerade_classes:
masquerade_classes = envelope_sender, envelope_recipient,
                     header_sender, header_recipient

# smtp daemon
#smtpd_banner = $myhostname ESMTP $mail_name
#inet_interfaces = 127.0.0.1

# ASX mynetwoks MUST BE EMPTY BY DESIGN TO REJECT ANY EXTERNAL DOMAIN !!!
# because postfix_front is 127.0.0.1
# relaying
#mynetworks = 127.0.0.0/8
mynetworks =
mydestination = asxnet.loc mydomain.loc alpha.loc gamma.loc beta.loc
relay_domains =
#smtpd_recipient_restrictions = permit_mynetworks,
# check_client_access
hash:/kolab/etc/postfix/access,
# check_relay_domains

recipient_delimiter = +

# maps
canonical_maps = hash:/kolab/etc/postfix/canonical
virtual_maps = hash:/kolab/etc/postfix/virtual,
ldap:/kolab/etc/postfix/ldapdistlist.cf,
ldap:/kolab/etc/postfix/ldapvirtual.cf
relocated_maps = hash:/kolab/etc/postfix/relocated
transport_maps = hash:/kolab/etc/postfix/transport,
ldap:/kolab/etc/postfix/ldaptransport.cf
alias_maps = hash:/kolab/etc/postfix/aliases
alias_database = hash:/kolab/etc/postfix/aliases
#virtual_mailbox_maps = $virtual_maps
local_recipient_maps = $virtual_maps, $alias_maps

## only use local_transport or a higher recipent_limit if issue825 is fixed
# local delivery, not using postfix local(8)
#local_transport = kolabmailboxfilter
# alternatively with local(8), something like

# ASX orig is mailbox_transport = kolabmailboxfilter
# - kolabmailboxfilter inpect emails for icalendar information and
# update scheduling accordingly
# - mailbox_transport take care of "local" rules like .forward and
# delivers to recipients one by one and then duplicates email in the
# imap storage
# - local_transport deliver to all recipients at once
# * my solution is local_transport = lmtp:unix:/kolab/var/kolab/lmtp
#
# mailbox_transport = lmtp:unix:/kolab/var/kolab/lmtp
# use local_transport to avoid duplication of delivery
# issue825 require the use of mailbox_transport because of bug in
kolabmailboxfilter
local_transport = lmtp:unix:/kolab/var/kolab/lmtp

# local_destination_recipient_limit = 20

#TLS settings
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_starttls_timeout = 300s
smtpd_timeout = 300s
#smtpd_tls_CAfile = /kolab/etc/kolab/server.pem
#smtpd_tls_CApath =
#smtpd_tls_ask_ccert = no
#smtpd_tls_ccert_verifydepth = 5
smtpd_tls_cert_file = /kolab/etc/kolab/cert.pem
#smtpd_tls_cipherlist =
#smtpd_tls_dcert_file =
#smtpd_tls_dh1024_param_file =
#smtpd_tls_dh512_param_file =
#smtpd_tls_dkey_file = $smtpd_tls_dcert_file
#smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_key_file = /kolab/etc/kolab/key.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = no
#smtpd_tls_req_ccert = no
#smtpd_tls_session_cache_database =
smtpd_tls_session_cache_timeout = 3600s
#smtpd_tls_wrappermode = no

#tls_random_bytes = 32
tls_random_source = dev:/dev/urandom
#tls_daemon_random_bytes = 32
#tls_daemon_random_source =
#tls_random_exchange_name = ${config_directory}/prng_exch
#tls_random_prng_update_period = 60s
#tls_random_reseed_period = 3600s

#smtp_starttls_timeout = 300s
#smtp_tls_CAfile =
#smtp_tls_CApath =
#smtp_tls_cert_file =
#smtp_tls_cipherlist =
#smtp_tls_dcert_file =
#smtp_tls_dkey_file = $smtp_tls_dcert_file
#smtp_tls_enforce_peername = yes
#smtp_tls_key_file = $smtp_tls_cert_file
#smtp_tls_loglevel = 0
#smtp_tls_note_starttls_offer = no
#smtp_tls_per_site =
#smtp_tls_scert_verifydepth = 5
#smtp_tls_session_cache_database =
#smtp_tls_session_cache_timeout = 3600s

# authentication via sasl

## Kolab Policy Server
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,
        reject_unauth_destination, reject_unlisted_recipient,
check_policy_service unix:private/kolabpolicy
smtpd_sender_restrictions = permit_mynetworks, check_policy_service
unix:private/kolabpolicy
kolabpolicy_time_limit = 3600
kolabpolicy_max_idle = 20

#smtpd_restriction_classes =
smtpd_sasl_auth_enable = yes

# We want to allow for uids without any realm
#smtpd_sasl_local_domain = $myhostname
smtpd_sasl_local_domain =

smtpd_sasl_security_options = noanonymous

# Support broken clients like Microsoft Outlook Express 4.x which
expect AUTH=LOGIN instead of AUTH LOGIN
broken_sasl_auth_clients = yes

# ASX orig content_filter=kolabfilter
# kolabfilter make some checking about the sender
# Then kolabfilter send back to amavis (if enabled)
# but now, need to send directly to amavis if enabled
# because I want to bypass kolabfilter

content_filter=

# ASX enable_original_recipient = no
# when sending to the same aliasES of a mailbox (i.e. the catchall)
# avoid to deliver multiple copy of the same email,
# this was useless when kolabfilter was enable (or maybe when AV is enable)
# but dont slowdown anything, then always enable it
enable_original_recipient = no

# ASX on the old way, I was making a delivery for each recipient
# in the catchall, then the X-Original-to was giving me the name
of the recipient
# now I use a emailgency-id database, I dont need anymore of the
*recipient_limit=1
#kolabfilter_destination_recipient_limit = 1
#lmtp_destination_recipient_limit = 1
#cyrus_destination_recipient_limit = 1

alternate_config_directories = /kolab/etc/postfix_front

empty_address_recipient=alain.spineux

================================== master.cf
====================================

# cat /kolab/etc/postfix/master.cf
# (c) 2004 Steffen Hansen <steffenklaralvdalens-datakonsult.se>
(Klaralvdalens Datakonsult AB)
# (c) 2003 Tassilo Erlewein < tassilo.erleweinerfrakon.de>
# (c) 2003 Martin Konold <martin.konolderfrakon.de>
# (c) 2003 Achim Frank < achim.frankerfrakon.de>
# This program is Free Software under the GNU General Public License (>=v2).
# Read the file COPYING that comes with this packages for details.

# this file is automatically written by the Kolab config backend
# manual additions are lost unless made to the template in the Kolab
config directory

# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
# nobody from this instance listening on port 25 nor 465
127.0.0.1:10090 inet n - n - - smtpd
        -o smtpd_authorized_xforward_hosts=127.0.0.0/8
#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
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
relay unix - - n - - smtp -o fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
local unix - n n - - local
#virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
#cyrus unix - n n - - pipe
user=cyrus argv=/kolab/bin/cyrdeliver -e -r ${sender} -m ${extension}
${user}
# ASX
#cyrus unix - n n - - pipe
flags=Onhqu user=kolab-r argv=/kolab/bin/cyrdeliver -e -r ${sender} -m
${recipient} ${user}

#uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=/kolab/bin/uux -r -n -z -a$sender -
$nexthop!rmail ($recipient)
#ifmail unix - n n - - pipe flags=F
user=ftn argv=/kolab/bin/ifmail -r $nexthop ($recipient)
#bsmtp unix - n n - - pipe flags=Fq.
user=foo argv=/kolab/bin/bsmtp -f $sender $nexthop $recipient
#465 inet n - n - - smtpd -o
smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
post-cleanup unix n - n - 0 cleanup -o virtual_maps=
smtp-amavis unix - - n - 2 smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes
    -o disable_dns_lookups=yes
# SMTP interface for injecting mail back into postfix
# from kolabfilter
127.0.0.1:10025 inet n - n - - smtpd
    -o content_filter=
    -o cleanup_service_name=post-cleanup
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks=127.0.0.0/8
    -o smtpd_authorized_xforward_hosts= 127.0.0.0/8
    -o strict_rfc821_envelopes=yes
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
# SMTP interface for injecting mail back into postfix
# from amavis
127.0.0.1:10026 inet n - n - - smtpd
    -o content_filter=
    -o cleanup_service_name=post-cleanup
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks= 127.0.0.0/8
    -o strict_rfc821_envelopes=yes
    -o smtpd_error_sleep_time=0
    -o smtpd_soft_error_limit=1001
    -o smtpd_hard_error_limit=1000
kolabpolicy unix - n n - - spawn
user=kolab-n argv=/kolab/etc/kolab/kolab_smtpdpolicy

kolabfilter unix - n n - - pipe
user=kolab-n flags=n argv=/kolab/bin/php
    -c /kolab/etc/apache/php.ini
    -f /kolab/etc/resmgr/kolabfilter.php
    --
    -h fc6-eg.asxnet.loc
    -s ${sender}
    -r ${recipient}
    -c ${client_address}
    -u ${sasl_username}

kolabmailboxfilter unix - n n - -
pipe user=kolab-n flags=n argv=/kolab/bin/php
    -c /kolab/etc/apache/php.ini
    -f /kolab/etc/resmgr/kolabmailboxfilter.php
    --
    -h fc6-eg.asxnet.loc
    -s ${sender}
    -r ${recipient}
    -c ${client_address}

--
Alain Spineux
aspineux gmail com
May the sources be with you

--
--
Alain Spineux
aspineux gmail com
May the sources be with you