Discussion:
local_recipient_maps and Cyrus
(too old to reply)
Søren Schimkat
2007-05-22 13:45:22 UTC
Permalink
Hi Guys

Using Cyrus with virtual users authenticating using sasldb, I had to
disable the local_recipient_maps in order to recieve mail for users that
dosn´t exists on the system. I would like to use the
local_recipient_maps though, but I´m not sure how to make that work with
Cyrus.

A hint on that one would be nice.

Regards Søren Schimkat
Magnus Bäck
2007-05-22 18:24:41 UTC
Permalink
On Tuesday, May 22, 2007 at 15:45 CEST,
Post by Søren Schimkat
Using Cyrus with virtual users authenticating using sasldb, I had to
disable the local_recipient_maps in order to recieve mail for users
that dosn´t exists on the system. I would like to use the
local_recipient_maps though, but I´m not sure how to make that work
with Cyrus.
If the users are virtual, why is local_recipient_maps being used for the
recipient validation? Either define a lookup table containing all users
and refer to it in local_recipient_maps, or make the domain a virtual
mailbox domain and list all users in virtual_mailbox_maps.

"postconf -n" output, please.
--
Magnus Bäck
***@dsek.lth.se
Søren Schimkat
2007-05-23 10:15:39 UTC
Permalink
Post by Magnus Bäck
Post by Søren Schimkat
Using Cyrus with virtual users authenticating using sasldb, I had to
disable the local_recipient_maps in order to recieve mail for users
that dosn´t exists on the system. I would like to use the
local_recipient_maps though, but I´m not sure how to make that work
with Cyrus.
If the users are virtual, why is local_recipient_maps being used for the
recipient validation? Either define a lookup table containing all users
and refer to it in local_recipient_maps, or make the domain a virtual
mailbox domain and list all users in virtual_mailbox_maps.
"postconf -n" output, please.
You kinda lost mere here.

The thing I want to do - is to use all the checks included in the
default local_recipient_maps (when not configuring
local_recipient_maps), plus somehow tell postfix to accept mail to the
virtual Cyrus user too.

I guess that I could do something like this:

sasldblistusers2 | perl -ne 'print "$1\t$1\n" if /^([^:]+):/;' >
/etc/postfix/virtuals

..which would give me a /etc/postfix/virtuals file looking like this:

***@domain1.tld ***@domain1.tld
***@domain1.tld ***@domain1.tld
***@domain2.tld ***@domain2.tld
etc ...

Then I could add this to main.cf:

virtual_alias_maps = hash:/etc/postfix/virtuals

.. and finally add some extra (to me still unknown) magic to main.cf,
that would tell Postfix to use both the default local_recipient_maps and
my new virtual_alias_maps. Am I right?

The thing that would be really cool, was to tell Postfix to ask Cyrus if
the given email address is valid or not - but I guess that´s not an option.

# postconf -n

alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
local_recipient_maps =
mail_owner = postfix
mailbox_transport = cyrus
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost,
domain1.tld, domain2.tld, kinda.long.list.of.domains
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550


Regards Søren
Magnus Bäck
2007-05-26 19:42:15 UTC
Permalink
On Wednesday, May 23, 2007 at 12:15 CEST,
Post by Søren Schimkat
Post by Magnus Bäck
If the users are virtual, why is local_recipient_maps being used for
the recipient validation? Either define a lookup table containing
all users and refer to it in local_recipient_maps, or make the
domain a virtual mailbox domain and list all users in
virtual_mailbox_maps.
"postconf -n" output, please.
You kinda lost mere here.
The thing I want to do - is to use all the checks included in the
default local_recipient_maps (when not configuring
local_recipient_maps), plus somehow tell postfix to accept mail to the
virtual Cyrus user too.
sasldblistusers2 | perl -ne 'print "$1\t$1\n" if /^([^:]+):/;' >
/etc/postfix/virtuals
etc ...
virtual_alias_maps = hash:/etc/postfix/virtuals
Yes, that would prevent those addresses from being rejected by smtpd(8),
but you should instead list that map local_recipient_maps together with
the default value. But do note that the lookup keys for
local_recipient_maps are bare usernames and not complete addresses.

But again, if the users in the domain is virtual and do not exist as
system users, why are you configuring the domain as a local domain
instead of a virtual mailbox domain? I'd recommend the following setup:

1. Make the domain a virtual mailbox domain, i.e. list it in
virtual_mailbox_domains instead of mydestination.
2. Set virtual_transport to your Cyrus transport.
3. List all Cyrus users in virtual_mailbox_maps.
4. If any addresses in the domain need to be delivered to a
local user or to a local alias, use virtual_alias_maps to
rewrite the address to a domain listed in mydestination.

[...]
--
Magnus Bäck
***@dsek.lth.se
Continue reading on narkive:
Loading...