LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2012, 11:07 AM   #1
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Rep: Reputation: Disabled
Question Setting up Mail Server on centOS, hehe


Hey guys!

I decided to setup a server on centOS and I'm following this guide, but I am stuck on this step, where they say, it is required to install postfix and system-switch-mail-gnome packages, but when I type
Code:
$ yum install system-switch-mail-gnome
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
 * base: mirror.nexcess.net
 * centosplus: mirror.trouble-free.net
 * extras: mirror.net.cen.ct.gov
 * updates: centos.mirror.choopa.net
Setting up Install Process
No package system-switch-mail-gnome available.
Error: Nothing to do
, I am getting an error. Looks like, there is no such package and I don't know, what shall I do.
Code:
$ cat /etc/*-release
CentOS release 6.2 (Final)
CentOS release 6.2 (Final)
CentOS release 6.2 (Final)
Code:
$ uname -mrs
Linux 2.6.32-220.13.1.el6.centos.plus.x86_64 x86_64
I heard, that there is no such package since centOS6, but what shall I do then?

Thank you!

Last edited by WoAnerges; 04-26-2012 at 11:12 AM.
 
Old 04-26-2012, 11:21 AM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
That package is for Gnome(A GUI for red hat systems) to be able to help you manage your mail server. There is not a need for that package to be installed to setup postfix.

Check out http://wiki.centos.org/HowTos/postfi...=%28postfix%29

It talks about those packages and how they are optional and will walk you through the install. Best of luck.
 
1 members found this post helpful.
Old 04-26-2012, 11:23 AM   #3
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
This is also a good url to bookmark for help configuring postfix: http://www.postfix.org/documentation.html
 
1 members found this post helpful.
Old 04-26-2012, 11:50 AM   #4
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
Question setting up mail server on centOS6 follow up 1

Hey,

so, it wants me to create some real user accounts, in order, for them, to be able to receive mails.
It wants me to check mails in /home/<username/Maildir/new/, so if I want a support@domain.com email, then I have to create such username?

Thanks!
 
Old 04-26-2012, 12:20 PM   #5
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
Thats correct. The user must be setup on the system.
 
1 members found this post helpful.
Old 04-26-2012, 12:28 PM   #6
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
Kusom42,
could you help me to configure this fake user, to achieve a best security?
Code:
$ useradd support
What would you do next?
 
Old 04-26-2012, 12:37 PM   #7
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
For security you should set the default shell to be /sbin/nologin for the users if they are only going to be receiving mail.

Code:
useradd -s/sbin/nologin username
You can change the one that already has been added by switching to the user and using the 'chsh' command or editing your /etc/passwd file and changing it from /bin/bash to /sbin/nologin. After you have your user's set up you will want to look at configuring dovecot to allow pop3 connections for email retrieval. One gotcha with dovecot is that you will need to set it to run on boot with chkconfig as it will not by default after installation.

Code:
/sbin/chkconfig --levels 2345 dovecot on
 
1 members found this post helpful.
Old 04-26-2012, 03:35 PM   #8
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
Code:
# /sbin/chkconfig --levels 2345 dovecot on
error reading information on service dovecot: No such file or directory
I will allow pop3 connections by entering this command?
Or I should do
Code:
iptables -A INPUT -p tcp --dport 110 -j ACCEPT
?

I've run the command "/sbin/chkconfig --levels 2345 dovecot on" and it went without any errors.
I've installed dovecot. Should I add port 110 with iptables or in some other way?

I'm at this stage
and I am getting these errors:
Code:
Stopping Dovecot Imap:                                     [FAILED]
Starting Dovecot Imap: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -n > dovecot-new.conf
doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf: service(pop3-login): vsz_limit is too low
I tried to find, where to change vsz_limit, but failed. Can you help me to find, where is it?

I've added these lines into dovecot.conf:
Code:
auth default {	
  socket listen {
    client {
	  path = /var/spool/postfix/private/auth
	  mode = 0660
	  user = postfix
	  group = postfix
    }
  }	
  mechanisms = plain login
}
and received this message:
Code:
# service dovecot restart
Stopping Dovecot Imap:                                     [FAILED]
Starting Dovecot Imap: doveconf: Warning: NOTE: You can get a new clean config file with: doveconf -n > dovecot-new.conf
doveconf: Warning: Obsolete setting in /etc/dovecot/dovecot.conf:86: add auth_ prefix to all settings inside auth {} and remove the auth {} section completely
So, I did, like they said:
Code:
auth_path = /var/spool/postfix/private/auth
auth_mode = 0660
auth_user = postfix
auth_group = postfix
auth_mechanisms = plain login
and this is, what I get:
Code:
# service dovecot restart
Stopping Dovecot Imap:                                     [FAILED]
Starting Dovecot Imap: doveconf: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 86: Unknown setting: auth_path
                                                           [FAILED]
Wrong email server setup guide? Maybe someone has a better guide?

Last edited by WoAnerges; 04-26-2012 at 05:21 PM.
 
Old 04-28-2012, 04:46 AM   #9
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
Up, please, guys.
 
Old 04-29-2012, 10:36 AM   #10
mail2ganesh.cse
Member
 
Registered: Apr 2012
Posts: 65

Rep: Reputation: Disabled
[root@mail ~]#
vi /etc/postfix/main.cf
# line 75: uncomment and specify hostname

myhostname =
mail.server.world
# line 83: uncomment and specify domain name

mydomain =
server.world
# line 99: uncomment

myorigin = $mydomain
# line 116: change

inet_interfaces =
all
# line 119: change if you use only IPv4

inet_protocols =
ipv4
# line 164: add

mydestination = $myhostname, localhost.$mydomain, localhost
, $mydomain
# line 264: uncomment and specify your LAN

mynetworks = 127.0.0.0/8,
10.0.0.0/24
# line 419: uncomment (use Maildir)

home_mailbox = Maildir/
# line 545: uncomment, line 546: add

header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
# line 571: add

smtpd_banner = $myhostname ESMTP
# add at the last line

# limit an email size 10M

message_size_limit = 10485760

# limit mailbox 1G

mailbox_size_limit = 1073741824
# for SMTP-Auth settings

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_client_restrictions = permit_mynetworks,reject_unknown_client,permit
smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject
[root@mail ~]#
vi /etc/postfix/header_checks
# add at the head

# reject if email address is empty

/^From:.*<#.*@.*>/ REJECT
/^Return-Path:.*<#.*@.*>/ REJECT
[root@mail ~]#
vi /etc/postfix/body_checks
# reject if includes 'example.com' in mail body

/^(|[^>].*)example.com/ REJECT
[root@mail ~]#
/etc/rc.d/init.d/postfix start

Starting postfix:
[ OK ]

[root@mail ~]#
chkconfig postfix on
 
1 members found this post helpful.
Old 04-29-2012, 10:38 AM   #11
mail2ganesh.cse
Member
 
Registered: Apr 2012
Posts: 65

Rep: Reputation: Disabled
[root@mail ~]#
yum -y install dovecot
[root@mail ~]#
vi /etc/dovecot/dovecot.conf
# line 31: change ( if not use IPv6 )

listen =
*
[root@mail ~]#
vi /etc/dovecot/conf.d/10-auth.conf
# line 9: uncomment and change ( allow plain text auth )

disable_plaintext_auth =
no
# line 97: add

auth_mechanisms = plain
login
[root@mail ~]#
vi /etc/dovecot/conf.d/10-mail.conf
# line 30: uncomment and add

mail_location =
maildir:~/Maildir
[root@mail ~]#
vi /etc/dovecot/conf.d/10-master.conf
# line 84-86: uncomment and add

# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0666

user = postfix
# add

group = postfix
# add

}
[root@mail ~]#
/etc/rc.d/init.d/dovecot start

Starting Dovecot Imap:
[ OK ]

[root@mail ~]#
chkconfig dovecot on
 
1 members found this post helpful.
Old 04-29-2012, 10:39 AM   #12
mail2ganesh.cse
Member
 
Registered: Apr 2012
Posts: 65

Rep: Reputation: Disabled
root@mail ~]#
yum --enablerepo=epel -y install mailgraph

# install from EPEL
[root@mail ~]#
vi /etc/httpd/conf.d/mailgraph.conf
Alias /mailgraph /usr/share/mailgraph
AddHandler cgi-script .cgi
<Directory /usr/share/mailgraph/>
AllowOverride None
Options +ExecCGI
DirectoryIndex mailgraph.cgi
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
10.0.0.0/24
# IP address you allow

</Directory>
[root@mail ~]#
/etc/rc.d/init.d/mailgraph start

Starting mailgraph:
[ OK ]

[root@mail ~]#
/etc/rc.d/init.d/httpd restart

Stopping httpd:
[ OK ]

Starting httpd:
[ OK ]

[root@mail ~]#
chkconfig mailgraph on
 
1 members found this post helpful.
Old 04-29-2012, 04:09 PM   #13
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
Dear mail2ganesh.cse,

thank you so much for sparing such a huge amount of your time, to create a guide! I am sure, it will help a lot of people in the future.

I did everything and everything started normally, except the last one:

Quote:
# yum --enablerepo=epel -y install mailgraph
Loaded plugins: fastestmirror, presto, priorities


Error getting repository data for epel, repository not found
# yum install mailgraph
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
* base: mirror.cogentco.com
* centosplus: mirror.symnds.com
* extras: mirror.trouble-free.net
* updates: mirror.trouble-free.net
base | 3.7 kB 00:00
c5-testing | 3.0 kB 00:00
centosplus | 3.5 kB 00:00
contrib | 951 B 00:00
extras | 3.5 kB 00:00
updates | 3.5 kB 00:00
Setting up Install Process
No package mailgraph available.
Error: Nothing to do
Is there another way to get a mailgraph?

Thank you.

Also, this thing:


Quote:
# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for mycomputer
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

Last edited by WoAnerges; 04-29-2012 at 04:17 PM.
 
Old 04-30-2012, 09:26 AM   #14
mail2ganesh.cse
Member
 
Registered: Apr 2012
Posts: 65

Rep: Reputation: Disabled
Quote:
# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for mycomputer
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]


Kindly,

check the conf file of resolv.conf, nd hosts in /etc/.... the DNS in not fulled qulified...



&


for mail graph
apt-get install rrdtool mailgraph
dpkg-reconfigure mailgraph
Logfile used by mailgraph: <-- /var/log/mail.log

cp -p /usr/lib/cgi-bin/mailgraph.cgi /var/www/www.example.com/cgi-bin
 
Old 04-30-2012, 09:44 AM   #15
WoAnerges
Member
 
Registered: Apr 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
should I literally use "mail.server.world", or should I change it to my domain name?
apt-get isn't working. Should I use yum install instead?

!mailgraph installation package cannot be found.

resolv.conf content (is it fine?):
nameserver 8.8.8.8
nameserver 8.8.4.4


Here, is what centOS6 prints:
(should I install all these additional packages?)

Quote:
# apt-get
-bash: apt-get: command not found

# yum install rrdtool mailgraph
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
* base: mirror.cogentco.com
* centosplus: mirror.symnds.com
* extras: mirror.trouble-free.net
* updates: mirror.trouble-free.net
base | 3.7 kB 00:00
c5-testing | 3.0 kB 00:00
centosplus | 3.5 kB 00:00
contrib | 951 B 00:00
extras | 3.5 kB 00:00
updates | 3.5 kB 00:00
Setting up Install Process
No package mailgraph available.
Resolving Dependencies
--> Running transaction check
---> Package rrdtool.x86_64 0:1.3.8-6.el6 will be installed
--> Processing Dependency: dejavu-sans-mono-fonts for package: rrdtool-1.3.8-6.el6.x86_64
--> Processing Dependency: dejavu-lgc-sans-mono-fonts for package: rrdtool-1.3.8-6.el6.x86_64
--> Processing Dependency: libpangocairo-1.0.so.0()(64bit) for package: rrdtool-1.3.8-6.el6.x86_64
--> Processing Dependency: libcairo.so.2()(64bit) for package: rrdtool-1.3.8-6.el6.x86_64
--> Processing Dependency: libpango-1.0.so.0()(64bit) for package: rrdtool-1.3.8-6.el6.x86_64
--> Running transaction check
---> Package cairo.x86_64 0:1.8.8-3.1.el6 will be installed
--> Processing Dependency: libpixman-1.so.0()(64bit) for package: cairo-1.8.8-3.1.el6.x86_64
---> Package dejavu-lgc-sans-mono-fonts.noarch 0:2.30-2.el6 will be installed
--> Processing Dependency: dejavu-fonts-common = 2.30-2.el6 for package: dejavu-lgc-sans-mono-fonts-2.30-2.el6.noarch
---> Package dejavu-sans-mono-fonts.noarch 0:2.30-2.el6 will be installed
---> Package pango.x86_64 0:1.28.1-3.el6_0.5.1.centos will be installed
--> Processing Dependency: libthai >= 0.1.9 for package: pango-1.28.1-3.el6_0.5.1.centos.x86_64
--> Processing Dependency: libthai.so.0(LIBTHAI_0.1)(64bit) for package: pango-1.28.1-3.el6_0.5.1.centos.x86_64
--> Processing Dependency: libthai.so.0()(64bit) for package: pango-1.28.1-3.el6_0.5.1.centos.x86_64
--> Processing Dependency: libXft.so.2()(64bit) for package: pango-1.28.1-3.el6_0.5.1.centos.x86_64
--> Running transaction check
---> Package dejavu-fonts-common.noarch 0:2.30-2.el6 will be installed
--> Processing Dependency: fontpackages-filesystem for package: dejavu-fonts-common-2.30-2.el6.noarch
---> Package libXft.x86_64 0:2.1.13-4.1.el6 will be installed
---> Package libthai.x86_64 0:0.1.12-3.el6 will be installed
---> Package pixman.x86_64 0:0.18.4-1.el6_0.1 will be installed
--> Running transaction check
---> Package fontpackages-filesystem.noarch 0:1.41-1.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================== ====
Package Arch Version Repository Size
==================================================================================================== ====
Installing:
rrdtool x86_64 1.3.8-6.el6 base 293 k
Installing for dependencies:
cairo x86_64 1.8.8-3.1.el6 base 309 k
dejavu-fonts-common noarch 2.30-2.el6 base 59 k
dejavu-lgc-sans-mono-fonts noarch 2.30-2.el6 base 393 k
dejavu-sans-mono-fonts noarch 2.30-2.el6 base 450 k
fontpackages-filesystem noarch 1.41-1.1.el6 base 8.8 k
libXft x86_64 2.1.13-4.1.el6 base 49 k
libthai x86_64 0.1.12-3.el6 base 183 k
pango x86_64 1.28.1-3.el6_0.5.1.centos updates 350 k
pixman x86_64 0.18.4-1.el6_0.1 base 146 k

Transaction Summary
==================================================================================================== ====
Install 10 Package(s)

Total download size: 2.2 M
Installed size: 5.6 M
Is this ok [y/N]:

Last edited by WoAnerges; 04-30-2012 at 09:53 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail server in centos!! anishkumarv Linux - Server 28 05-08-2012 01:05 AM
Frustration and confusion over setting up a Postfix mail server on my Ubuntu server. dag10 Linux - Server 5 04-17-2011 10:16 AM
setting up vnc server on centos 5 sandeepthug Linux - Newbie 2 01-14-2009 03:49 AM
sendmail on CentOS 4.4 - where do I see the mail SENT to the server? Dan8080 Linux - Newbie 3 09-27-2006 11:30 PM
setting up a mail server: unable to recieve mail Valkyrie_of_valhalla Linux - Networking 3 09-15-2006 01:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration