Jump to content

Qmail Archiving

From TetraWiki
Revision as of 10:48, 10 July 2014 by Biswajit (talk | contribs) (Step 2: Recompile Qmail)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Qmail with Openldap Archiving (Copying an email of incomming and outgonig mails)[edit]

Qmail Archiving Incoming and Outgoing Emails Directly

In addition to delivering the messages to their respective user mailboxes, it is recommended to have Qmail send a copy of all emails to an archiving mailbox when archiving incoming and outgoing emails directly. This requires certain changes to be made before compiling the Qmail source code. The following guide is an adapted version of the article "Life with Qmail FAQ":


Step 1: Edit extra.h[edit]

QUEUE_EXTRA is a compile-time configuration variable that specifies an additional recipient that will be added to every delivery. This is used primarily for logging; the FAQ describes how to use QUEUE_EXTRA to keep copies of all incoming and outgoing messages.

To use QUEUE_EXTRA, edit extra.h specifying the additional recipient in the format Trecipient\0, and the length of the QUEUE_EXTRA string in

  1. vim /usr/src/qmail/qmail-1.0.3/extra.h
  1. define QUEUE_EXTRA "Tlogall\0"
  2. define QUEUE_EXTRALEN 8


Step 2: Recompile Qmail[edit]

Shut down Qmail if it's running. If you installed the qmailctl script from the Installation section, this can be done by:

#qmailctl stop
# vim /etc/inittab ; init q
#SV:123456:respawn:/command/svscanboot

Step 3: Recompiling qmail server[edit]

Go to the source code directory of the Qmail installation and rebuild Qmail using:

  1. make setup check


Step 4:-- ldap entry for incoming ang outgoging mail store[edit]

We have to mapped an email id with that receipent id that we had define in extra.h. After that all the incomming and outgoing mails will start saving in user's mailbox. We have to add recepient id as mailAlternateAddress like :--

dn: uid=logall,ou=energoindia.com,dc=energoindia,dc=com
mailHost: mail.energoindia.com
mailAlternateAddress: logall@mail.energoindia.com
objectClass: top
objectClass: inetOrgPerson
objectClass: qmailUser
cn: logall
sn: logall
mail: logall@energoindia.com
accountStatus: active
mailMessageStore: energoindia.com/logall
uid: logall
deliveryMode: noforward
userPassword:: e0NSWVBUfXA5R1NiVUVEeGlDUFU=

Step -5 Final confirmation checking logs[edit]

  1. tail -f /var/log/qmail/qmail-send/current | tai64nlocal

2014-06-06 11:42:21.755945500 info msg 21168597: bytes 431477 from <shankar.ivaturi@energoindia.com> qp 19258 uid 510 2014-06-06 11:42:21.755965500 starting delivery 8028: msg 21168597 to local logall@mail.energoindia.com 2014-06-06 11:42:21.755974500 status: local 1/10 remote 13/255 2014-06-06 11:42:21.755992500 starting delivery 8029: msg 21168597 to local kondawar.vivek@energoindia.com 2014-06-06 11:42:21.756000500 status: local 2/10 remote 13/255 2014-06-06 11:42:21.770408500 delivery 8028: success: did_1+0+0/ 2014-06-06 11:42:21.770426500 status: local 1/10 remote 13/255 2014-06-06 11:42:21.770451500 delivery 8029: success: did_1+0+0/ 2014-06-06 11:42:21.770498500 status: local 0/10 remote 13/255 2014-06-06 11:42:21.770527500 end msg 21168597


Refreances :- [1]