How to config mail server on centos?

these days i am studying voicemail .all work fine but mail can not be sent.
i think i have not config the mail server properly. how to config the mail server ?any suggestion will be appreciated .TQ in advance.
PS: my Os is centos and asterisk version is 1.0.9

No, your o/s is not Centos, your o/s is Linux. Your distribution is Centos. (Sorry to be pedantic, but i just can’t help myself! :wink: )

There are dozens of linux distributions, and you can’t expect people to know your specific one. However, if you have a look at: … email.conf

you’ll see it says:

Mailcmd allows the administrator to override the default mailer command with a defined command. Mailcmd takes a string value set to the desired command line to execute when a user needs to be notified of a voice mail message. The default command line is: ‘/usr/sbin/sendmail -t’ [/quote]
This means that unless you edit voicemail.conf, asterisk will try and use sendmail to send the notification email. Centos may or may not use sendmail - i don’t know.

You’ll have to find out what MTA (mail transport agent) Centos comes with. And, if it’s not sendmail, you’ll have to find out what the command is for sending mail with it. There are a couple of other MTAs in common use, as well as maybe a couple of MDAs (mail distribution agents), which can probably be used to send mail as well.

Procmail is probably the most likely MDA and you ought to be able to use that - so long as your MTA is properly configured to send outgoing mail to the right place (usually your ISP’s SMTP server).

There will also be at least one MUA (mail user agent) - the sort of program you probably use to read and write email with - and you should be able to use some of these to send mail with too. A standard MUA is mail and if it’s included in Centos, you ought to be able to use that to send mail - in fact, if it’s there, it’s probably the most sensible command to use anyway, really, rather than using sendmail directly. However, you may not have it.

Yes, email is insanely complicated, but you don’t really need to worry about it too much. All you need to do is to somehow find out what command you can use to send mail from your system and make sure the email subsystem is configured properly so that when you send mail it can get out to the rest of the world.