LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Postfix Mail Server.. Please advice (https://www.linuxquestions.org/questions/linux-software-2/postfix-mail-server-please-advice-432207/)

rickylim 04-06-2006 02:47 AM

Postfix Mail Server.. Please advice
 
Hi to all,

i have just setup a new mail server running on RHEL 4 and postfix 2.1.5.

i got it up running with dovecot and squirrelmail (thru apache).

i am able to send and receive for testing.

[/b]my questions is:-[/b]

when client receive email from sender.

it will show like this:-

username@localhost.mydomain.com

example: john@localhost.linuxforum.com

How can i elimiate the localhost right after the @ ?

i just it to be john@linuxforum.com.


Sorry, i am not able to show my conf file because the room where the pc is located at is locked.

Please advice..

Many Thanks



rgds.
Lim

timmeke 04-06-2006 03:00 AM

Have you tried changing $myorigin in postfix's main.cf config file?

If postfix listens to port 25 on the "localhost" interface, it may assume "localhost.yourDomain" as fully
qualified hostname.

You could also try playing around with /etc/hosts, altough I don't recommend that, as Postfix may get confused.

Code:

man trivial-rewrite
man transport

may help you too.

rickylim 04-06-2006 04:55 AM

thanks for your reply. i appreciate that :-)

i have set:-

myhostname = mail.aaa.com
mydomain = aaa.com
myorigin = $mydomain

but still the output show localhost

in my /etc/hosts i have

127.0.0.1 localhost.localdomain mail.aaa.com localhost

please help me~

timmeke 04-06-2006 09:07 AM

You could try putting "mail.aaa.com" ahead of "localhost.localdomain", but I doubt that will change anything.
Also, maybe you can try omitting "mail.aaa.com" from the localhost line in /etc/hosts altogether.

Normally 127.0.0.1 is localhost (or localhost.localdomain), nothing else.

rickylim 04-07-2006 02:17 AM

Again thanks for your reply.

i've tried putting mail.aaa.com ahead of localhost.localdomain and it doesn not help at all.

i've found out that if i send mail within the terminal (at the mail server)
#echo "Hello" | mail john

then when i check the mail (as user1) i will get john@linuxforum.com
which is what i want.

but then, when i use webmail as user1 sending mail to john (squirrelmail). then the john@localhost.linuxforum.com will appear.

what is it going on?

Please help.. Thanks

rgds.
Lim

rickylim 04-07-2006 02:21 AM

Hi going on to the next steps.

i have installed dovecot so that client can retrive and send mail.

but the problem is i could receive mail from the server but not sending.

what likely is wrong with it?

Thanks for ur attention

rgds.
Lim

timmeke 04-07-2006 02:29 AM

Receiving mail from a mail server uses POP3 or IMAP protocol most likely.
Sending mail out is done via SMTP. As SMTP uses a different port as the other protocols,
the first suspect would be that the SMTP port (number 25) is blocked.
So, check the firewall on your host and on the mail server and see if they
allow access to port 25 on the server.

You can also verify that access is allowed/blocked by executing:
Code:

telnet your_mail_server 25
If that connects, then there is no firewall blocking port 25. If it doesn't, check the firewall configs and other security measures involved.

rickylim 04-07-2006 03:18 AM

Hi again,

I've got the localhost@mydomain.com solved.
just have to change the localhost at squirrelmail config.php

i've tried the telnet to the machine at port 25
no response.

also #iptables -L
shown accept all type of incoming.
in gui i've also disable the SELinux and Firewall at the very first time.

something to set in postfix?

in postfix i am using the default setting but added these
home_mailbox = Maildir/
myhostname = mail.aaa.com
myorigin = $mydomain
mydomain = aaa.com

in dovecot using the default and made changes on
protocols = pop pop3s imap imaps

what's the problem could be?

Please advice.

rgds.
Lim

timmeke 04-07-2006 06:32 AM

I don't know anything about dovecot, but if it's supposed to retrieve mails for you, don't you need
smtp protocol as well?

trawler 04-07-2006 08:12 AM

sorry if i'm repeating things that's already been said but your /etc/postfix/main.cf file shoudl look something like this:

Code:

myhostname = mail.aaa.com
myorigin = /etc/mailname
mydestination = aaa.com, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8
masquerade_domains = mail.aaa.net
masquerade_exceptions = root

the main thing you should watch out for is the masquerade_domains line - it's what prevents the "mail" part on "mail.aaa.com" from showing up after the @ everytime you send mail.

hope this helps you :)


All times are GMT -5. The time now is 08:51 AM.