Skip to Content

Bypass Host Resolution Issues For Inbound Mail

Posted in

Zimbra uses the LMTP protocol for inbound mailstore delivery. By default, Zimbra's Postfix MTA will use DNS for mailbox server host resolution. Use this tip to bypass DNS inbound delivery from the MTA to mailstore.

$ su - zimbra

Query the existing Postfix value
$ postconf lmtp_host_lookup
lmtp_host_lookup = dns

Edit /etc/hosts
10.1.1.1 mailstore.server.com

Modify main.cf
$ postconf -e lmtp_host_lookup=native

Update Zimbra's local configuration for upgrade persistence

Return-Path Header For Mail Coming From PHP's mail() Function

Posted in

By default, mail sent using the PHP mail() function will contain an envelope sender address consisting of the server's fully qualified domain name (FQDN). This can cause mail originating from apps like Drupal or MediaWiki that use PHP mail() for notifications to be filtered by mail servers rejecting sender domains not having an MX record.

Zimbra environment variable usage

Posted in

Release 5.0.9_GA_2533.UBUNTU6 UBUNTU6 NETWORK edition

You are becoming a more esteemed Zimbra admin, but are tired of manually fetching environment variables from zmlocalconfig. Simply put the values into your shell environment.

su - zimbra
source ~/bin/zmshutil
zmsetvars

Now you can run your ldapsearch command like this:
ldapsearch -x -H $ldap_master_url -D $zimbra_ldap_userdn -w $zimbra_ldap_password "(cn=*)"

The date command

Posted in

All values in "seconds" is the number of seconds from Epoch, Jan 1, 1970.

  1. Current time in seconds.
    date +%s
    1220815239
  2. Convert 1220815239 seconds to a human readable date.
    date -d @1220815239
    Sun Sep 7 15:20:39 EDT 2008
  3. Convert 1220815239687 milliseconds to a human readable date.
    date -d @$[1220815239687/1000]
    Sun Sep 7 15:20:39 EDT 2008

Increase Open File Limit On Red Hat

Posted in

At times, it is necessary to increase the number of open files for a particular service user. For example, if you see this in your MySQL .err log:

080723 2:41:04 [ERROR] Error in accept: Too many open files

To fix, increase the number of open files for your mysqld user. Mine is mysql.

Check the system's maximum open file limit

# cat /proc/sys/fs/file-max

If this value is too low, increase it

# echo 81920 > /proc/sys/fs/file-max

Now, edit /etc/security/limits.conf to increase limits for the mysql user

Recipes for tcpdump

Posted in

tcpdump is a great tool for protocol traffic analysis and troubleshooting. I'm sure by now you know you need it, but you just need to know how to effectively use it. This post will be updated ongoing.

Have a look here http://dmiessler.com/study/tcpdump_recipes/. You'll find some great tips on tcpdump and other things nix.

  1. man tcpdump
  2. tcpdump -AvvvSs 1500 -i eth0 host 10.10.10.1

Bash Loops

While

Counting to 3 and doing something along the way right on the command line.


# i=1; while [ "$i" -lt 4 ]; do echo $i; i=$(($i+1)); done
1
2
3

The same command in a script:

#!/bin/bash
i=0
while [ "$i" -lt 10 ]
do
   echo $i
   i=$(($i+1))
done

For

Iterate through lines in a file with a for loop on the command line.


# for a in $(cat /tmp/users); do echo $a; done
usera
userb

In a script:

#!/bin/bash
for a in $(cat /tmp/users)
do

Creating ISO Filesystems

ISO filesystems are helpful for creating disk images for burning CDs.

On Nix:

mkisofs /tmp/isoname.iso -R -V "Volume Name" /path/to/iso/dir



If you have a DMG file you would like to convert to an ISO, you might find this article helpful on macosxhints.com:

http://www.macosxhints.com/article.php?story=20040121135301830&query=dmg+to+iso

Drupal Attachments

Posted in

Here is how attachments show up in drupal. Anonymous users aren't going to see the attachment.

Syndicate content