Solved

How to set up server with email

Posted on 2008-10-29
34
699 Views
Last Modified: 2013-12-15
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.
0
Comment
Question by:Tyler Laczko
  • 16
  • 14
  • 2
  • +1
34 Comments
 
LVL 9

Expert Comment

by:michofreiha
ID: 22836251
this is a step by step guide that will help a lot:

http://www.linuxselfhelp.com/quick/sendmail.html
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22836474
i need a complete beginner guide. list of exact commands to execute and everything.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22836484
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 www.yourdomain.com
and if you configure your Mx record as mail.yourdomain.com  then in /etc/host you should write mail.yourdomain.com 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 ??



0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22836523
also, i always follow this link

http://www.howtoforge.com/howto_sendmail_smtp_auth_tls

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.
0
 
LVL 9

Expert Comment

by:michofreiha
ID: 22836533
You can either follow this one:

http://flurdy.com/docs/postfix/
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22836579
last one i will say to look the basic setup
http://beginlinux.com/server_training/mail-server/977-senmail-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
0
 
LVL 5

Expert Comment

by:sleepless6
ID: 22860197
you can try this tutorial as well:

http://www.howtoforge.com/perfect-server-ubuntu8.04-lts
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22864397
Could not get it set up correctly. decided not to do it...
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22865372
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.


0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22866061
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22868293
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.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22868442
ok from server , can you sent email ??

i mean, from comand line : try to do this

cat /etc/host | mail -s "mysubject" youremail@gmail.com

see if you can sent email or not
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22870838
i have tried that and from squirrelmail and the log says that it times out.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22870898
forget squirrelmail for now

fix the sendmail first.

have tryed that command as root user ??

0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22873231
yes i tried it as root user and regular user.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22874392
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...
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22876360
Nov  4 08:06:29 pcsask postfix/qmgr[7272]: 67C112C1096: from=<root@pcsask.com>, size=293, nrcpt=1 (queue active)
Nov  4 08:07:00 pcsask postfix/smtp[8975]: connect to janus.myabitat.net[139.142.45.185]:25: Connection timed out
Nov  4 08:07:00 pcsask postfix/smtp[8975]: 67C112C1096: to=<tylerl@wrightconstruction.ca>, relay=none, delay=315304, delays=315274/0.01/30/0, dsn=4.4.1, status=deferred (connect to janus.myabitat.net[139.142.45.185]: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[127.0.0.1]
Nov  4 08:12:36 pcsask postfix/smtpd[9005]: 139612C1022: client=localhost[127.0.0.1]
Nov  4 08:12:36 pcsask postfix/cleanup[9007]: 139612C1022: message-id=<c7aea21d8c74b5e1745e63d673c3da9e.squirrel@pcsask.com>
Nov  4 08:12:36 pcsask postfix/qmgr[7272]: 139612C1022: from=<liquidvenom@pcsask.com>, size=710, nrcpt=1 (queue active)
Nov  4 08:12:36 pcsask postfix/smtpd[9005]: disconnect from localhost[127.0.0.1]
Nov  4 08:12:36 pcsask imapd: Connection, ip=[::ffff:127.0.0.1]
Nov  4 08:12:36 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:127.0.0.1], port=[44051], protocol=IMAP
Nov  4 08:12:36 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=615, sent=203, time=0
Nov  4 08:12:36 pcsask imapd: Connection, ip=[::ffff:127.0.0.1]
Nov  4 08:12:36 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:127.0.0.1], port=[44053], protocol=IMAP
Nov  4 08:12:36 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:127.0.0.1], headers=469, body=0, rcvd=296, sent=1892, time=0
Nov  4 08:12:39 pcsask imapd: Connection, ip=[::ffff:127.0.0.1]
Nov  4 08:12:39 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:127.0.0.1], port=[44054], protocol=IMAP
Nov  4 08:12:39 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=87, sent=391, time=0
Nov  4 08:12:40 pcsask imapd: Connection, ip=[::ffff:127.0.0.1]
Nov  4 08:12:40 pcsask imapd: LOGIN, user=liquidvenom, ip=[::ffff:127.0.0.1], port=[44055], protocol=IMAP
Nov  4 08:12:40 pcsask imapd: LOGOUT, user=liquidvenom, ip=[::ffff:127.0.0.1], headers=0, body=0, rcvd=87, sent=391, time=0
Nov  4 08:13:06 pcsask postfix/smtp[9009]: connect to mx2.hotmail.com[65.54.245.40]:25: Connection timed out
Nov  4 08:13:36 pcsask postfix/smtp[9009]: connect to mx4.hotmail.com[65.54.245.104]:25: Connection timed out

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22876812
ok check this one
http://www.linuxtopia.org/ProblemSolutions/smtp_port_25_timeout.html

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.
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22877492
I have squirrel mail setup for outgoing smtp smtp.sasktel.net:587 using auth with my username and password

I think i have postfix configured the same...
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22877509
my main.cf
 cat main.cf

# See /usr/share/postfix/main.cf.dist 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 = pcsask.com

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

myorigin = /etc/mailname

mydestination = pcs-sk.sytes.net, worktherigs.com, pcsask.com, localhost, xboxmod.sytes.net

relayhost = smtp.sasktel.net:587

mynetworks = 127.0.0.0/8

mailbox_command =

mailbox_size_limit = 0

recipient_delimiter = +

inet_interfaces = all

inet_protocols = all

local_recipient_maps =

luser_relay = liquidvenom@pcsask.com

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

0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22877523
I am getting:

host smtp.sasktel.net[142.165.72.18] said: 530
    5.7.0 No AUTH command has been given. (in reply to MAIL FROM command)
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22877629
check this article  , it will help you with your problem

http://ubuntuforums.org/showthread.php?t=316711

0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22877855
i tried to telnet smtp.sasktel.net 587

auth login

username
password


failed to login


i contacted sasktel and they said that my account may not be active yet.
0
 
LVL 29

Accepted Solution

by:
fosiul01 earned 500 total points
ID: 22877890
here we go that mean, you need to wait to activate your account
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22878231
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?
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22878295
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,
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22878348
about this ERROR: Connection dropped by IMAP server., can you provide me the full log of this error please
it will help to understand
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22878381
but the concept, you need to give permission other accounts to send mail via postfix

i will come back to you as i said
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22878419
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.
0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22878420
have a look this one

http://www.squirrelmail.org/wiki/MailServerIMAPProblem

let me know if helps
i will look for article more

0
 
LVL 29

Expert Comment

by:fosiul01
ID: 22878430
thats good
so your problem has been solved ???
0
 
LVL 10

Author Comment

by:Tyler Laczko
ID: 22878444
thank you for your help
0
 
LVL 10

Author Closing Comment

by:Tyler Laczko
ID: 31511459
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
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now