On Mon, Aug 16, 2010 at 1:22 PM, Brian Evans - Postfix List <
grkni...@scent-team.com> wrote:

>  On 8/16/2010 10:45 AM, Christopher Koeber wrote:
>
>> Well, maybe it will help to describe what I am trying to do.
>>
>> I have a list of folks in my OpenLDAP server that I would like accounts
>> for. These accounts are for the 'students.wesleyseminary.edu <
>> http://students.wesleyseminary.edu>' domain.
>>
>> I also have folks in a 'wesleyministrynetwork.com <
>> http://wesleyministrynetwork.com>' domain that I would like mail to be
>> sent to. These folks are going to be in a different organizational unit.
>>
>>
>> Obviously, I also will need to have the postmaster/mailerdaemon/etc.
>> accounts working as well.
>>
>> Now, from the documentation that I looked at, the virtual maps/alias
>> settings that I loaded in seemed like the best bet.
>>
>> Is that correct, or do I need to go in a different direction?
>>
>
> I believe you are heading in the right direction, but you must understand
> my comments.
>
> When a bare username is retrieved from a map, $myorigin is appended to it
> automatically.
> $myorigin defaults to $myhostname  (
> http://www.postfix.org/postconf.5.html#myorigin)
>
> virtual_ALIAS_maps apply to ALL mail passed through the system and are
> applied before delivery.
>
> virtual_MAILBOX_maps validate *and* point to the mailbox (when using the
> virtual(8) delivery) for users that are included in the domains for
> virtual_MAILBOX_domains
>
> If you do not need to apply alternate names (aka aliases) to users, do not
> use virtual_ALIAS_maps.
> It is recommended to use virtual_ALIAS_maps for the accounts you pointed
> out above and *not* include normal users that virtual_MAILBOX_maps will do
> for you.
>
> When you do have a virtual_ALIAS_maps match, make sure it is fully
> qualified:
> Example:
> postmas...@wts-zimbra.wesleysem.edu  real.u...@wts-zimbra.wesleysem.edu
>

Great, I don't get a bounceback!!!!

Thanks, but the email hasn't been delivered to an actual mailbox. My guess
is that the mapping for the users to the mailbox hasn't been worked out.

OK, I am not sure if I am doing this correctly. I have the following
configured for postconf -n:

----------------------------------------------------------------------------------------------------------------------------------------------------------
alias_maps = hash:/etc/mail/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 20
home_mailbox = .Maildir/
html_directory = /usr/share/doc/postfix-2.6.6/html
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
local_transport = virtual
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination =
mydomain = students.wesleyseminary.edu
myhostname = wts-zimbra.wesleysem.edu
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/readme
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_banner = students.wesleyseminary.edu ESMTP $mail_name ($mail_version)
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,  reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_key_file = /etc/postfix/newkey.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf
virtual_gid_maps = static:$studentemail-gid
virtual_mailbox_base = /
virtual_mailbox_domains = /etc/postfix/virtual_domains.cf
virtual_mailbox_maps = ldap:/etc/postfix/ldap-maps.cf
virtual_minimum_uid = 1000
virtual_uid_maps = static:$studentemail-uid
----------------------------------------------------------------------------------------------------------------------------------------------------------

So, here is what I have for my ldap-aliases.cf:

----------------------------------------------------------------------------------------------------------------------------------------------------------
server_host = wts-studdir.wesleysem.edu
search_base = ou=Students,dc=wesleyseminary,dc=edu
version=3
timeout = 10
size_limit = 1
bind = yes
bind_dn = Bind_DN
bind_pw = password
query_filter = (mail=%s)
result_attribute = mail
----------------------------------------------------------------------------------------------------------------------------------------------------------

My question is where does the mapping for the user's physical mailboxes go?
And within the LDAP pull should the result from the query have the
".Maildir" part added on or not?

I thought it was in virtual_mailbox_maps if they weren't local users.

Last question.

What do I need to do to add additional support for the second domain to get
pulled from a separate OU in LDAP?

Is that possible?

Also, thanks to all of the help given so far! Postfix seems very powerful
but I am still trying to wrap my head around it.


>
>
>> I am willing to make any change on the Postfix settings or the server as
>> necessary.
>>
>> I will also go through the suggestions as you mentioned below.
>>
>> Thank you for the help.
>>
>> Regards,
>> Christopher Koeber
>>
>>
>> On Mon, Aug 16, 2010 at 9:01 AM, Brian Evans - Postfix List <
>> grkni...@scent-team.com <mailto:grkni...@scent-team.com>> wrote:
>>
>>     On 8/15/2010 4:47 PM, Christopher Kurtis Koeber wrote:
>>
>>
>>        Aug 15 16:32:57 WTS-ZIMBRA postfix/qmgr[18608]: 248B53220E2:
>>        from=<ckoe...@wesleyseminary.edu
>>        <mailto:ckoe...@wesleyseminary.edu>>, size=288, nrcpt=1 (queue
>>
>>        active)
>>        Aug 15 16:32:57 WTS-ZIMBRA postfix/virtual[18620]: 248B53220E2:
>>        to=<dbayasekara8...@wts-zimbra.wesleysem.edu
>>        <mailto:dbayasekara8...@wts-zimbra.wesleysem.edu>>,
>>
>>        orig_to=<dbayasekara8...@students.wesleyseminary.edu
>>        <mailto:dbayasekara8...@students.wesleyseminary.edu>>,
>>
>>        relay=virtual,
>>        delay=23, delays=23/0.03/0/0.08, dsn=5.1.1, status=bounced
>>        (unknown user:
>>        "dbayasekara8...@wts-zimbra.wesleysem.edu
>>        <mailto:dbayasekara8...@wts-zimbra.wesleysem.edu>")
>>
>>
>>        OK, your original command shows nothing but I am tring to send
>>        mail to
>>        "students.wesleyseminary.edu
>>        <http://students.wesleyseminary.edu>" which is defined in
>>
>>        my virtual_mailbox_domains.cf
>>        <http://virtual_mailbox_domains.cf> file.
>>
>>
>>
>>    Please notice the lines above.  A mail is sent to
>>    "dbayasekara8...@students.wesleyseminary.edu
>>    <mailto:dbayasekara8...@students.wesleyseminary.edu>" but then is
>>
>>    aliased to "dbayasekara8...@wts-zimbra.wesleysem.edu
>>    <mailto:dbayasekara8...@wts-zimbra.wesleysem.edu>" before it
>>
>>    reaches your virtual_mailbox_maps.  This probably occurs in
>>    virtual_alias_maps.
>>
>>    According to your previous mail:
>>
>>        Aug 15 13:57:45 WTS-ZIMBRA postfix/smtpd[17373]: maps_find:
>>        virtual_alias_maps:ldap:/etc/postfix/ldap-aliases.cf
>>        <http://ldap-aliases.cf>(0,lock|fold_fix):
>> dbayasekara8...@students.wesleyseminary.edu
>>        <mailto:dbayasekara8...@students.wesleyseminary.edu>  =
>>
>>        dbayasekara8469
>>
>>
>>    This will alias the mail to "dbayasekara8...@$myorigin".
>>    Thus, your virtual_mailbox_map fails as you noticed below in
>>    querying with postmap.
>>
>>    I'm not sure what you are trying to accomplish by setting
>>    virtual_alias_maps. However, I strongly suggest returning a fully
>>    qualified address if you do not want to append $myorigin to each
>>    mail.
>>
>>
>>        postmap outputs:
>>
>>        ------------------------------------------------------------------
>>        # postmap -q dbayasekara8...@wts-zimbra.wesleysem.edu
>>        <mailto:dbayasekara8...@wts-zimbra.wesleysem.edu>
>>        ldap:/etc/postfix/ldap-maps.cf <http://ldap-maps.cf>
>>
>>        # postmap -q dbayasekara8...@students.wesleyseminary.edu
>>        <mailto:dbayasekara8...@students.wesleyseminary.edu>
>>        ldap:/etc/postfix/ldap-maps.cf <http://ldap-maps.cf>
>>
>>        /home/studentemail/students.wesleyseminary.edu/dbayasekara8469
>>        <http://students.wesleyseminary.edu/dbayasekara8469>
>>
>>        ------------------------------------------------------------------
>>
>>
>>    You also may have an error in your results for virtual_mailbox_maps.
>>
>>        Postconf -n:
>>
>>        ------------------------------------------------------------------
>>
>>
>>        virtual_mailbox_base = /home/studentemail/
>>        ------------------------------------------------------------------
>>
>>
>>    virtual_mailbox_base will prepend to your results from
>>    virtual_mailbox_maps.
>>    The files will attempt to be put at
>>    "/home/studentemail/home/studentemail/
>> students.wesleyseminary.edu/dbayasekara8469
>>    <http://students.wesleyseminary.edu/dbayasekara8469>"
>>
>>
>>    If this is what you want, great.  If not, you should fix it.
>>
>>
>>        So the questions I have are (1) what do I need to do to send
>>        mail to the
>>        domains defined in virtual_domains.cf <http://virtual_domains.cf>
>>
>>        and (2) how can I get get the lookups via LDAP working for the
>>        domains
>>        defined in that file?
>>
>>        Thank you for your time.
>>
>>
>>
>>
>

Reply via email to