LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-14-2012, 10:23 AM   #1
greatdictator
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
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 ?
 
Old 02-14-2012, 03:37 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
As your output suggests, postfix is already your default mta. Did you 'chkconfig postfix on' ?
 
1 members found this post helpful.
Old 02-15-2012, 12:10 AM   #3
cha2ranga
LQ Newbie
 
Registered: Jun 2010
Location: Colombo
Posts: 3

Rep: Reputation: 1
Try to install "system-switch-mail" package.
After as root run "system-switch-mail" Select default mail client you need to set.
 
Old 02-15-2012, 06:25 AM   #4
greatdictator
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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.
 
Old 02-15-2012, 06:45 AM   #5
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

Rep: Reputation: 219Reputation: 219Reputation: 219
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
 
Old 02-16-2012, 03:45 PM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,716

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
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
 
Old 09-12-2012, 01:44 AM   #7
rob0
LQ Newbie
 
Registered: Sep 2009
Location: Alabama, USA
Distribution: Slackware
Posts: 9

Rep: Reputation: 0
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 View Post
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.)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] What is the default email (MTA) for RHEL6 vwtech Linux - Software 3 01-17-2011 01:26 PM
Sendmail is installed as default MTA. How do I switch to Postfix as MTA? virtualpal Linux - Newbie 5 05-11-2009 02:10 AM
change grub boot order, all instructions say change default, but I don't see default mhg Linux - Newbie 5 11-09-2008 10:01 AM
Default non-local MTA ? philforrest Linux - Software 2 08-25-2008 10:13 PM
change default mta watts3000 Linux - Newbie 1 09-04-2006 11:16 PM


All times are GMT -5. The time now is 04:04 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration