DeskNow Knowledge Base
 
      
Home Customization and Integration How to integrate DeskNow with Postfix

How to integrate DeskNow with Postfix

It is possible to integrate DeskNow with a Postfix SMTP server. This is useful if your system is already running on Postfix, and wish to create the least disruption possible to the service.

The fundamental concept to understand the integration process is this: Postfix can receive mail, and in its local delivery it can pass the messages to DeskNow. DeskNow will then process them (ingest) as if they were coming directly from outside.

Message passing between Postfix and DeskNow is very efficient, as DeskNow ingests emails directly in a MailDir format, which is one of the standard storage formats used by Postfix. The key to the process is simply to configure Postfix to store all incoming messages, for all the users into a single MailDir, and configure DeskNow to get all its incoming messages from there.

There are two main ways of integrating DeskNow with Postfix, and which way you use depends on your goals. In the first method, Postfix delivers incoming messages only to DeskNow. They are not delivered to any other system mailbox. This method is useful if you are using Postfix as MTA only, and want to do all the mail accessing (WebMail, POP3, etc) from within DeskNow. In this method, user administration can be very simple, as you only need to define virtual domains and user accounts in DeskNow, wherease Postfix can simply pass all incoming messages to DeskNow. In the second method, Postfix can keep delivering to system mail boxes (ex. the standard Unix mail spool) and deliver a copy of the emails to DeskNow.

IMPORTANT In any case, user accounts must be defined in DeskNow, otherwise it will not accept messages (which could very well be accpeted by Postfix according to its own rules and aliases).

Delivering incoming messages only to DeskNow

Important
: this requires Postfix 2.0 or later. Postfix 1.x will not work with this configuration.

  1. stop DeskNow if running
  2. edit /var/desknowdata/cfg/Mail.cfg
    1. set

      EmbeddedServer.SMTPDaemonPort   26

      This will make sure that DeskNow's internal SMTP server will not conflict with Postfix. You can alternatively disable the SMTP incoming service completely ( EmbeddedServer.useSMTPIn FALSE )
    2. Add the following lines:
      DirectIn.basePath   /var/spool/desknow/MailDir/new

      This tells DeskNow to get all its incoming messages from the folder /var/spool/desknow/MailDir/new

      DirectIn.RecipientPrefix "X-Original-To: "

      This tells DeskNow to use the Postfix specific header for catchall aliases.
    3. Set or uncomment the following lines:

      EmbeddedServer.SMTPForwardHost localhost
      EmbeddedServer.SMTPForwardPort 25

      This tells DeskNow to forward all outgoing traffic through Postfix


  3. edit /etc/postfix/main.cf and add the following lines:
    forward_path = /etc/postfix/dnforward

    This tells Postfix to use a specific forward file for all the incoming messages

    virtual_alias_domains = mydomain.com

    This tells Postfix to recognize mydomain.com as a virtual domain. Adjust to your virtual domains. if you have multiple virtual domains, separate them with a single space character.

    virtual_alias_maps = hash:/etc/postfix/virtual

    This tells Postfix where to look for virtual alias maps.
  4. create a file /etc/postfix/dnforward with a text editor, and add only this line (NB the trailing / is very important!):
    /var/spool/desknow/MailDir/

    This forward file tells Postfix to store all incoming emails into the directory specified, using the maildir format (new messages will be stored in the 'new' subfolders automatically, and that is where DeskNow will receive them)
  5. edit /etc/postfix/virtual and add the following line:
    @mydomain.com postfix

    This tells Postfix to direct all emails to @domain.com as if they were directed to the Unix postfix account. The dnforward rule will ensure that these emails will be directed to DeskNow's mail spool. If you have multiple domains, add a line for each fomain. The user is always postfix.
  6. give the following two commands:
    mkdir /var/spool/desknow
    chown postfix /var/spool/desknow


    This prepares the maildir and sets the user permissions
  7. make Postfix reload its settings:
    postmap /etc/postfix/virtual 
    postfix reload
  8. start DeskNow

Delivering a copy of all incoming messages to DeskNow

Postfix does not support multiple local delivery directly, but this can be easily obtained using Procmail, installed by default in many Linux distributions, and available for most Unix systems.

  1. stop DeskNow if running
  2. edit /var/desknowdata/cfg/Mail.cfg
    1. set

      EmbeddedServer.SMTPDaemonPort   26

      This will make sure that DeskNow's internal SMTP server will not conflict with Postfix. You can alternatively disable the SMTP incoming service completely ( EmbeddedServer.useSMTPIn FALSE )
    2. Add the following line:
      DirectIn.basePath   /var/spool/desknow/MailDir/new

      This tells DeskNow to get all its incoming messages from the folder /var/spool/desknow/MailDir/new
    3. Set or uncomment the following lines:

      EmbeddedServer.SMTPForwardHost localhost
      EmbeddedServer.SMTPForwardPort 25

      This tells DeskNow to forward all outgoing traffic through Postfix
  3. edit /etc/postfix/main.cf and add the following line:
    mailbox_command = /usr/bin/procmail -a $USER /etc/postfix/procmailrc

    This tells Postfix to pass incoming mails to procmail, using the given procmail configuration file, and passing the local username of the user whose messege is being received as first parameter
  4. create a new text file /etc/postfix/procmailrc with the following content:
    :0
    {
    #this is the first action. It delivers the message to DeskNow's incoming queue, and keeps a copy for the next action
    :0 c
    /var/spool/desknow/MailDir/
    #this action appends the email to the user's system mail spool (default Unix mail delivery)
    :0
    /var/spool/mail/$1
    }


    In this example the second Procmail action implements the standard Unix mail delivery. You can adjust it to suit your delivery requirements
  5. give the following two commands:
    mkdir /var/spool/desknow
    chown postfix /var/spool/desknow


    This prepares the maildir and sets the user permissions
  6. make Postfix reload its settings:
    postfix reload
  7. start DeskNow

 

Email Article Email
Print Article Print


How helpful was this article to you?
Related Articles
article How do I use DeskNow with SQL Server 2005 (Express or Enterprise) (DeskNow 3.1)?
These instructions apply only to DeskNow 3.1...

(No rating)  May 23, 2006    Views: 16874   
article How do I use DeskNow with IIS?
DeskNow can coexist with IIS in many ways....

  August 12, 2004    Views: 64307   
article How do I tell which database is used by DeskNow?
To find out which database you're using: open...

  May 1, 2006    Views: 18799   



Powered by Lore :: (c)2003 Pineapple Technologies.