How do I "unset" a zimbraMTARestriction

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
Mike Carifio
Posts: 19
Joined: Fri Sep 12, 2014 10:02 pm

How do I "unset" a zimbraMTARestriction

Post by Mike Carifio »

How do I "unset" a zimbraMTARestriction with zmprov?
I can set it with:
$ zmprov mcf zimbraMTARestriction "reject_rbl_client x.y.z"
What if I decide I don't want to RBL x.y.z? How do I unset

the restriction? Pl. advise. Thanks.
bobby
Outstanding Member
Outstanding Member
Posts: 515
Joined: Fri Sep 12, 2014 10:01 pm

How do I "unset" a zimbraMTARestriction

Post by bobby »

try this:

$ zmprov mcf zimbraMtaRestriction ''
note that it's Mta (not MTA) :o
Mike Carifio
Posts: 19
Joined: Fri Sep 12, 2014 10:02 pm

How do I "unset" a zimbraMTARestriction

Post by Mike Carifio »

$ zmprov gcf zimbraMTARestriction

zimbraMTARestriction: reject_invalid_hostname

zimbraMTARestriction: reject_non_fqdn_hostname

zimbraMTARestriction: reject_non_fqdn_sender


$ zmprov gcf zimbraMtaRestriction

zimbraMtaRestriction: reject_invalid_hostname

zimbraMtaRestriction: reject_non_fqdn_hostname

zimbraMtaRestriction: reject_non_fqdn_sender
Are these different attributes? I assume case matters?

A convenience in case you can't keep MTA vs Mta straight?
Finally, how does 'zmprov mcf zimbraMtaRestriction '' ' know which

restriction to stop? All of them? Ugh.
Thanks.
Mike Carifio
Posts: 19
Joined: Fri Sep 12, 2014 10:02 pm

How do I "unset" a zimbraMTARestriction

Post by Mike Carifio »

I realized I was an adult and could help myself, at least a little bit.
zmprov mcf zimbraMtaRestriction '' appears to wipe out the list (i.e. all) of restrictions. I guess this makes some sense.
I wrote this script for myself to set the restrictions I want:
#!/bin/bash
# dump existing restrictions just in case

/opt/zimbra/bin/zmprov gcf zimbraMtaRestriction > $0.before
# start clean

/opt/zimbra/bin/zmprov mcf zimbraMtaRestriction ''
# assert your restrictions

/opt/zimbra/bin/zmprov mcf

zimbraMtaRestriction "reject_rbl_client dnsbl.njabl.org"

zimbraMtaRestriction "reject_rbl_client opm.blitzed.org"

zimbraMtaRestriction "reject_rbl_client relays.ordb.org"

zimbraMtaRestriction "reject_rbl_client cbl.abuseat.org"

zimbraMtaRestriction "reject_rbl_client bl.spamcop.net"

zimbraMtaRestriction "reject_rbl_client dnsbl.sorbs.net"

zimbraMtaRestriction "reject_rbl_client sbl.spamhaus.org"

zimbraMtaRestriction "reject_rbl_client relays.mail-abuse.org"

zimbraMtaRestriction "reject_invalid_hostname"

zimbraMtaRestriction "reject_non_fqdn_sender"

zimbraMtaRestriction "reject_non_fqdn_hostname"


# whadya get?

/opt/zimbra/bin/zmprov gcf zimbraMtaRestriction
bobby
Outstanding Member
Outstanding Member
Posts: 515
Joined: Fri Sep 12, 2014 10:01 pm

How do I "unset" a zimbraMTARestriction

Post by bobby »

see this post about entering your settings from a file like this:

zmprov
marcmac
Elite member
Elite member
Posts: 2091
Joined: Fri Sep 12, 2014 9:53 pm

How do I "unset" a zimbraMTARestriction

Post by marcmac »

In general, for multi-valued attributes, you have 3 choices. In all cases, case matters (for both attribute names and values)
You can set all of the values at once:

zmprov mcf attrName value1 attrName value2 attrName value3
Or you can modify them this way:
zmprov mcf +attrName new_value
Will add new_value to the list for attrName
likewise,

zmprov mcf -attrName remove_value
will remove the value.
You can mix and match +/-attrName on one line:

zmprov mcf +attrName add_value -attrName remove_value
but you CANNOT mix +/- with setting:

zmprov mcf +attrName add_value -attrName remove_value attrName set_value
that will kick out an error.
Have fun :)
bobby
Outstanding Member
Outstanding Member
Posts: 515
Joined: Fri Sep 12, 2014 10:01 pm

How do I "unset" a zimbraMTARestriction

Post by bobby »

thanks marc :o
Post Reply