| FAQ/HOWTO |
|---|
| 04/01/2006 : Comment utiliser urpmi --parallel |
| 09/03/2005 : Comment installer plusieurs distributions |
| 07/07/2004 : Introduction à Linux |
| 07/07/2004 : Gestion des logiciels ( tar.gz, rpm et urpmi ) |
| 07/07/2004 : Comment installer le pilote NForce ? |
| Linux : How to configure local mail delivery | 31/12/2009 10:26:09 |
|---|---|
I have a separate server which hosts my database. Each night, a cron script is run to dump the databases contents and rsynced the backups to another server. The backup script will log the backup in /var/log, but also send a mail. Most of the time I'm using ssmtp to use my ISP SMTP server as a relay. However my database server most of the time is not connected to internet ( and this on purpose ). This is where the issue comes : ssmtp doesn't allow local mail delivery :( Even stranger, by default local mail delivery seems to not work at all in a default Mandriva installation :( To handle local mail delivery, you need a local Mail Delivery Agent ( MDA ), and your Mail Transfert Agent ( MTA ) should called the local MDA to deliver local mails. So here are 2 methods to handle local mail delivery. Using SENDMAILThe easiest to have local mail delivery is to install ... sendmail. Just install sendmail package and start the corresponding service, and your are done.
Using ESMTPAnother way is to use ESMTP. i do advised to use ESMTP because it allow to configure easily a SMTP relay host, and handle also local delivery. However by default, ESMTP is not usable in default Mandriva configuration as it will not install a local MDA ( mdv bug #56759 ) and does not provide a default system-wide configuration file ( mdv bug #56757 ). So here his the procedure for a very simple ESMTP configuration which handle a SMTP relay and local mail delivery :
Testing you local mail delivery setupNow that sendmail or ESMTP are configured, you should test if local mail delivery is working correctly. The easiest way is to use the mail command to send, but also read your local mails. For example to send a mail containing the content of /etc/nsswitch.conf to the root user, just type : mail -v -s "Local mail test" root < /etc/nsswitch.conf. Now log as root, and type mail to consult root mails. you may want to use Mutt eventually to read your mails instead of mail. | |
3 comment (s) | FACORAT Fabrice |