R
R
Roma2014-03-06 10:22:15
linux
Roma, 2014-03-06 10:22:15

Postfix: how to forward a copy of a letter, within a domain, to a separate mailbox?

Hello colleagues.
Please help me to solve the problem.
There is a mail server based on postfix, let it be mail.example.org, which serves mail in the example.org domain.
You need to make sure that letters inside the example.org domain are sent to a separate mailbox (it is also in example.org). That is, for example, if a letter leaves [email protected] for [email protected], then forward it to [email protected]; but if the email is from [email protected] to [email protected] or from [email protected] to [email protected], then you do NOT need to forward it to [email protected]
How can such a scheme be implemented?
I tried to create my own class and do it through it ... It didn't work out.
As I tried:
In /etc/postfix/main.cf I wrote:

smtpd_delay_reject = yes
smtpd_restriction_classes = to_example
to_example = check_recipient_access hash:/etc/postfix/to_example_check
smtpd_sender_restrictions = check_sender_access hash:/etc/postfix/sender_checks, ...

In /etc/postfix/sender_checks :
example.org to_example
In /etc/postfix/to_example_check :
example.org BCC [email protected]
Then ran the commands:
postmap /etc/postfix/sender_checks
postmap /etc/postfix/to_example_check
service postfix restart

When I try to send a letter, I get the error "Server configuration error", the following entry in the logs:
Mar  5 17:19:18 mail postfix/smtpd[13287]: warning: unknown smtpd restriction: "BCC"
Mar  5 17:19:18 mail postfix/smtpd[13287]: NOQUEUE: reject: RCPT from unknown[10.1.129.18]: 451 4.3.5 Server configuration error; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<user1>

I see that it swears at "BCC" ... Which is not surprising (I did not immediately pay attention to this line in access):
This feature is not part of the stable Postfix release.

System:
# uname -a
Linux mail.example.org 2.6.32-220.17.1.el6.i686 #1 SMP Tue May 15 22:09:39 BST 2012 i686 i686 i386 GNU/Linux

# cat /etc/issue
CentOS release 6.2 (Final)

# rpm -q postfix
postfix-2.6.6-2.2.el6_1.i686

How can postfix implement this forwarding scheme?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question