Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Aliases to Scripts

  1. #1
    Join Date
    Oct 2005
    Posts
    16
    Rep Power
    10

    Default Aliases to Scripts

    We utilize RT at our site and I am curious how do I configure my aliases that run scripts. Currently, the alias looks something like (in /etc/aliases):

    rt: "|/usr/bin/rt-mailgate --queue General --action correspond --url http://fileserver/rt"

    How would I configure the same alias in Zimbra?

    Thanks,
    Justin

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    We currently don't support procmail or scripts that can run against an alias. One idea would be to forward these to a separate process to be processed by procmail.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    If you think it's something you need then please file it in bugzilla.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  4. #4
    Join Date
    Oct 2005
    Posts
    16
    Rep Power
    10

    Default

    I will file it in Bugzilla and try to figure a workaround in the interim. Thank you for the quick response. I have to say, you guys rock!

    Justin

    Quote Originally Posted by KevinH
    If you think it's something you need then please file it in bugzilla.

  5. #5
    Join Date
    May 2006
    Posts
    1
    Rep Power
    9

    Default RT and Zimbra

    I added my servers IP to the mynetworks section of the master.cf and then sent to rt@servername.domain.org and it works. I did have problems when server IP was first in list but when I put -o mynetworks=127.0.0.0/8,serverIP and commented out -o mynetworks_style=host ticket creation works great.

  6. #6
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    Would be great if you can document this and post it to the wiki for others.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  7. #7
    Join Date
    May 2006
    Posts
    33
    Rep Power
    9

    Default

    Through a search I found this thread. I also need to send a mail using pipe/alias like so:

    support: root,|/path/to/automail.pl

    I'm using something similar to RT called eTicket. This lets the ticket system receive incoming mail and create new tickets. I believe it is identical to RT.

    Anyway, I did not quite understand the solution. Can someone tell me which master.cf file I need to update and a more detailed explanation on how to get this to work? I was looking in /opt/zimbra/postfix-2.2.9/conf/master.cf and did not want to screw this file up in the middle of the day on an active mail server.

    I just don't understand the complete solution. I've tried simply adding my alias to /opt/zimbra/postfix-2.2.9/conf/aliases and running /opt/zimbra/postfix-2.2.9/sbin/newaliases but when sending the mail to my alias it gets returned.

    Anyway I'd appreciate it if anyone could provide some more detail on this for someone who has never had to mess with sendmail/postfix configurations before.

    EDIT: My Zimbra on an RHEL 4 server:
    Release 4.0.5_GA_518.RHEL4_20061218051343 RHEL4 FOSS edition

  8. #8
    Join Date
    May 2006
    Posts
    33
    Rep Power
    9

    Default

    Okay I think I"m going to add this to the wiki since this really helped me. Mike's solution works.

    I'll update with the full solution sometime today or tomorrow.

    Scratch that, here ya go:
    http://wiki.zimbra.com/index.php?tit...lias_To_Script
    Last edited by Jazzhands; 01-25-2007 at 01:19 PM.

  9. #9
    Join Date
    Dec 2007
    Location
    Portland, OR
    Posts
    7
    Rep Power
    8

    Default

    Hi,

    I'd like to reopen this as the solution doesn't take into account multiple domains (you'd have to send a message to user@mail.domain.com (the zimbra server hostname) to get it to work).

    Now, on my test setup I'm trying to have RT (request tracker) and ZCS co-exist on the same server.

    Messages sent into RT would go into rt_test1@domain-x.com's mailbox, and I would run fetchmail on a 1-minute cronjob to pull them into rt-mailgate. This 1-minute delay isn't too acceptable, especially with a pipe/alias option being so much better.

    Messages coming from RT would pipe so the Zimbra Postfix sendmail compatibility program, which is /opt/zimbra/postfix/sbin/sendmail in my environment.

    With this situation, I was only able to hit the aliases file for non-virtual (postfix terminology) domains, meaning localhost. For virtual aliases, it's a different story in postfix, and this variable is used:

    virtual_alias_maps = ldap:/opt/zimbra/conf/ldap-vam.cf

    That's a lookup to the zimbra alias database, naturally. However since we can't add pipes to this database through the admin UI (and the postfix virtual alias table format doesn't support pipes either), we're pretty much stuck...unless we do this:

    transport_maps = hash:/opt/zimbra/postfix/conf/transport,ldap:/opt/zimbra/conf/ldap-transport.cf

    with the transport file containing:

    rt_trans@domain-x.com rt-pipe

    and don't forget to run postmap on the transport file to compile it.


    OK, so far we've created an "alias" which will point to a postfix named pipe transport, in this case 'rt-pipe'. We need to define that transport now. Open up master.cf and add:

    rt-pipe unix - n n - - pipe
    flags= user=rt argv=/opt/rt3/bin/rt-mailgate --url http://zimrtdev:8001 --queue General --action correspond

    note 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.

    now save the file and run postfix reload:

    /opt/zimbra/postfix/sbin/postfix reload

    and tail -f /var/log/maillog to watch for errors as you test the first address.

    NOTE: if you are using multiple queues with RT you may want to look into either a) creating multiple transports (messy) or b) using pipe macros (man 8 pipe) in the transport options for queue, sourced from the local-part of the email address (say, support-asia@domain-x.com goes to support-asia queue by using the ${user} macro).

    ----
    This probably isn't as clear and coherent as it could be, but it works for me.
    Last edited by drj33; 06-10-2008 at 05:27 PM.

  10. #10
    Join Date
    Apr 2008
    Location
    Portland, OR
    Posts
    14
    Rep Power
    7

    Default

    Hurray, drj33's response seems to be the first solution that works nicely with Zimbra 5. I'm sure you'll void your warranty by doing this, but voiding your warranty is *SO MUCH FUN*

    However, it is missing one step: the changes specified below to main.cf would be lost at the next mta restart. The correct way to make the 'transport_maps' changes to stick is like so:

    Code:
    zmlocalconfig -e postfix_transport_maps='hash:${zimbra_home}/postfix/conf/transport,ldap:${zimbra_home}/conf/ldap-transport.cf'
    To simulate a full restart with all of Zimbra's config-overwriting glory, 'postfix reload' won't cut it, instead:

    Code:
    zmmtactl stop ; zmmtactl start
    WARNING: The file changes (master.cf,transport) will be lost when you upgrade Zimbra, even by micro releases (5.0.7 to 5.0.8).

    Zimbra developers: It would be awesome if we could have a permament and supported solution for custom transport maps, at minimum. Going the extra mile, easy integration of Request Tracker and Mailman seem like something that a lot of people want.

Similar Threads

  1. Zimbra aliases verses Exim aliases
    By mond in forum Administrators
    Replies: 5
    Last Post: 01-04-2011, 08:12 AM
  2. Same user and aliases on multiple domains
    By wiscalico in forum Administrators
    Replies: 1
    Last Post: 08-01-2007, 03:37 AM
  3. Offsite Aliases, Multi-Recipient Aliases
    By dballing in forum Administrators
    Replies: 8
    Last Post: 07-30-2007, 08:11 AM
  4. Hiding Aliases - Zimbra Web Client
    By soxfan in forum Administrators
    Replies: 0
    Last Post: 03-13-2007, 06:39 PM
  5. Incorrect Aliases Display?
    By sduensin in forum Administrators
    Replies: 3
    Last Post: 03-07-2006, 12:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •