>Есть проблема. Нужно чтобы комп под FreeBSD забирал с внешнего почтового ящика
>почту, и рассортировывал локальным пользователям. Т.е. на ящик приходят все письма,
>посланные на адрес с доменом @mydomen.ru, независимо от того, что стоит
>перед знаком @. Я хочу снять с этого ящика и распределить
>по пользователям, в зависимости от того, что перед @, с возможностью
>забирать почту стандартными виндовыми клиентами.
>
>Вот. Надеюсь, понятно выразился. Заранее спасибо за советы.
По моему, файл virtusertable для этого предназначен. Вот выдержка из документации:
virtusertable A domain-specific form of aliasing, allowing multiple virtual domains to be hosted on one machine. For example, if the virtuser table contained:
info@foo.com foo-info
info@bar.com bar-info
joe@bar.com error:nouser 550 No such user here
jax@bar.com error:5.7.0:550 Address invalid
@baz.org jane@example.net
then mail addressed to info@foo.com will be sent to the address foo-info, mail addressed to info@bar.com will be delivered to bar-info, and mail addressed to anyone at baz.org will be sent to jane@example.net, mail to joe@bar.com will be rejected with the specified error message, and mail to jax@bar.com will also have a RFC 1893 compliant error code 5.7.0.
The username from the original address is passed as %1 allowing:
@foo.org %1@example.com
meaning someone@foo.org will be sent to someone@example.com. Additionally, if the local part consists of "user+detail" then "detail" is passed as %2 and "+detail" is passed as %3 when a match against user+* is attempted, so entries like
old+*@foo.org new+%2@example.com
gen+*@foo.org %2@example.com
+*@foo.org %1%3@example.com
X++@foo.org Z%3@example.com
@bar.org %1%3
and other forms are possible. Note: to preserve "+detail" for a default case (@domain) %1%3 must be used as RHS.
There are two wildcards after "+": "+" matches only a non-empty detail, "*" matches also empty details, e.g., user+@foo.org matches +*@foo.org but not ++@foo.org. This can be used to ensure that the parameters %2 and %3 are not empty.
All the host names on the left hand side (foo.com, bar.com, and baz.org) must be in class {w} or class {VirtHost}. The latter can be defined by the macros VIRTUSER_DOMAIN or VIRTUSER_DOMAIN_FILE (analogously to MASQUERADE_DOMAIN and MASQUERADE_DOMAIN_FILE, see below). If VIRTUSER_DOMAIN or VIRTUSER_DOMAIN_FILE is used, then the entries of class {VirtHost} are added to class {R}, i.e., relaying is allowed to (and from) those domains. The default map definition is:
hash /etc/mail/virtusertable
A new definition can be specified as the second argument of the FEATURE macro, such as
FEATURE(`virtusertable', `dbm /etc/mail/virtusers')
|