How to set up server with email

Currently my server has php mysql ftp ssh etc

I need beginner guide to completely add email to my server.

I host websites and they want their name @ their domain . com

And web access to their mail.

I know 500 points isn't enough after i get a solution I will awards 2000 points.
LVL 10
Tyler LaczkoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

this is a step by step guide that will help a lot:
Tyler LaczkoAuthor Commented:
i need a complete beginner guide. list of exact commands to execute and everything.
hahahaahh 2000 points , how will u do that ??

anyway :
first of all

who is responsible for Dns management ??

the article michofreiha sent its   good.

but before configuring sendmail, you need to check few options
like /etc/hosts what have you put their

example : if your domain is 
and if you configure your Mx record as  then in /etc/host you should write first , other wise later on other mailserver like yahoo or hotmail they will reject your mail.

at first let   you make your mail server work then will talk about webmail options

also : do you want to allow user to out outlook to access your mail server ??

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

also, i always follow this link

i work on centos, but it should work with ubundu

you are trying to use sendmail but if you want to secure sendmail and best option is sendmail + tls
setup is easy just copy and past.
You can either follow this one:
last one i will say to look the basic setup

but remember,if you dont secure your sendmail , following day you will see every mail server is rejecting your mail and you will end up block list as this happened with me.

if you have any question related setup sendmail you can ask
you can try this tutorial as well:
Tyler LaczkoAuthor Commented:
Could not get it set up correctly. decided not to do it...
Hi, you should of let us know where you were having problem, you asked for beginner guide for setup email and thats what we provided you.

you could of ask further question here or you could of open another question where actually  you were having probelem.

dont understand why you want to delete this question.

Tyler LaczkoAuthor Commented:
Since some of you felt that I should not have given up I setup a new server using how to forge.

My issue is that I cannot send emails. I setup squirrel mail and can receive emails but I am getting

Connection timed out

in my mail.log every time I try to send out.
ok from server , can you sent email ??

i mean, from comand line : try to do this

cat /etc/host | mail -s "mysubject"

see if you can sent email or not
Tyler LaczkoAuthor Commented:
i have tried that and from squirrelmail and the log says that it times out.
forget squirrelmail for now

fix the sendmail first.

have tryed that command as root user ??

Tyler LaczkoAuthor Commented:
yes i tried it as root user and regular user.
there must be something else in maillog with time out error
can you please past the full error here, it would be easy to understand

time out could be to many thing, like you are trying to send email to a host but host is rejecting so it will say time out...
Tyler LaczkoAuthor Commented:
Nov  4 08:06:29 pcsask postfix/qmgr[7272]: 67C112C1096: from=<>, size=293, nrcpt=1 (queue active)
Nov  4 08:07:00 pcsask postfix/smtp[8975]: connect to[]:25: Connection timed out
Nov  4 08:07:00 pcsask postfix/smtp[8975]: 67C112C1096: to=<>, relay=none, delay=315304, delays=315274/0.01/30/0, dsn=4.4.1, status=deferred (connect to[]:25: Connection timed out)
Nov  4 08:12:06 pcsask postfix/sendmail[9004]: fatal: usage: sendmail [options]
Nov  4 08:12:36 pcsask postfix/smtpd[9005]: connect from localhost[]
Nov  4 08:12:36 pcsask postfix/smtpd[9005]: 139612C1022: client=localhost[]
Nov  4 08:12:36 pcsask postfix/cleanup[9007]: 139612C1022: message-id=<>
Nov  4 08:12:36 pcsask postfix/qmgr[7272]: 139612C1022: from=<>, size=710, nrcpt=1 (queue active)
Nov  4 08:12:36 pcsask postfix/smtpd[9005]: disconnect from localhost[]
Nov  4 08:12:36 pcsask imapd: Connection, ip=[::ffff:]
Nov  4 08:12:36 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:], port=[44051], protocol=IMAP
Nov  4 08:12:36 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:], headers=0, body=0, rcvd=615, sent=203, time=0
Nov  4 08:12:36 pcsask imapd: Connection, ip=[::ffff:]
Nov  4 08:12:36 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:], port=[44053], protocol=IMAP
Nov  4 08:12:36 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:], headers=469, body=0, rcvd=296, sent=1892, time=0
Nov  4 08:12:39 pcsask imapd: Connection, ip=[::ffff:]
Nov  4 08:12:39 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:], port=[44054], protocol=IMAP
Nov  4 08:12:39 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:], headers=0, body=0, rcvd=87, sent=391, time=0
Nov  4 08:12:40 pcsask imapd: Connection, ip=[::ffff:]
Nov  4 08:12:40 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:], port=[44055], protocol=IMAP
Nov  4 08:12:40 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:], headers=0, body=0, rcvd=87, sent=391, time=0
Nov  4 08:13:06 pcsask postfix/smtp[9009]: connect to[]:25: Connection timed out
Nov  4 08:13:36 pcsask postfix/smtp[9009]: connect to[]:25: Connection timed out

ok check this one

this problem occur, when gmail or hotmail or yahoo will not accept email from your IP

what kind of ip you got ??is this public or dynamic ?

do you have permission to sent emaiil via this ip ( i mean by using port 25 directly ??)

you might need to use realy host and use isp mail server to send email.
Tyler LaczkoAuthor Commented:
I have squirrel mail setup for outgoing smtp using auth with my username and password

I think i have postfix configured the same...
Tyler LaczkoAuthor Commented:
# See /usr/share/postfix/ for a commented, more complete version
# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =,,, localhost,
relayhost =
mynetworks =
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
local_recipient_maps =
luser_relay =
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
home_mailbox = Maildir/

Open in new window

Tyler LaczkoAuthor Commented:
I am getting:

host[] said: 530
    5.7.0 No AUTH command has been given. (in reply to MAIL FROM command)
check this article  , it will help you with your problem

Tyler LaczkoAuthor Commented:
i tried to telnet 587

auth login


failed to login

i contacted sasktel and they said that my account may not be active yet.
here we go that mean, you need to wait to activate your account

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tyler LaczkoAuthor Commented:
I can send email. It was my ISP's fault.

But how do I create new accounts for squirrelmail??? I have my main account that I can log into but my other accounts i create it just says ERROR: Connection dropped by IMAP server.

What type of account am I supposed to create?
i never worked with postfix,
so i need to check documentaion, i will come back to you after 2 to 3 hours later as my office hour finished,
about this ERROR: Connection dropped by IMAP server., can you provide me the full log of this error please
it will help to understand
but the concept, you need to give permission other accounts to send mail via postfix

i will come back to you as i said
Tyler LaczkoAuthor Commented:
found my error.

the reason for the error is because squirrelmail cannot login with that account because it hasnt been setup

the user i was testing with had a different home dir with wrong permissions

i created a new users with a proper home dir and it works.

i am going to write a php page to setup new email accounts.
have a look this one

let me know if helps
i will look for article more

thats good
so your problem has been solved ???
Tyler LaczkoAuthor Commented:
thank you for your help
Tyler LaczkoAuthor Commented:
You didn't answer my question BUT i changed so many things including my question and you helped me through it all.

Thank you. Full points
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.