Hi Zhang,
thanks for the quick reply.
its ok but I have followed your advice on this topic:
http://www.iredmail.org/forum/topic5325 … users.html
however it is not important because there is still the problem.
In practice i have updated the user row on vmail.mailbox as described and set the field allowedrecipients='@mydomain.local', and rejectedrecipients=NULL' for all users.
Even in this case, if a user tries to send an email to an address outside the local domain mydomain.local, for example john.smith@gmail.com, the email is sent successfully
Here is the log where user_1@mydomain.local send a mail to john.smith@gmail.com where user_1@mydomain.local as the field allowedrecipients set as @mydomain.local
2013-09-23 21:17:16 DEBUG Connect from 127.0.0.1, port 58926.
2013-09-23 21:17:16 DEBUG smtp session: request=smtpd_access_policy
2013-09-23 21:17:16 DEBUG smtp session: protocol_state=RCPT
2013-09-23 21:17:16 DEBUG smtp session: protocol_name=ESMTP
2013-09-23 21:17:16 DEBUG smtp session: client_address=127.0.0.1
2013-09-23 21:17:16 DEBUG smtp session: client_name=localhost
2013-09-23 21:17:16 DEBUG smtp session: reverse_client_name=localhost
2013-09-23 21:17:16 DEBUG smtp session: helo_name=192.168.1.10
2013-09-23 21:17:16 DEBUG smtp session: sender=user_1@mydomain.local
2013-09-23 21:17:16 DEBUG smtp session: recipient=john.smith@gmail.com
2013-09-23 21:17:16 DEBUG smtp session: recipient_count=0
2013-09-23 21:17:16 DEBUG smtp session: queue_id=
2013-09-23 21:17:16 DEBUG smtp session: instance=edb.524093bc.a9128.0
2013-09-23 21:17:16 DEBUG smtp session: size=0
2013-09-23 21:17:16 DEBUG smtp session: etrn_domain=
2013-09-23 21:17:16 DEBUG smtp session: stress=
2013-09-23 21:17:16 DEBUG smtp session: sasl_method=LOGIN
2013-09-23 21:17:16 DEBUG smtp session: sasl_username=user_1@mydomain.local
2013-09-23 21:17:16 DEBUG smtp session: sasl_sender=
2013-09-23 21:17:16 DEBUG smtp session: ccert_subject=
2013-09-23 21:17:16 DEBUG smtp session: ccert_issuer=
2013-09-23 21:17:16 DEBUG smtp session: ccert_fingerprint=
2013-09-23 21:17:16 DEBUG smtp session: encryption_protocol=
2013-09-23 21:17:16 DEBUG smtp session: encryption_cipher=
2013-09-23 21:17:16 DEBUG smtp session: encryption_keysize=0
2013-09-23 21:17:16 DEBUG --> Apply plugin: sql_alias_access_policy
2013-09-23 21:17:16 DEBUG SQL: SELECT accesspolicy, goto, moderators
FROM alias
WHERE
address='john.smith@gmail.com'
AND address <> goto
AND domain='gmail.com'
AND active=1
LIMIT 1
2013-09-23 21:17:16 DEBUG SQL Record: None
2013-09-23 21:17:16 DEBUG <-- Result: DUNNO (Not mail alias)
2013-09-23 21:17:16 DEBUG --> Apply plugin: sql_user_restrictions
2013-09-23 21:17:16 DEBUG SQL to get restriction rules of sender (user_1@mydomain.local):
SELECT
allowedrecipients, rejectedrecipients,
allowedsenders, rejectedsenders
FROM mailbox
WHERE username='user_1@mydomain.local'
LIMIT 1
2013-09-23 21:17:16 DEBUG Returned SQL Record: ('mydomain.local', '', '', '')
2013-09-23 21:17:16 DEBUG All allowed recipient: ['mydomain.local']
2013-09-23 21:17:16 DEBUG All rejected recipient: ['']
2013-09-23 21:17:16 DEBUG SQL to get restriction rules of recipient (john.smith@gmail.com):
SELECT
allowedrecipients, rejectedrecipients,
allowedsenders, rejectedsenders
FROM mailbox
WHERE username='john.smith@gmail.com'
LIMIT 1
2013-09-23 21:17:16 DEBUG Returned SQL Record: None
2013-09-23 21:17:16 DEBUG <-- Result: DUNNO
2013-09-23 21:17:16 INFO [127.0.0.1] user_1@mydomain.local -> john.smith@gmail.com, DUNNO
2013-09-23 21:17:16 DEBUG Connection closed
2013-09-23 21:17:16 DEBUG Closed SQL connection.
Can you help me ?
If this method does not work, there is another way to block the users of the local domain to the transmission of the email only within the local domain?
Regards.