LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-10-2008, 06:46 PM   #1
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Postfix set-up


I am currently trying to set-up my server to act as an e-mail server, currently I have set up an MX record for mail.r3sistance.net and I am trying to configure postfix to recieve e-mails. Assume a username of abcde and I want abcde@r3sistance.net to be a working e-mail address that can send and recieve e-mail addresses.

I am currently confused as to what exactly I would need to set-up to get this to work. I am Using CentOS 5.2 if that effects anything and am trying to just get this e-mail server working for now.

Overall I have tried a couple of guides but they have lost me a bit and I am unsure why this does not already work. So if I know what variables should be set within which script specfically it should help me figure out where I am going wrong.

Thanks in advance .
 
Old 11-10-2008, 10:43 PM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Followed some guides? What guides? What did you not understand? What are the contents of your main.cf file? No one is going to be able to help you without some more information.
 
Old 11-10-2008, 10:51 PM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
If you have a valid user abcde, then all you should really need to is set you hostname and domain name in main.cf properly. Make sure your firewall is open on port 25.

If that doesn't work, look in /var/log/maillog for a start.

Note that to read mail you will probably want to run a pop or imap server as well (look at dovecot).
 
Old 11-14-2008, 04:12 PM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Original Poster
Rep: Reputation: 217Reputation: 217Reputation: 217
Sorry about that, had more work then I expected past couple of nights. Anyways the guide I used was:

http://wiki.centos.org/HowTos/postfix

I have done the following

Code:
myhostname = mail.r3sistance.net
mydomain = r3sistance.net
myorigin = $mydomain
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 168.100.189.0/28, 127.0.0.0/8
relay_domains =
home_mailbox = Maildir/
I got a rule in the firewall for port 25. however attempts to e-mail myself have resulted in the following response "smtp;550 Requested action not taken: mailbox unavailable"

I have set in /etc/aliases

# Person who should get root's mail
root: berwick

and directory exists
/home/berwick/Maildir

which has permissions as such drwx------

lastly my input chain for iptables

Code:
 pkts bytes target     prot opt in     out     source               destination
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:995 state NEW
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:993 state NEW
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:143 state NEW
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:110 state NEW
  233 11248 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:25 state NEW
 1206 64583 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:80 state NEW
  237 37510 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0
  112  7360 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 255
    0     0 ACCEPT     esp  --  *      *       0.0.0.0/0            0.0.0.0/0
    0     0 ACCEPT     ah   --  *      *       0.0.0.0/0            0.0.0.0/0
18040 1411K ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251         udp dpt:5353
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:631
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:631
 394K  353M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED
 7999  479K ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22
 108K   18M REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited
Not sure what I may have done wrong or set wrong =/.

Last edited by r3sistance; 11-14-2008 at 04:20 PM. Reason: iptables
 
Old 11-14-2008, 08:39 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I wouldn't have thought you nedded to, but try running "maildirnmake" to create the maildir directory structure (or you could create cur, new and tmp under Maildir manually).

If that doesn't work, please make sure you post the exact log messages nest time.
 
Old 11-14-2008, 08:56 PM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You may have an SELinux issue - do a quick test with SELinux disabled (setenforce 0 to turn it off, setenforce 1 to turn it back on).
 
Old 11-14-2008, 10:00 PM   #7
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Original Poster
Rep: Reputation: 217Reputation: 217Reputation: 217
Don't seem to work, that was pretty much all there was of note in the details I got back, I am gunna try recreating the MX records, I am wondering if the e-mails are even hitting my server right now, checked the logs of postfix and it does not appear to note anything so I am thinking perhaps not...
 
Old 11-14-2008, 10:15 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Try sending a message to yourself from the server ("mail -s test username" and hit ctrl-d to end the message body)
 
Old 11-19-2008, 06:25 PM   #9
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Original Poster
Rep: Reputation: 217Reputation: 217Reputation: 217
Thanks Billymayday,

Working in a Datacenter I actually get to talk to alot of people and finally found out that while the firewall wasn't blocking the port the traffic wasn't being correctly forwarded to postfix, redone the rules and it works now. So this is sorted now . Just before anybody else tries to be helpful... several years done the line or something.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How set up postfix? halvorls Linux - Server 13 06-09-2008 08:13 AM
Postfix how to set outgoing interface/IP? spadesmaster Fedora 2 02-10-2007 02:05 PM
Postfix mail server set up nakayiza Linux - Server 1 10-12-2006 05:38 AM
set squirrel mail to use postfix paul_mat Linux - Networking 1 01-20-2006 04:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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