Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Postfix Documentation
Previous Page Home Next Page


Content filters may break domain key etc. signatures. If you use an SMTP-based content filter, then you should add a line to with "-o disable_mime_output_conversion=yes" (note: no spaces around the "="), as described in the advanced content filter example.

Sendmail Milter applications were originally developed for the Sendmail version 8 MTA, which has a different architecture than Postfix. The result is that some Milter applications make assumptions that aren't true in a Postfix environment.

  • Some Milter applications use the "{if_addr}" macro to recognize local mail; this macro does not exist in Postfix. Workaround: use the "{client_addr}" macro instead.

  • Some Milter applications log a warning that looks like this:

    sid-filter[36540]: WARNING: sendmail symbol 'i' not available

    And they may insert a message header with "unknown-msgid" like this:

    X-SenderID: Sendmail Sender-ID Filter vx.y.z <unknown-msgid>

    This happens because some Milter applications expect that the queue ID is known before the MTA accepts the MAIL FROM (sender) command. Postfix, on the other hand, does not choose a queue file name until after it accepts the first valid RCPT TO (recipient) command. Postfix queue file names must be unique across multiple directories, so the name can't be chosen before the file is created. If multiple messages were to use the same queue ID simultaneously, mail would be lost.

    To work around the ugly message header from Milter applications, we add a little code to the Milter source to look up the queue ID after Postfix receives the end of the message.

    • Edit the filter source file (typically named dk-filter/dk-filter.c or similar).

    • Look up the mlfi_eom() function and add code near the top shown as bold text below:

    dfc = cc->cctx_msg;
    assert(dfc != NULL);
    /* Determine the job ID for logging. */
    if (dfc->mctx_jobid == 0 || strcmp(dfc->mctx_jobid, JOBIDUNKNOWN) == 0) {
            char *jobid = smfi_getsymval(ctx, "i");
            if (jobid != 0)
                    dfc->mctx_jobid = jobid;
    /* get hostname; used in the X header and in new MIME boundaries */


    • Different mail filters use slightly different names for variables. If the above code does not compile, look for the code at the start of the mlfi_eoh() routine.

    • This fixes only the ugly message header, but not the WARNING message. Fortunately, dk-filter logs that message only once.

    With some Milter applications we can fix both the WARNING and the "unknown-msgid" by postponing the call of mlfi_eoh() (or whatever routine logs the WARNING) until the end of the message.

    • Edit the filter source file (typically named sid-filter/sid-filter.c or similar).

    • Look up the smfilter table and replace mlfi_eoh (or whatever routine logs the WARNING) by NULL.

    • Look up the mlfi_eom() function and add code near the top that calls mlfi_eoh() as shown by the bold text below:

            assert(ctx != NULL);
    #endif /* !DEBUG */
            ret = mlfi_eoh(ctx);
            if (ret != SMFIS_CONTINUE)
                    return ret;

    This works with sid-milter-0.2.10. Other Milter applications will dump core when you do this.

Postfix Documentation
Previous Page Home Next Page