postfix discard

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
five04tluv
Posts: 6
Joined: Tue Sep 01, 2015 3:45 pm

postfix discard

Post by five04tluv »

I've been using postfix_custom_header_checks to discard emails to certain users. Unfortunately this discards the ENTIRE message. I see that in postfix I would need to use transport_maps to

Code: Select all

/etc/postfix/main.cf: 
    transport_maps = hash:/etc/postfix/transport 

/etc/postfix/transport: 
    someuser@domain.com	discard:
    someuser2@domain.com discard:
How do I do this the Zimbra way?

current postconf transport_map usage

address_verify_transport_maps = $transport_maps
transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf (which does LDAP lookup for destination mail server for user)
User avatar
fs.schmidt
Outstanding Member
Outstanding Member
Posts: 278
Joined: Sat Sep 13, 2014 3:37 am
Location: Brazil
Contact:

Re: postfix discard

Post by fs.schmidt »

Hello,

Please see the following steps to use tranport_maps in Zimbra (I've tested it in 8.7 and 8.8):

su - zimbra

vim /opt/zimbra/postfix/conf/transportfile

(edit the file with your discard rules)

zmprov mcf zimbraMtaTransportMaps "lmdb:/opt/zimbra/postfix/conf/transportfile,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf"
five04tluv
Posts: 6
Joined: Tue Sep 01, 2015 3:45 pm

Re: postfix discard

Post by five04tluv »

I'm on NE 8.7.11, I don't have a dir /opt/zimbra/postfix and I don't see any mention of this in the Admin Docs.
User avatar
fs.schmidt
Outstanding Member
Outstanding Member
Posts: 278
Joined: Sat Sep 13, 2014 3:37 am
Location: Brazil
Contact:

Re: postfix discard

Post by fs.schmidt »

Hi,

The correct path is: /opt/zimbra/conf/

So the steps would be:

vim /opt/zimbra/conf/transportfile

(insert your discard rules)

postmap /opt/zimbra/conf/transportfile

zmprov mcf zimbraMtaTransportMaps "lmdb:/opt/zimbra/conf/transportfile,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf"

Postfix will reload with the new rules within a few minutes, but you can force the reload with "postfix reload"
User avatar
DavidMerrill
Advanced member
Advanced member
Posts: 126
Joined: Thu Jul 30, 2015 2:44 pm
Location: Portland, ME
ZCS/ZD Version: 8.8.15 P19
Contact:

Re: postfix discard

Post by DavidMerrill »

This was super-helpful yesterday, thanks for sharing!
___________________________________
David Merrill - Zimbra Practice Lead
OTELCO Zimbra Hosting, Licensing and Professional Services
Zeta Alliance
Post Reply