mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Handle alias to sender-only address
This commit is contained in:
@@ -81,7 +81,6 @@ export default {
|
||||
return await this.$refs.observer.validate() && await this.$refs.passwordForm.validate()
|
||||
},
|
||||
update () {
|
||||
console.log(this.form)
|
||||
this.$emit('input', this.form)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -39,6 +39,18 @@
|
||||
@input="update"
|
||||
/>
|
||||
</validation-provider>
|
||||
<validation-provider
|
||||
v-slot="{ errors }"
|
||||
rules=""
|
||||
>
|
||||
<v-switch
|
||||
v-model="form.mailbox.is_send_only"
|
||||
:label="'Send only account' | translate"
|
||||
dense
|
||||
:error-messages="errors"
|
||||
@input="update"
|
||||
/>
|
||||
</validation-provider>
|
||||
</validation-observer>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -393,6 +393,7 @@ class MailboxSerializer(serializers.ModelSerializer):
|
||||
model = models.Mailbox
|
||||
fields = (
|
||||
"pk", "use_domain_quota", "quota", "message_limit",
|
||||
"is_send_only",
|
||||
)
|
||||
|
||||
def validate_quota(self, value):
|
||||
|
||||
@@ -99,23 +99,26 @@ class SendOnlyAccountMap(object):
|
||||
filename = "sql-send-only.cf"
|
||||
mysql = (
|
||||
"SELECT '550 Requested mail action not taken: mailbox disabled' "
|
||||
"FROM admin_mailbox mb INNER JOIN admin_domain dom "
|
||||
"ON mb.domain_id=dom.id "
|
||||
"WHERE mb.is_send_only=1 AND dom.name='%d' AND mb.address='%u' "
|
||||
"FROM modoboa_admin_aliasrecipient amb "
|
||||
"INNER JOIN admin_mailbox mb "
|
||||
"ON mb.id=amb.r_mailbox_id "
|
||||
"WHERE mb.is_send_only=1 AND amb.address=CONCAT('%u', '@','%d') "
|
||||
"LIMIT 1"
|
||||
)
|
||||
postgres = (
|
||||
"SELECT '550 Requested mail action not taken: mailbox disabled' "
|
||||
"FROM admin_mailbox mb INNER JOIN admin_domain dom "
|
||||
"ON mb.domain_id=dom.id "
|
||||
"WHERE mb.is_send_only AND dom.name='%d' AND mb.address='%u' "
|
||||
"FROM modoboa_admin_aliasrecipient amb "
|
||||
"INNER JOIN admin_mailbox mb "
|
||||
"ON mb.id=amb.r_mailbox_id "
|
||||
"WHERE mb.is_send_only AND amb.address='%u' || '@' || '%d' "
|
||||
"LIMIT 1"
|
||||
)
|
||||
sqlite = (
|
||||
"SELECT '550 Requested mail action not taken: mailbox disabled' "
|
||||
"FROM admin_mailbox mb INNER JOIN admin_domain dom "
|
||||
"ON mb.domain_id=dom.id "
|
||||
"WHERE mb.is_send_only=1 AND dom.name='%d' AND mb.address='%u' "
|
||||
"FROM modoboa_admin_aliasrecipient amb "
|
||||
"INNER JOIN admin_mailbox mb "
|
||||
"ON mb.id=amb.r_mailbox_id "
|
||||
"WHERE mb.is_send_only=1 AND mb.address='%u' || '@' || '%d' "
|
||||
"LIMIT 1"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user