Results 1 to 3 of 3

Thread: Ubuntu servers sending mail to Zimbra server...How?

  1. #1
    Join Date
    Sep 2011
    Location
    Texas
    Posts
    150
    Rep Power
    4

    Question [SOLVED] Ubuntu servers sending mail to Zimbra server...How?

    I have Zimbra 7.1.3 OSE installed and working on Ubuntu Server 10.04.3 LTS.

    I just added another Ubuntu 10.04.3 LTS server running other applications (not associated to Zimbra apps)

    I'd like to write automation scripts for this 2nd Ubuntu server and utilize email notification...the targets of which would be accounts on the Zimbra server.

    How would I go about configuring the 2nd Ubuntu server so that Bash scripts could fire off emails to my Zimbra users? There would be absolutely no need for inbound email on this server. Just a fire-and-forget ability.

    I've looked around but cannot seem to find what I am looking to accomplish.

    Any pointers in the right direction, or keywords I should be searching for would be helpful.

    Thanks,
    LHammonds
    Last edited by LHammonds; 12-02-2011 at 07:12 AM.
    Type su - zimbra -c "zmcontrol -v" to get your version and copy that into your profile (more info here)

  2. #2
    Join Date
    Jun 2011
    Location
    Caracas Venezuela
    Posts
    476
    Rep Power
    4

  3. #3
    Join Date
    Sep 2011
    Location
    Texas
    Posts
    150
    Rep Power
    4

    Default

    Ah ha! Thanks. That works perfectly and with zero setup tinkering!

    For anyone wanting to do this, here is how:

    On your Ubuntu server, type the following as the root user:

    Code:
    aptitude -y install sendemail
    To see if it works, type the following:
    Code:
    sendemail -f root@myserver -t MyTargetAddress@MyDomain.com -u "This is the Subject" -m "This is the body of the email" -s 192.168.107.14:25
    The IP address should be your Zimbra server, and port 25 is the default so you don't need to specify if that is what it is, but if not, this is how you do.

    Typing "which sendemail" shows that the program is installed to /usr/bin/sendemail which is in the default path and should work in the crontab scheduler...if not, you can either use the full path or add the path environment in the cron schedule itself.

    Script example:
    Code:
    ## Obtain the full path to sendemail. ##
    SENDEMAIL=$(which sendemail)
    
    ## Setup variables. ##
    FROMADDR="root@myserver"
    TOADDR="webmaster@mydomain.com;administrator@mydomain.com;backup@mydomain.com"
    EMAILSERVER="192.168.107.14"
    EMAILPORT="25"
    
    ## Send an email. ##
    ${SENDEMAIL} -f ${FROMADDR} -t ${TOADDR} -u "Test Subject" -m "This is a test.\nThis is the 2nd line\nThis is the 3rd line" -s ${EMAILSERVER}:${EMAILPORT}
    LHammonds
    Last edited by LHammonds; 12-19-2011 at 10:46 AM.
    Type su - zimbra -c "zmcontrol -v" to get your version and copy that into your profile (more info here)

Similar Threads

  1. Replies: 39
    Last Post: 09-04-2012, 11:18 PM
  2. Replies: 8
    Last Post: 04-10-2011, 09:14 AM
  3. Issues...
    By timothyalangorman in forum Administrators
    Replies: 3
    Last Post: 11-19-2007, 09:43 AM
  4. fresh install down may be due to tomcat
    By gon in forum Installation
    Replies: 10
    Last Post: 07-25-2007, 08:09 AM
  5. Seeming variety of problems on suse-9.1
    By Crexis in forum Installation
    Replies: 52
    Last Post: 03-03-2006, 11:19 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
  •