Debugging the OpenEMM Bounce Handling Setup

The following is a short summary of things to configure to get OpenEMM bounce handling to work. The problem is mostly setting up the connection from your sendmail setup, through the milter plugin provided by OpenEMM which then communicates with another daemon "bavd" which as I understand it keeps per mail address statistics and writes the bounce results into the DB.

The things that can be the cause for problems are these:

  1. Your sendmail setup.
  2. The bav* python scripts not working.
  3. The bavd daemon not running/working.
  4. DB access not working
  5. Missing bounce filter in OpenEMM.
  6. Missing bounce alias in bav config.

The real good thing is that OpenEMM is so very well documented that you just need to lookup the simple how to documentation and everything will work within 5min... Sorry just kidding! They seem to want to make money on books and support and somehow don't write documentation and rely on endless forum posts of clueless users.

Enough of a rant below you find some hints how to workaround the problem causes I mentioned above:

Setup Preconditions:

  1. Within OpenEMM a bounce filter has to be configured. Name and description do not matter, it just needs to exist.
  2. The sendmail setup must have milter running the OpenEMM "bav" filter. So /etc/mail/ should have a line like
    INPUT_MAIL_FILTER(`bav', `S=unix:/var/run/bav.sock, F=T')dnl
  3. The sendmail log (e.g. /var/log/mail.log) must be readable by your OpenEMM user


  1. Define mail alias matching the bounce filter: Edit your bav.conf-local (e.g.
    /etc/openemm/conf/bav/bav.conf-local) and add something like
    [email protected] alias:[email protected]

    with "ext_6" being the sender address and ext_12 the bounce filter address.

Check List:

  1. Ensure the "bavd" daemon is running (its log file can be found in /var/log/*-<host>-bavd.log)
    • Ensure bavd server port 5166 is open
    • Ensure mails are passed to bavd (look for "scanMessage" lines in log file)
    • Ensure both soft and hard bounces are found (DSN 4.x.x and DSN 5.x.x)
  2. Ensure the bav filter is running. Check "ps -ef" output for "bav -L INFO"
  3. Ensure bounces are set your OpenEMM DB instance:
    select count(*) from customer_1_binding_tbl where user_status=2;

    The meaning of the user_status value is as following:

    Value Meaning
    1 active
    2 hard bounce
    3 opt out by admin
    4 opt out by user

    (see OpenEMM Handbuch)

    Also remember that hard bounces might not be generated immediately. In case of soft bounces OpenEMM waits for up to 7 bounces to consider the mail address as bounced.


How to make sure that mails are getting thru bavd


Very good article. Just one question
"Ensure mails are passed to bavd (look for "scanMessage" lines in log file)"
Where to look for its configuration. I have checked everything else according to checklist and its seems in place.
Problem is that my maillog shows "unknown user" when i send a "bounced" message back to sender's address..

/home/openemm/conf/bav/bav.conf-local -> [email protected] alias:[email protected]

I am running OpenEMM on CentOS5.
Please guide me for this issue.
Thanking in advance.


Which logfile?

I have the same problem as Mani, I do not know which logfile you mean. I looken into the OpenEMM-Logs and sendmail's maillog, but could noc find an "scanMessage" line. What is going wron, where should I search for scanMessage?


SQL Syntax?


First of all sorry for ma english, I'm an Austrian! ;-)

I have a problem with my Bounces:
When I type

select count(*) from customer_1_binding_tbl where user_status=2;

to check my Hardbounces, I get an Error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database customer_1_binding_tbl
select count(*) from customer_1_binding_tbl wher' at line 1

mysql Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1

I don't know what to do, please help, I think the Syntax is right....

RE: SQL Syntax?

I'd guess there is a copy and paste error. Try retyping the query by hand. It should work fine.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

To prevent automated spam submissions leave this field empty.
Syndicate content