Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-2011, 02:04 PM
Special Member
 
Posts: 138
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
__________________
Type su - zimbra -c "zmcontrol -v" to get your version and copy that into your profile (more info here)

Last edited by LHammonds; 12-02-2011 at 07:12 AM..
Reply With Quote
  #2 (permalink)  
Old 12-02-2011, 02:12 AM
Advanced Member
 
Posts: 206
Default

Hi, take a look Send mail through Zimbra with sendmail

Regards.
Reply With Quote
  #3 (permalink)  
Old 12-02-2011, 07:12 AM
Special Member
 
Posts: 138
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
__________________
Type su - zimbra -c "zmcontrol -v" to get your version and copy that into your profile (more info here)

Last edited by LHammonds; 12-19-2011 at 10:46 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.