Discussion:
Maildrop or procmail in virtual mailbox ldap environment
(too old to reply)
Tomas Tikovsky
2005-08-15 06:44:20 UTC
Permalink
Hello

I have following problem.
Users having multiple addresses maps using virtual_alias_maps to single
email address. And that is used by virtual_mailbox_maps to find out
mailbox name
that is DIFFERENT than mail localpart

for example.

***@domain.tld and ***@domain.tld are both addressess of
user admin

When i deliver mail using virtual delivery agent im fine because i can
use virtual_mailbox_maps.
When try to deliver by maildrop or procmail i dont know how to lookup
real username like in virtual_mailbox_maps.

in master.cf one can use macros like ${recipient}, ${sender}or ${user}
unfortunately $user contains mail localpart like postmaster for
***@domain.tld. My mailbox name is however admin.
i cant use $home in virtual environment (at least postfix complain that
unknown macro was used in master.cf)
Im using courier-imap and courier authentication library but users
authenticates using their real username not mail address.
I saw in previous releases of maildrop ldap configuration file that was
used to configure lookup of user mailbox. Its gone know
so my only idea is to use virtual_mailbox_map in /etc/maildroprc like this

$maildir = postmap -q ***@domain.tld
ldap:/etc/postfix/virtual_mailbox.cf

that command should produce something like admin/ (mailbox of user admin
located in /var/spool/mail/)

any ideas how to do it more cleanly?

PS: I'm trying to do this for realtime mail notification that is sent to
users logged into novell netware server. They are immediately informed
about new mail upon receiving.

Thanks
Tom
Tony Earnshaw
2005-08-15 08:19:59 UTC
Permalink
man, 15.08.2005 kl. 08.44 skrev Tomas Tikovsky:

[...]
Post by Tomas Tikovsky
in master.cf one can use macros like ${recipient}, ${sender}or ${user}
unfortunately $user contains mail localpart like postmaster for
i cant use $home in virtual environment (at least postfix complain that
unknown macro was used in master.cf)
Im using courier-imap and courier authentication library but users
authenticates using their real username not mail address.
I saw in previous releases of maildrop ldap configuration file that was
used to configure lookup of user mailbox. Its gone know
so my only idea is to use virtual_mailbox_map in /etc/maildroprc like this
ldap:/etc/postfix/virtual_mailbox.cf
that command should produce something like admin/ (mailbox of user admin
located in /var/spool/mail/)
any ideas how to do it more cleanly?
For the second time in a couple of days, Kari Matsson's "potted
Postfix/maildrop HOWTO" of 21st. July last from the dspam list, below. I
think Kari gives a pretty good summing up of how Postfix, maildrop (and
LDAP?) can work together.
Post by Tomas Tikovsky
PS: I'm trying to do this for realtime mail notification that is sent to
users logged into novell netware server. They are immediately informed
about new mail upon receiving.
--Tonni

--
Post by Tomas Tikovsky
Thanks Milan and Jay for yours quick response.
Sorry that I have not mentioned that the system uses postfix as MTA,
courier-imap (and imap-ssl). Users are stored into a LDAP database (so they
are not real users, and they cannot have a .forward to use with
maildrop/procmail).
Why? They should be able to. We use similar configuration:

Folks, I know this is a bit off-Courier-IMAP-only, but total solutions
are the ones which count.

Postfix w/ virtual mailboxes, only two accounts on the system: vmail and
root. vmail owns the Maildirs.

Few key lines from mail.cf (line continuations marked with \\\):

home_mailbox = Maildir/
mailbox_command = /usr/bin/maildrop -d "$USER" -f "$SENDER" \\\
"$SENDER" "$RECIPIENT" "$EXTENSION" "$USER" "$DOMAIN" "$LOCAL"
mydestination = localhost $myhostname
virtual_mailbox_domains = hash:/etc/postfix/virtual_mailbox_domains
virtual_mailbox_base = /var/mail/virtual
virtual_mailbox_maps = hash:/etc/postfix/virtual_mailbox_maps
virtual_alias_maps = hash:/etc/postfix/virtual_alias_maps
virtual_alias_domains =
virtual_minimum_uid = 100
virtual_gid_maps = static:1980
virtual_uid_maps = static:1980
virtual_transport = maildrop
maildrop_destination_recipient_limit = 1

The last 2 lines are what you (too) propably need. We were in the same
situation first, as Postfix uses 'virtual' transport for those virtual
mailboxes. Go for maildrop, and you get all the maildrop functionality.

We even call clamassassin to check for viruses and spamc for
SpamAssassin on low volume servers. Very simple to maintain solution.

mailbox_command is only used for local mail accounts - not for the
virtual ones.

Oh yes, there is a minor addition/change in Postfix master.cf, too:

maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -w 80
-d ${user}@${nexthop} ${sender} ${recipient} ${extension}
${user} ${nexthop}

And to be complete, few lines from our /etc/maildroprc, the "master"
maildrop file:

DEFAULT="$HOME/Maildir/"
MAILDIR="$HOME/Maildir"
SHELL=/bin/bash # default shell is usually /bin/sh
logfile "$HOME/maildrop.log"
#VERBOSE=1
#
sender="$1"
recipient="$2"
extension="$3"
user="$4"
domain="$5" # This is the $nexthop in virtual mailboxes.
local="$6" # This is actually just '$user+$extension'.
# local is defined only for user acct based mailboxes, not for virtuals.

`test -r $HOME/.mailfilter`
if( $RETURNCODE == 0 )
{
exception {
include $HOME/.mailfilter
}
}

..and you are ready for full maildrop'ing. (Marvellous product -- easy
to say after using procmail 10+ years.)

An example directory in this setup for user's private .mailfilter file:

/var/mail/virtual/domain/***@domain.tld

You are using LDAP, so some parts are a bit different.

For autoreply/vacation with this solution, you want to check YAA (yet
another autoresponder), as it is just about the only one out
there/freely available. It suports LDAP :-)
Post by Tomas Tikovsky
But, if it is not possible to wrap mail deletion, or something similar, with
courier-imap there is another way to get the job done, involving postfix and
Mail::Audit (Perl module).
Thanks!
Giorgio
//Kari
--
To Liza Picquard (?), by Phil Williams on BBC Radio 5, Wed. 10th Aug.
2005, 15:59 CEST:

"What is your definition of 'poor'?"
"Well, if your only occupation is collecting dog turds for a living,
you're pretty poor ..."

mail: ***@billy.demon.nl
http://www.billy.demon.nl
Tony Earnshaw
2005-08-15 12:32:04 UTC
Permalink
all correct but
but
/var/spool/mail/username
username cant be extracted from email address but ldap lookup is needed
to obtain one as in my
virtual_mailbox_maps = ldap:/etc/postfix/virtualmailbox.cf
If you use maildrop, you should not be using Postfix to deliver the
mail. Do what Kari says ;)
im just currious to know if i can do this with my setup 'cause i wouldnt
have to reconfigure courier to look into different maildirs and create them
all the features u mentioned already works (with virtual delivery
agent). Im trying to add features that needs to trigger external program
uppon mail delivery
so i thought i could use maildrop or procmail to handle it.
Please don't reply to me directly.Your question was asked on the list,
so for everyone's benefit you could do best to stick to the list.

Also, top posting will not help you get a structured answer to your
questions/comments.

That said, I have a site (1150+ users) with a maildir hierarchy like so:

/home/vmail/group/user.

I have an LDAP DIT which maildrop uses to distribute mail to each user,
using vmail:vmail's UID/GID to do this. maildrop has to know both the
mail user, group, user's so-called home dir and his maildir to be able
to distribute, and it gets these from LDAP.

Postfix simply hands the message to maildrop for it to do its thing,
this can be done either with a virtual config/transport (as Kari uses)
or using mailbox_command if the users are considered local. At this
particular site users are considered local, so I do it with
mailbox_command as Kari details; at this site I do it with
virtual/virtual transport (also exactly as Kari details).

maildrop's authldaprc (newer authlib-based maildrop) or
maildropldap.config (older maildrop) looks like ("//" are comments
purely put in for this post):

uidnumber 18 // vmail
gidnumber 18 // vmail
mail_attr mail
uid_attr uid
uidnumber_attr dummy
gidnumber_attr dummy
maildir_attr mailmessagestore // from qmail.schema
homedirectory_attr mailmessagestore
quota_attr quota // from Courier authldap.schema
hostname whatever
basedn dc=example,dc=nl
filter &(objectclass=qmailuser)(accountstatus=active)
binddn cn=proxy,dc=example,dc=nl // proxy bind because of hidden accountstatus LDAP ACL
bindpw proxypassword
timeout 10
search_method uid

attribute example:

dn: cn=tearnshaw,ou=beheerders,dc=example,dc=nl
mailMessageStore: /home/vmail/beheerders/tearnshaw/Maildir

Can't use homeDirectory attribute for maildrop, since that's used for
users' home directories on other machines in the LAN.

Tip: The above won't create new user dirs or Maildirs automatically,
you'll have to use a script to do that.

HTH. I bow out, since you now know as much as I do (and Kari does ;)

--Tonni
--
To Liza Picquard (?), by Phil Williams on BBC Radio 5, Wed. 10th Aug.
2005, 15:59 CEST:

"What is your definition of 'poor'?"
"Well, if your only occupation is collecting dog turds for a living,
you're pretty poor ..."

mail: ***@billy.demon.nl
http://www.billy.demon.nl
Tomas Tikovsky
2005-08-15 13:29:36 UTC
Permalink
Post by Tony Earnshaw
all correct but
but
/var/spool/mail/username
username cant be extracted from email address but ldap lookup is needed
to obtain one as in my
virtual_mailbox_maps = ldap:/etc/postfix/virtualmailbox.cf
If you use maildrop, you should not be using Postfix to deliver the
mail. Do what Kari says ;)
im just currious to know if i can do this with my setup 'cause i wouldnt
have to reconfigure courier to look into different maildirs and create them
all the features u mentioned already works (with virtual delivery
agent). Im trying to add features that needs to trigger external program
uppon mail delivery
so i thought i could use maildrop or procmail to handle it.
Please don't reply to me directly.Your question was asked on the list,
so for everyone's benefit you could do best to stick to the list.
Also, top posting will not help you get a structured answer to your
questions/comments.
/home/vmail/group/user.
I have an LDAP DIT which maildrop uses to distribute mail to each user,
using vmail:vmail's UID/GID to do this. maildrop has to know both the
mail user, group, user's so-called home dir and his maildir to be able
to distribute, and it gets these from LDAP.
Postfix simply hands the message to maildrop for it to do its thing,
this can be done either with a virtual config/transport (as Kari uses)
or using mailbox_command if the users are considered local. At this
particular site users are considered local, so I do it with
mailbox_command as Kari details; at this site I do it with
virtual/virtual transport (also exactly as Kari details).
maildrop's authldaprc (newer authlib-based maildrop) or
maildropldap.config (older maildrop) looks like ("//" are comments
uidnumber 18 // vmail
gidnumber 18 // vmail
mail_attr mail
uid_attr uid
uidnumber_attr dummy
gidnumber_attr dummy
maildir_attr mailmessagestore // from qmail.schema
homedirectory_attr mailmessagestore
quota_attr quota // from Courier authldap.schema
hostname whatever
basedn dc=example,dc=nl
filter &(objectclass=qmailuser)(accountstatus=active)
binddn cn=proxy,dc=example,dc=nl // proxy bind because of hidden accountstatus LDAP ACL
bindpw proxypassword
timeout 10
search_method uid
dn: cn=tearnshaw,ou=beheerders,dc=example,dc=nl
mailMessageStore: /home/vmail/beheerders/tearnshaw/Maildir
when u send mail to ***@example.nl postfix executes maildrop with
arguments from master.cf
where none can contain tearnshaw

i need cn=ternshaw for authlib. I cant query authlib using email, only
cn or uid
maildrop -f ternshaw works fine getting all attribs from ldap
maildrop -f ***@example.com doesnt work and fails with user uknown

when maildrop could be configured for seperate ldap lookup i would be happy

postfix virtual delivery agent does that in virtual_mailbox_maps. It
looks for uid (to compose path /var/spool/mail/$uid) or mailmessagestore
(/var/spol/mail/uid) of user having email=***@example.nl

this step im missing when using maildrop.

Tom
Post by Tony Earnshaw
Can't use homeDirectory attribute for maildrop, since that's used forusers' home directories on other machines in the LAN.
Tip: The above won't create new user dirs or Maildirs automatically,
you'll have to use a script to do that.
HTH. I bow out, since you now know as much as I do (and Kari does ;)
--Tonni
mouss
2005-08-15 21:03:20 UTC
Permalink
Post by Tony Earnshaw
all correct but
but
/var/spool/mail/username
username cant be extracted from email address but ldap lookup is
needed to obtain one as in my
virtual_mailbox_maps = ldap:/etc/postfix/virtualmailbox.cf
If you use maildrop, you should not be using Postfix to deliver the
mail. Do what Kari says ;)
im just currious to know if i can do this with my setup 'cause i
wouldnt have to reconfigure courier to look into different maildirs
and create them
all the features u mentioned already works (with virtual delivery
agent). Im trying to add features that needs to trigger external
program uppon mail delivery
so i thought i could use maildrop or procmail to handle it.
Please don't reply to me directly.Your question was asked on the list,
so for everyone's benefit you could do best to stick to the list.
Also, top posting will not help you get a structured answer to your
questions/comments.
/home/vmail/group/user.
I have an LDAP DIT which maildrop uses to distribute mail to each user,
using vmail:vmail's UID/GID to do this. maildrop has to know both the
mail user, group, user's so-called home dir and his maildir to be able
to distribute, and it gets these from LDAP.
Postfix simply hands the message to maildrop for it to do its thing,
this can be done either with a virtual config/transport (as Kari uses)
or using mailbox_command if the users are considered local. At this
particular site users are considered local, so I do it with
mailbox_command as Kari details; at this site I do it with
virtual/virtual transport (also exactly as Kari details).
maildrop's authldaprc (newer authlib-based maildrop) or
maildropldap.config (older maildrop) looks like ("//" are comments
uidnumber 18 // vmail
gidnumber 18 // vmail
mail_attr mail
uid_attr uid
uidnumber_attr dummy
gidnumber_attr dummy
maildir_attr mailmessagestore // from qmail.schema
homedirectory_attr mailmessagestore
quota_attr quota // from Courier authldap.schema
hostname whatever
basedn dc=example,dc=nl
filter &(objectclass=qmailuser)(accountstatus=active)
binddn cn=proxy,dc=example,dc=nl // proxy bind because of
hidden accountstatus LDAP ACL
bindpw proxypassword
timeout 10
search_method uid
dn: cn=tearnshaw,ou=beheerders,dc=example,dc=nl
mailMessageStore: /home/vmail/beheerders/tearnshaw/Maildir
with arguments from master.cf
where none can contain tearnshaw
i need cn=ternshaw for authlib. I cant query authlib using email, only
cn or uid
maildrop -f ternshaw works fine getting all attribs from ldap
when maildrop could be configured for seperate ldap lookup i would be happy
postfix virtual delivery agent does that in virtual_mailbox_maps. It
looks for uid (to compose path /var/spool/mail/$uid) or
mailmessagestore (/var/spol/mail/uid) of user having
this step im missing when using maildrop.
use maildrop -d ${user} in master.cf. http://www.postfix.org/pipe.8.html
says

*${user*}
This macro expands to the username part of a
recipient address. For example, with an
address /user+***@domain/ the username part is
/user/.

Isn't that what you need?

of course, define the aliases in virtual_alias_maps and the recipient in
virtual_mailbox_maps.
Tony Earnshaw
2005-08-15 14:49:18 UTC
Permalink
man, 15.08.2005 kl. 15.29 skrev Tomas Tikovsky:

[...]
Post by Tomas Tikovsky
arguments from master.cf
where none can contain tearnshaw
maildrop unix - n n - - pipe
flags=DRhu user=vmail
argv=/usr/bin/maildrop -w 80 -d ${user}

In this case, ${user} is tearnshaw. Would also be First.Last, then you
have to configure /etc/maildroprc to use 'cut' or whatever to get first
or last (or both) out of First.Last.
Post by Tomas Tikovsky
i need cn=ternshaw for authlib. I cant query authlib using email, only
cn or uid
Rubbish/trash/nonsense. Of course you can, only you obviously haven't
found out how. Though why I don't know why, since it's the default.
Post by Tomas Tikovsky
maildrop -f ternshaw works fine getting all attribs from ldap
This is all wrong. I don't know where you get "maildrop -f" from. At
least, I don't, and mine all works.
Post by Tomas Tikovsky
when maildrop could be configured for seperate ldap lookup i would be happy
Separate from what? maildrop has nothing to do with Postfix. Postfix
hands to maildrop, maildrop does its stuff, completely independently
from Postfix. Postfix *does* (at least it does at my sites) wait for
maildrop to give an ok or a fail or an EX_TEMPFAIL before deciding what
to do (like a 2xx, 5xx or 4xx message back to the client).
Post by Tomas Tikovsky
postfix virtual delivery agent does that in virtual_mailbox_maps. It
looks for uid (to compose path /var/spool/mail/$uid) or mailmessagestore
this step im missing when using maildrop.
Nono. If you want to use the mail attribute instead of UID, then you
can. In fact, mail is the default.

You can force maildrop (in /etc/maildroprc) to use whatever parameters
you want. By using "cut", "awk", whatever you can force the path to the
user's Maildir.

Listen. This is now 100% maildrop and 0% Postfix.

See you on the maildrop list.

--Tonni
--
To Liza Picquard (?), by Phil Williams on BBC Radio 5, Wed. 10th Aug.
2005, 15:59 CEST:

"What is your definition of 'poor'?"
"Well, if your only occupation is collecting dog turds for a living,
you're pretty poor ..."

mail: ***@billy.demon.nl
http://www.billy.demon.nl
Damien Mascord
2005-08-16 05:59:34 UTC
Permalink
Post by Tony Earnshaw
[...]
Post by Tomas Tikovsky
arguments from master.cf
where none can contain tearnshaw
maildrop unix - n n - - pipe
flags=DRhu user=vmail
argv=/usr/bin/maildrop -w 80 -d ${user}
In this case, ${user} is tearnshaw. Would also be First.Last, then you
have to configure /etc/maildroprc to use 'cut' or whatever to get first
or last (or both) out of First.Last.
sorry but u r still missing the point :) username of our users is NOT PART OF
EMAIL ADDRESS
SO U CANNOT EXTRACT IT BY USING $USER OR ANY OTHER MACRO POSTFIX USES
dn: uid=boss,o=company
uid: boss
$USER contains John.Surname but i need boss
Hi Tomas,

You either need to setup virtual aliases to make sure maildrop gets
looked up with the final recipient (option 1), or you need to have
maildrop aware of both John.Surname and boss (option 2).

So, for option 1, either have postfix look up the virtual alias via ldap
(suboption 1), or auto-generate the file using a script to query the
ldap DB (suboption 2).

For option 1, suboption 1, http://www.postfix.org/DATABASE_README.html,
http://www.postfix.org/ldap_table.5.html.

For option 2, I'm not familiar enough with maildrop to know how to get
it to query based either mail or uid, but I imagine you can play with
the query parameters in maildroprc to have it do that.

If you search the archives here, I imagine you'll find some postfix
users experiencing similar problems.

http://sourceforge.net/mailarchive/forum.php?forum=courier-maildrop

On a side note, the http://www.courier-mta.org/maildrop/ package has
more functionality than the "standard" maildrop that is usually shipped
with distributions.

HTH,

Damien
mouss
2005-08-16 06:04:56 UTC
Permalink
sorry but u r still missing the point :) username of our users is
NOT PART OF EMAIL ADDRESS
SO U CANNOT EXTRACT IT BY USING $USER OR ANY OTHER MACRO POSTFIX USES
dn: uid=boss,o=company
uid: boss
$USER contains John.Surname but i need boss
Can't you use virtual aliases
***@example.com => boss
so that "-d ${user}" expands to "-d boss"?

if using two smptd listeners (such as in the case of a content filter
like amavis), make sure to disable alias expansion in the first listener.
Tomas Tikovsky
2005-08-16 06:17:36 UTC
Permalink
Post by mouss
sorry but u r still missing the point :) username of our users is
NOT PART OF EMAIL ADDRESS
SO U CANNOT EXTRACT IT BY USING $USER OR ANY OTHER MACRO POSTFIX USES
dn: uid=boss,o=company
uid: boss
$USER contains John.Surname but i need boss
Can't you use virtual aliases
so that "-d ${user}" expands to "-d boss"?
if using two smptd listeners (such as in the case of a content filter
like amavis), make sure to disable alias expansion in the first listener.
.
thanx finaly something to think about. My virtual aliases now returns
for each user one or more email addresses.
when more addresses is returned mail is forwarded to them. Should
virtual aliases return something different?

This is my amavis listener

127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-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
-o receive_override_options=no_address_mappings
mouss
2005-08-16 07:23:50 UTC
Permalink
Post by Tomas Tikovsky
thanx finaly something to think about. My virtual aliases now returns
for each user one or more email addresses.
when more addresses is returned mail is forwarded to them. Should
virtual aliases return something different?
You can have something like this
***@example.com => ***@example.com, bar2, ***@example.net
***@example.com => bar1
...
so that at the end of expansion, you get a login to deliver to.
Post by Tomas Tikovsky
This is my amavis listener
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-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
-o receive_override_options=no_address_mappings
here, you disable rewrite in the second instead of the first. so your
aliases will be expanded by the first, but the second listener will
append myorigin, hence your problem. put the no_address_mapping in the
"standard" smtpd, the one that listens on port 25.
Tomas Tikovsky
2005-08-16 09:40:37 UTC
Permalink
Post by mouss
Post by Tomas Tikovsky
thanx finaly something to think about. My virtual aliases now returns
for each user one or more email addresses.
when more addresses is returned mail is forwarded to them. Should
virtual aliases return something different?
You can have something like this
when result of virtual_alias_maps is bar1 then bar1 is supposed to be
local user with unix account?
my all users are virtual having same uid gid.
Post by mouss
so that at the end of expansion, you get a login to deliver to.
Post by Tomas Tikovsky
This is my amavis listener
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-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
-o receive_override_options=no_address_mappings
here, you disable rewrite in the second instead of the first. so your
aliases will be expanded by the first, but the second listener will
append myorigin, hence your problem. put the no_address_mapping in the
"standard" smtpd, the one that listens on port 25.
.
mouss
2005-08-16 13:01:48 UTC
Permalink
Post by Tomas Tikovsky
Post by mouss
Post by Tomas Tikovsky
thanx finaly something to think about. My virtual aliases now
returns for each user one or more email addresses.
when more addresses is returned mail is forwarded to them. Should
virtual aliases return something different?
You can have something like this
when result of virtual_alias_maps is bar1 then bar1 is supposed to be
local user with unix account?
my all users are virtual having same uid gid.
that really depends on what you want to do. there is no fundamental
difference between unix and virtual users since you're going to use
maildrop.
here is a summary of one way to do things:

- use fqdn addresses everywhere.
- in your virtual_alias_maps, use things like:
***@example.com => ***@example.com, ***@example.org, ...
- enable address rewrite and redirection (alias expansion) in the last
smtpd. this is so filter get the "original" message.
- run maildrop with -d ${user}so that maildrop is run with "bar1"
instead of "***@example.com".

This should be enough.

There are other alternatives:
- use a local domain for just this. then you can use bar1 in the alias
expansion
- change the query in authdaemon to match both "boss" and
"***@yourdomain.example" (the query will thus use an OR statement).
- run maildrop with -d vmail and set the maildir in maildroprc. either
set it manually (DEFAULT=/var/mail/$DOMAIN/$USER where the vars are
passed by postfix), or "dynamically" by using an ldap script to query
your directory.
...
Tomas Tikovsky
2005-08-16 13:24:00 UTC
Permalink
Post by mouss
Post by Tomas Tikovsky
Post by mouss
Post by Tomas Tikovsky
thanx finaly something to think about. My virtual aliases now
returns for each user one or more email addresses.
when more addresses is returned mail is forwarded to them. Should
virtual aliases return something different?
You can have something like this
when result of virtual_alias_maps is bar1 then bar1 is supposed to be
local user with unix account?
my all users are virtual having same uid gid.
that really depends on what you want to do. there is no fundamental
difference between unix and virtual users since you're going to use
maildrop.
- use fqdn addresses everywhere.
- enable address rewrite and redirection (alias expansion) in the last
smtpd. this is so filter get the "original" message.
- run maildrop with -d ${user}so that maildrop is run with "bar1"
now my setup resolves ***@example.com to bar1 and then postfix adds
myorigin to it so bar1 becomes ***@myhostname and is delivered using
local delivery agent which trasport i redirected to maildrop transport.
then i can use the $user macro. But is that right?
Post by mouss
This should be enough.
- use a local domain for just this. then you can use bar1 in the alias
expansion
- change the query in authdaemon to match both "boss" and
- run maildrop with -d vmail and set the maildir in maildroprc. either
set it manually (DEFAULT=/var/mail/$DOMAIN/$USER where the vars are
passed by postfix), or "dynamically" by using an ldap script to query
your directory.
...
i dont think its possible because LDAP_MAIL attr in courier_authlib is
ANDED to LDAP_FILTER internaly
Post by mouss
.
mouss
2005-08-16 15:05:19 UTC
Permalink
Post by Tomas Tikovsky
local delivery agent which trasport i redirected to maildrop
transport. then i can use the $user macro. But is that right?
yes.
Now, I recommend that you put the domain yourself, instead of relying on
myorigin (someday, you may need to change myorigin...).
Post by Tomas Tikovsky
i dont think its possible because LDAP_MAIL attr in courier_authlib is
ANDED to LDAP_FILTER internaly
I don't know how authlib constructs the ldap query, so I can't say for
sure. anyway, you apparently don't need to go this road.

Loading...