Azitech

Azimout's Linux weblog

Mail Server

leave a comment »

Default TCP ports (2nd port: SSL): smtp: 25/587, pop3: 110/995, imap: 143/993

The configuration we’re going to use is Postfix + Courier.

sudo aptitude install postfix courier-imap-ssl courier-pop-ssl

Run maildirmake ~/Maildir to prepare an account’s homedir for Maildir emails

Postfix – Virtual Domains

Read carefully the Postfix Virtual Domain Hosting Howto, test and make sure you understand the following concepts:

  • canonical domains, i.e. the mailserver’s hostname (e.g. john@mailserver)
  • shared domains: an alias hostname just for SMTP (*@mydomain.com -> *@mailserver)
  • virtual aliases: like shared domains, but you can also map one mailbox to another, e.g. sales@mydomain.com -> john@mailserver
  • virtual mailboxes: break the mapping of mail recipients to Unix account

Maildrop

Read carefully the Postfix + Maildrop Howto and make sure you understand the concepts of local delivery agent and maildrop

Testing SMTP over telnet

netcat mailserver 25
220 mailserver ESMTP Postfix (Ubuntu)
ehlo mailserver
250-mailserver
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: username@mailserver
250 2.1.0 Ok

rcpt to: username@mailserver
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: test email
message body
.
250 2.0.0 Ok: queued as 9C423408E7
quit
221 2.0.0 Bye

Testing POP3 over telnet

netcat mailserver 110
+OK Hello there.
user username
+OK Password required.
pass password
+OK logged in.
stat
+OK 1 614
retr 1
<full message here>
quit
+OK Bye-bye.

Testing IMAP over telnet

netcat mailserver 143
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION] Courier-IMAP ready. Copyright 1998-2010 Double Precision, Inc.  See COPYING for distribution information.
. login username password
. OK LOGIN Ok.
. list “” “*”
* LIST (\HasNoChildren) “.” “INBOX.Sent”
* LIST (\HasNoChildren) “.” “INBOX.Trash”
* LIST (\HasNoChildren) “.” “INBOX.Queue”
* LIST (\Unmarked \HasChildren) “.” “INBOX”
* LIST (\HasNoChildren) “.” “INBOX.Drafts”
. OK LIST completed
. status inbox (messages)
* STATUS “inbox” (MESSAGES 1)
. OK STATUS Completed.
. logout
* BYE Courier-IMAP server shutting down

. OK LOGOUT completed

References

Advertisements

Written by azimout

26/02/2011 at 22:34

Posted in Reference

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: