https://wiki.zimbra.com/api.php?action=feedcontributions&user=Jbhewitt&feedformat=atomZimbra :: Tech Center - User contributions [en]2024-03-29T08:27:08ZUser contributionsMediaWiki 1.39.0https://wiki.zimbra.com/index.php?title=Configuring_Postfix_to_work_with_piped_scripts&diff=10779Configuring Postfix to work with piped scripts2008-09-23T05:56:07Z<p>Jbhewitt: changed to make the transport_maps work - not sure how else to do this</p>
<hr />
<div>== Background ==<br />
<br />
Many users of Zimbra may want to integrate Request Tracker (RT) or Mailman, both of which are typically configured by executing scripts from /etc/aliases. With Zimbra 5, /etc/aliases appears to be mostly ignored and therefore cannot be used. This wiki entry is based on a trick that was figured out in [http://www.zimbra.com/forums/installation/2859-aliases-scripts.html this forum post.]<br />
<br />
== Steps for integrating RT ==<br />
<br />
'''1. Configure the Postfix main.cf to handle an additional transport map'''<br />
Execute the following command:<br />
<br />
zmlocalconfig -e postfix_transport_maps=' hash:/opt/zimbra/postfix/conf/transport,ldap:/opt/zimbra/conf/ldap-transport.cf'<br />
<br />
This will add /opt/zimbra/postfix/conf/transport as an additional transport map.<br />
<br />
<br />
'''2. Create the transport map'''<br />
<br />
Edit /opt/zimbra/postfix/conf/transport and place the following lines at the top:<br />
<br />
# Pipe transports for RT queues<br />
# YOU HAVE TO ADD THE PIPES TO /opt/zimbra/postfix/conf/master.cf if you want them to work!!!<br />
rt@example.com rt-pipe<br />
rt-comment@example.com rt-comment-pipe<br />
<br />
<br />
And then create the transport db by executing (as zimbra)<br />
<br />
postmap /opt/zimbra/postfix/conf/transport<br />
<br />
<br />
<br />
'''3. Define the pipe transports'''<br />
<br />
The transport definitions 'rt-pipe' and 'rt-comment-pipe' must now be defined. Edit /opt/zimbra/postfix/conf/master.cf and add the following lines to the end of the file:<br />
<br />
rt-pipe unix - n n - - pipe<br />
flags= user=www argv=/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://rt.example.com/<br />
rt-comment-pipe unix - n n - - pipe<br />
flags= user=www argv=/opt/rt3/bin/rt-mailgate --queue general --action comment --url https://rt.example.com/<br />
<br />
Note that the 2nd line needs to be right under the first and must start with whitespace. Also make sure the user= line is pointing to a valid user with permissions to execute the script.<br />
<br />
<br />
'''4. Restart Postfix and test'''<br />
<br />
Execute the following commands:<br />
<br />
zmmtactl stop ; zmmtactl start<br />
<br />
Now, you should be able to email rt@example.com and receive a message back. grep for RT in /var/log/messages as well as tail /var/log/mail to watch for errors.</div>Jbhewitthttps://wiki.zimbra.com/index.php?title=Zmmailbox&diff=8039Zmmailbox2008-02-19T05:21:56Z<p>Jbhewitt: /* Creating Folder Mount Point for Shared Folders */</p>
<hr />
<div>== Intro ==<br />
<br />
zmmailbox requires version 4.0 of the zcs or better<br />
== Command Usage ==<br />
zmmailbox [args] [cmd] [cmd-args ...]<br />
<br />
-h/--help display usage<br />
-f/--file use file as input stream<br />
-u/--url http[s]://{host}[:{port}] server hostname and optional port. must use admin port with -z/-a<br />
-a/--admin {name} admin account name to auth as<br />
-z/--zadmin use zimbra admin name/password from localconfig for admin/password<br />
-m/--mailbox {name} mailbox to open<br />
-p/--password {pass} password for admin account and/or mailbox<br />
-P/--passfile {file} read password from file<br />
-v/--verbose verbose mode (dumps full exception stack trace)<br />
-d/--debug debug mode (dumps SOAP messages)<br />
<br />
zmmailbox is used for mailbox management. Try:<br />
<br />
zmmailbox help admin help on admin-related commands<br />
zmmailbox help account help on account-related commands<br />
zmmailbox help commands help on all commands<br />
zmmailbox help contact help on contact-related commands<br />
zmmailbox help conversation help on conversation-related commands<br />
zmmailbox help folder help on folder-related commands<br />
zmmailbox help item help on item-related commands<br />
zmmailbox help message help on message-related commands<br />
zmmailbox help misc help on misc commands<br />
zmmailbox help search help on search-related commands<br />
zmmailbox help tag help on tag-related commands<br />
<br />
== Examples ==<br />
<br />
=== Determining Mailbox Size ===<br />
To find the mailbox size for ''user@domain.com''<br />
zmmailbox -z -m user@domain.com gms<br />
<br />
You can also get this from zmprov, per server:<br />
zmprov gqu `zmhostname`|awk {'print " "$3" "$2" "$1'}<br />
<br />
=== Creating Folder Mount Point for Shared Folders ===<br />
Folder mount points for shared folders can be created on the command line to be accessed in the web interface. Currently, the mount points are not downloaded by the ZCO or iSync connectors and therefore must be designated manually in your 3rd party mail client, i.e., Outlook.<br />
<br />
In this example, the administrator wishes to designate a mount point to ''alice@domain.com'' for the shared marketing calendar located in the ''marketing@domain.com'' account for which she will have read/write permissions.<br />
<br />
$ zmmailbox<br />
mbox> adminAuthenticate -u <nowiki>https://server.domain.com:7071</nowiki> admin@domain.com password <br />
mbox> selectMailbox marketing@domain.com<br />
mailbox: marketing@domain.com, size: 100.12 MB, messages: 1010, unread: 11<br />
mbox marketing@domain.com> getAllFolders<br />
Id View Unread Msg Count Path<br />
---------- ---- ---------- ---------- ----------<br />
1 conv 0 0 /<br />
10 appo 0 0 /Calendar<br />
14 mess 0 0 /Chats<br />
7 cont 0 0 /Contacts<br />
720 mess 0 0 /Deleted Messages<br />
6 mess 0 0 /Drafts<br />
2 mess 11 1010 /Inbox<br />
901 conv 0 0 /Journal<br />
4 mess 0 0 /Junk<br />
12 wiki 0 0 /Notebook<br />
900 conv 0 0 /Outbox<br />
5 mess 0 0 /Sent<br />
15 task 0 0 /Tasks<br />
3 conv 0 0 /Trash<br />
<br />
mbox marketing@domain.com> getFolderGrant /Calendar<br />
Inherit Permissions Type Display<br />
------- ----------- ------ -------<br />
false rwidx accoun null <br />
mbox marketing@domain.com> modifyFolderGrant /Calendar account alice@domain.com rw<br />
<br />
mbox marketing@domain.com> gfg /Calendar<br />
Inherit Permissions Type Display<br />
------- ----------- ------ -------<br />
false rwidx accoun null <br />
false rw accoun alice@domain.com<br />
<br />
mbox marketing@domain.com> selectMailbox alice@domain.com<br />
mailbox: alice@domain.com, size: 251.32 MB, messages: 1543, unread: 314<br />
<br />
mbox alice@domain.com> createMountpoint --view appointment /marketing-calendar marketing@domain.com /Calendar<br />
2342<br />
<br />
It does not appear to be documented anywhere, but the following command line options will perform the equivalent action to a user "albert" sharing their Calendar to another user "brian" from the GUI:<br />
<br />
zmmailbox -z -m albert@example.com mfg -i /Calendar account brian@example.com none "Permission: None"<br />
zmmailbox -z -m albert@example.com mfg -i /Calendar account brian@example.com r "Permission: Viewer"<br />
zmmailbox -z -m albert@example.com mfg -i /Calendar account brian@example.com rwidx "Permission: Manager"<br />
Note that the last option uses "rwidx", not just "rw".<br />
<br />
Also note that you can share an entire mailbox by just having the / folder. So to share an entire persons folder...<br />
zmmailbox -z -m albert@example.com mfg / account brian@example.com r "Permission: Viewer"<br />
[[Category:Command Line Interface]]</div>Jbhewitt