1

I am an experienced Exim user and just recently testing Zimbra Open Source, and I am loving it already.

However, I am used to this command whenever I wanted to test email routing in the email server, whether I am testing for the routing of local users, local email addresses and external email addresses:

root@localhost# exim -bt [email protected]
[email protected]
    <-- [email protected]
  router = localuser, transport = local_delivery

root@localhost# exim -bt [email protected]
[email protected]
  router = localuser, transport = local_delivery

root@localhost# exim -bt [email protected]
  router = lookuphost, transport = remote_smtp
  host mail.remotehost.com [1.2.3.4] MX=0

Got the above cheatsheet years ago from http://bradthemad.org/tech/notes/exim_cheatsheet.php.

How can I do this with Zimbra/Postfix? I am searching everywhere on how to do this, but couldn't found any.

Thanks!

3 Answers 3

2

Try this command

/usr/sbin/sendmail -bv address.

sendmail binary from postfix has special options -bv

-bv    Do not collect or deliver a  message.  Instead,  send  an  email
       report  after  verifying each recipient address.  This is useful
       for testing address rewriting and routing configurations.

This command also can be found in postfix documentation:

Excerpt from the page

Postfix version 2.1 and later can produce mail delivery reports for debugging purposes. These reports not only show sender/recipient addresses after address rewriting and alias expansion or forwarding, they also show information about delivery to mailbox, delivery to non-Postfix command, responses from remote SMTP servers, and so on.

Unlike utility from exim which give result in the stdout, postfix will send the report to user who invoke above command. Also zimbra will place sendmail binary in its unusual directory, so you must invoke it by issuing the full path command.

/opt/zimbra/postfix/sbin/sendmail -bv address
2
  • This works great, however, since I can't receive local emails, I am just checking the result in /var/log/maillog. Exim's way is much cleaner, but this command works well. Thanks!
    – James A
    May 30, 2016 at 21:06
  • 1
    You can create two symlinks on your system to enable local mail: ln -s /opt/zimbra/postfix/sbin/sendmail /usr/sbin/sendmail and ln -s /opt/zimbra/postfix/sbin/sendmail /usr/lib/sendmail Jun 1, 2016 at 12:48
1

Zimbra uses postfix for delivering the mail to external addresses. So you can use a lot of the commands on http://www.postfix.org/DEBUG_README.html

For example. Log in as the zimbra user and the command to give you a delivery report on a specific destination would be:

sendmail -bv [email protected]

The result will be sent to the zimbra user, so you need to have the zimbra@ mail address configured in your system, for example as an alias on your own account.

3
  • I tried it, however it doesn't work with my zimbra server - sendmail: fatal: unsupported: -bt
    – James A
    May 30, 2016 at 16:22
  • Looks like sendmail -bt only works for original sendmail program, not specific sendmail provided by postfix.
    – masegaloeh
    May 30, 2016 at 19:28
  • My mistake, should be sendmail -bv May 31, 2016 at 7:58
0

you can use telnet or sendmail commands from the zimbra user and keep checking the log output (/var/log/mail.log).

1
  • Okay so I assume there's no faster way to do this, just like how I can do it in Exim? Without actually sending an email to the intended recipients? I prefer the Exim way because it doesn't actually sends the email, and I can debug the routing issues without the destination email noticing anything.
    – James A
    May 29, 2016 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .