Jump to content
hariktny

Postfix Mail Server Configuration

Recommended Posts

This is specially for @tadios:

 

Configure SMTP mail service according to the following requirement.

a.your mail server should accept mail from remote host and local hosts.

b.user2 must be able to receive mail from remote hosts.

c. mail delivered to alice should spool into the default mail spool for alice /var/spool/mail/alice

 

Ans:

 

# rpm –q postfix

#yum install –y postfix*

#service postfix status

# service postfix start

#vim /etc/postfix/main.cf

Go to 75
th
line -------- uncomment and edit

Myhostname =
station40.domain80.example.com

Go to 83
rd
line ----- uncomment and edit

Mydomain =
domain80.example.com

Go to 99
th
line ---- uncomment the line.

Myorigin = $mydomain

Go to 113
th
line ------ uncomment the line

Inet_interfaces = all

Go to 116 line ----- comment this line

#inet_interfaces = localhost

Go to 164
th
line ----- comment the line

Go to 165
th
line ----- uncomment the line

:wq

# iptables -I INPUT -p tcp --dport 25 -j ACCEPT

#service postfix restart

#chkconfig postfix on

# mail –v [email protected]

subject : hi(can give anything)

In body : ( type anything )

. and enter

EOT

#su – user2

#mail ------ will have mail here.

# mail –[email protected]

subject : hi(can give anything)

In body : how are you ( can give anything )

. and enter

EOT

#su – alice

#mail ------ will have mail here

 

 

@tadios: Please PM me your mail id.

@others: Correct if there are any mistakes.

Edited by hariktny
  • Like 1

Share this post


Link to post
Share on other sites

Configure SMTP mail service according to the following requirement.

 

A .your mail server should accept mail from remote host and local hosts.

B. A user admin’s mail should be redirected to alice.

 

#vim /etc/postfix/virtual

Go to 159 line ----- copy this line

virtual_alias_maps = hash:/etc/postfix/virtual

#vim /etc/postfix/main.cf

Paste that copied line (virtual_alias_maps = hash:/etc/postfix/virtual) at line 120.

:wq

# vim /etc/postfix/virtual

Go to line 160 and type the following:

[email protected]@domain80.station.example.com

:wq

#postmap /etc/postfix/virtual

#service postfix restart

# vim /etc/aliases

admin alice

:wq

# newaliases

Share this post


Link to post
Share on other sites

One thing, I think you forgot to mention in your solution is:

 

#postconf -e mail_spool_directory = /var/spool/mail

 

Do we need to change the mydestination and mynetworks variable too?

 

Thanks a million!

Edited by tadios

Share this post


Link to post
Share on other sites

@tadios: no need man.

But u can use #postconf command if u want to review the parameter values.

Share this post


Link to post
Share on other sites

/var/mail is linked to /var/spool/mail so you can leave it at that.

Also, when testing from host machine, send test mail to <user>@FQDM which is usually <user>@station.domainXX.example.com

Share this post


Link to post
Share on other sites

@Moazrefat

 

if you can exaplin to me

#vim /etc/postfix/virtual

Go to 159 line ----- copy this line

virtual_alias_maps = hash:/etc/postfix/virtual

#vim /etc/postfix/main.cf

Paste that copied line (virtual_alias_maps = hash:/etc/postfix/virtual) at line 120.

:wq

# vim /etc/postfix/virtual

Go to line 160 and type the following:

[email protected]@domain80.station.example.com

:wq

#postmap /etc/postfix/virtual

Share this post


Link to post
Share on other sites

@test4you

 

If you want postfix to handle multiple domains then it is a good idea to enable virtual_alias_maps. For the exam you all have to do is ensure that mydestination parameter contains domain name.

Share this post


Link to post
Share on other sites

Anyone take rhce and pass it recently? Is this correct answer to setup postfix? Thanks.

Share this post


Link to post
Share on other sites

Follow instructions provided from to configure postfix to accept mail from remote host and local hosts. I able to receive mail from local hosts but did not receive mail from remote hosts.

 

What steps are missing here? Anyone has the same problem with remote hosts?

Share this post


Link to post
Share on other sites

Follow instructions provided from to configure postfix to accept mail from remote host and local hosts. I able to receive mail from local hosts but did not receive mail from remote hosts.

 

What steps are missing here? Anyone has the same problem with remote hosts?

Can you tell us what remote host did you use ? for eg different network ?

Share this post


Link to post
Share on other sites

Any hosts besides the local host that you configure postfix. If it works, you should be sending mail from yahoo mail or gmail or whatever to your postfix mail server. @vanh: Have you taken RHCSA and RHCE yet? Any updates?

Share this post


Link to post
Share on other sites

Any hosts besides the local host that you configure postfix. If it works, you should be sending mail from yahoo mail or gmail or whatever to your postfix mail server. @vanh: Have you taken RHCSA and RHCE yet? Any updates?

It depends on the the DNS. The only different is DNS for remote host if DNS is working then postfix configuration shouldn't have any problem. It is the same as local host when we send email.

No not yet. This week i will take rHCSA but not yet register for RHCE. Hope so they will organize RHCE soon in our location. It was cancelled several time because not enough people attended.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...