LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   Can't change default MTA - Centos 6 (http://www.linuxquestions.org/questions/red-hat-31/cant-change-default-mta-centos-6-a-929303/)

greatdictator 02-14-2012 11:23 AM

Can't change default MTA - Centos 6
 
Hello,

I have just installed fresh CentOS 6 on my VPS and having trouble to change default MTA from Sendmail to Postfix.
Here is what I did
Code:

sudo alternatives --set mta /usr/sbin/postfix
/usr/sbin/postfix has not been configured as an alternative for mta

I even removed sendmail from the system and tried couple of times but nothing changed.Here is some more output
Code:

sudo alternatives --display mta
mta - status is auto.
 link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.postfix - priority 30
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-sendmail: /usr/lib/sendmail.postfix
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.postfix.

Anyone have suggestion what to do next ?

kbp 02-14-2012 04:37 PM

As your output suggests, postfix is already your default mta. Did you 'chkconfig postfix on' ?

cha2ranga 02-15-2012 01:10 AM

Try to install "system-switch-mail" package.
After as root run "system-switch-mail" Select default mail client you need to set.

greatdictator 02-15-2012 07:25 AM

Quote:

As your output suggests, postfix is already your default mta. Did you 'chkconfig postfix on' ?
Apparently postfix is now default mta, but that have to do with removing sendmail package.If sendmail package present, I get
Code:

/usr/sbin/postfix has not been configured as an alternative for mta
when try to change.

Quote:

Try to install "system-switch-mail" package.
After as root run "system-switch-mail" Select default mail client you need to set.
Well, I can't install that package from CentOS6 default repos, simply yum can't find it, I've read somewhere that atlernatives command is preffered in CentOS6, not sure if the only way to change mta.

deep27ak 02-15-2012 07:45 AM

check whether this package is already installed

Code:

#rpm -q system-switch-mail
or you can manually download the package from here

ftp://ftp.redhat.com/redhat/linux/en...r/en/os/SRPMS/

once you install this simply run this command
Code:

#system-switch-mail
and you will be asked for your default MTA

kbp 02-16-2012 04:45 PM

You don't have to use alternatives unless you have multiple mta's installed and want to switch between them, if you just want postfix then:

Code:

yum erase sendmail
chkconfig postfix on
service postfix start


rob0 09-12-2012 02:44 AM

Yes, I know this reply is not relevant nor timely, but this came up in my Google search, and it did NOT have the answer to the question. Now it does.

Quote:

Originally Posted by greatdictator (Post 4602167)
Hello,

I have just installed fresh CentOS 6 on my VPS and having trouble to change default MTA from Sendmail to Postfix.
Here is what I did
Code:

sudo alternatives --set mta /usr/sbin/postfix
/usr/sbin/postfix has not been configured as an alternative for mta

I even removed sendmail from the system and tried couple of times but nothing changed.Here is some more output
Code:

sudo alternatives --display mta
mta - status is auto.
 link currently points to /usr/sbin/sendmail.postfix
/usr/sbin/sendmail.postfix - priority 30
 slave mta-pam: /etc/pam.d/smtp.postfix
 slave mta-mailq: /usr/bin/mailq.postfix
 slave mta-newaliases: /usr/bin/newaliases.postfix
 slave mta-rmail: /usr/bin/rmail.postfix
 slave mta-sendmail: /usr/lib/sendmail.postfix
 slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
 slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
 slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
 slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.postfix.

Anyone have suggestion what to do next ?

Reread the output you got. Yes, some of the advice upthread is valid, you don't need alternatives with only one MTA. But look again at what it said:

Current `best' version is /usr/sbin/sendmail.postfix.

You typed:

sudo alternatives --set mta /usr/sbin/postfix

and the error was:

/usr/sbin/postfix has not been configured as an alternative for mta

However, /usr/sbin/sendmail.postfix is indeed a choice if you do need to use alternatives. The right answer:

Code:

alternatives --set mta /usr/sbin/sendmail.postfix
(Use sudo(1) or other means of gaining root privilege as needed.)


All times are GMT -5. The time now is 06:12 AM.