Thursday, February 18, 2010

3. Postfix - Local Mail

Working Architecture of Postfix Local Mail
          When a msg is submitted by a local user on the system msgs are place in to "/var/spool/postfix/maildrop" directory. This process can be done by the "sendmail" binary that installed along with the Postfix installation. The msgs can be placed in to the directory with or without the "master" process (Postfix Master daemon). In other words even if the MTA is down the users can place msgs into the queue (maildrop directory) using "sendmail" binary using the process "postdrop". From this maildrop directiory the process called "/usr/libexec/postfix/pickup" which picks up the msgs. This process is spawned by the "master" program. The "pickup" process then feeds the locally submitted msgs to the "cleanup" process. The cleanup process takes care of addressing. Addressing means it fills the missing From & To address with FQDN. Then it moves the msg to the "incoming" queue directory in "/var/spool/postfix". From here the "qmgr" pickups the msgs and delivers based on the next architecture, like smtp, lmtp, local(for local mailing), virtual, pipe etc. The qmgr is responsible for delivering the msg either using local mailing or using the combination of local mailing and SMTP.

Configuring postfix to route the Local Mails
Dumping all the configuration parameters to screen
# postconf
The postconf command with no option prints all the configuration parameters of Postfix.

We need the following parameters in /etc/postfix/
# vim /etc/postfix/
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, nis:mail.aliases
Now check the aliases.db file existence
# ls -al /etc/alilases.db
If the file is not existing have to create it with the following command
# newaliases
This command will create a new aliases database with respect to /etc/aliases file. With out the aliases file the local mailing is not possible."Unlike sendmail postfix includes its own local mailer.It is able to deliver msgs locally with out the assistance of third party program such as maildrop, procmail etc". This means that the Postfix has its own local mail delivery capability.
# postfix restart
Testing Postfix Local Mailing.
Send a mail using the Postfix sendmail version binary in MSP mode to a user using the following command
# sendmail -v user
Subject: Testing postfix
Ctrl + d
Check the delivery status by following method
# mailq
This will echo any msgs are in the queue. Successful mail delivery makes this queue empty
# tail /var/log/maillog
The log shows the exact status of the mail. Now login and check the user mailbox
MAILCHECK=60 is the shell variable that cheks the mail in users inbox.

No comments:

Post a Comment

tag ur valuable ideas below