LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-20-2011, 04:26 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Basic Postfix and Dovecot Mail Server for a test environment.


I did a a basic install of postfix and dovecot instead of using courier-pop and courier-imap. This is only send and receiving e-mail locally within the test network 10.7.0.X and 10.0.0.X. I used:

https://help.ubuntu.com/community
/PostfixBasicSetupHowto


and

http://https://help.ubuntu.com/community/Dovecot


my postfix.conf is;

PHP Code:
# 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/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file
=/etc/ssl/private/ssl-cert-snakeoil.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 testbox
alias_maps 
hash:/etc/aliases
alias_database 
hash:/etc/aliases
myorigin 
= /etc/mailname
mydestination 
testlocal.comtestboxlocalhost.localdomainlocalhost
relayhost 
=
mynetworks 127.0.0.0/810.7.0.0/2410.0.0.0/24
mailbox_size_limit 
0
recipient_delimiter 
= +
inet_interfaces all
default_transport 
error
relay_transport 
error

and my dovecot.conf.

PHP Code:
# specify protocols = imap imaps pop3 pop3s
protocols pop3 imap
# uncomment this and change to no.
disable_plaintext_auth no
pop3_uidl_format 
= %08Xu%08Xv 
This is the error when I send an email from a local machine on the 10.0.0.X network.


PHP Code:
Jan 20 17:05:48 testbox postfix/smtpd[2491]: warningIllegal address syntax from unknown[10.0.0.111in MAIL command: <test@10.0.0.112

Last edited by metallica1973; 02-11-2011 at 02:17 PM.
 
Old 01-21-2011, 02:29 AM   #2
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
I'm unfamiliar with dovecot.

1) This might not matter, but is the postfix machine in 10.0.0.x or 10.7.0.x?

2) Are you using a MTA to send, or are you doing it from the command line? If so, what command are you entering? At first I took this to be a network address error, but I think it's a mail address error.

3) 127.0.0.0/8 is a very wide range of addresses. From a security standpoint, it's not a huge deal, but after you get everything working, I'd change this to 127.0.0.1/32.
 
Old 01-21-2011, 08:19 AM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
1 - This machines is in the 10.0.0.X network so 10.0.0.111 is the client (thunderbird) and 10.0.0.112 (Postfix - MTA)

2 - I am trying to use to to send and recieve. These are the commands that I used to verify that it was working:

PHP Code:
netcat localhost 25
220 testbox ESMTP Postfix 
(Ubuntu)
mail fromroot@localhost
250 2.1.0 Ok
data
554 5.5.1 Error
no valid recipients
rcpt to
test@localhost
250 2.1.5 Ok
data
354 End data with 
<CR><LF>.<CR><LF>
this is a test
.
250 2.0.0 Okqueued as 8562741EC3
quit
221 2.0.0 Bye 
and

PHP Code:
netcat localhost 110
+OK
user test
+OK
pass test
!!
+
OK
quit
+OK 
but the root fails

PHP Code:
netcat localhost 110
+OK
user root
+OK
pass XXXXXXX
-ERR Authentication failed (bad password?) 
3 - good point


on the thunderbird client I have

POP settings as:

PHP Code:
server typePOP
server
10.0.0.112 (postfix)
usernametest 
sending:

PHP Code:
server typeSMTP
server
10.0.0.112
server requires authentication 
checked
use secure encrytion no
authentication 
plain
username
test 
here is a tail from /var/log/mail.log

PHP Code:
 Jan 21 09:24:59 testbox postfix/smtpd[4061]: warningIllegal address syntax from unknown[10.0.0.111in MAIL command: <test@10.0.0.112>
Jan 21 09:24:59 testbox postfix/smtpd[4061]: disconnect from unknown[10.0.0.111

Last edited by metallica1973; 01-21-2011 at 08:32 AM.
 
Old 01-21-2011, 09:25 AM   #4
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
I wonder if root login is being disallowed and clouding your troubleshooting efforts. Try something like this as test and then as root:
Code:
 echo "subject: test msg

Test body" | sendmail -v test root
this will send a brief test message to the users root and test, with the output result mailed to whoever sends the message. The original sendmail would dump output to the console, but postfix emails the report to you. there's probably a flag to change this, but I've never checked for it.

(you'll want a blank line after the subject declaration)
 
Old 01-21-2011, 09:47 AM   #5
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
ok here a news update:

I uninstalled dovecot and installed courier-pop and courier-imap using a MAILDIR format. I followed these instruction specifically down to the T:

https://help.ubuntu.com/community/Po...asicSetupHowto

I can recieve email from thunderbird via

PHP Code:
server typepop
server 10.0.0.112
user
test
no secure connection
no encryption
authenication type
password 
sending is where the issue is. when trying to send an email to root@10.0.0.112:

PHP Code:
server typesmtp
server
10.0.0.112
no server authentication
no encryption 
and I get the same messages via /var/log/mail.log

I added "debug_peer_list = 10.0.0.111" for debugging

PHP Code:
 Jan 21 10:36:41 testbox postfix/smtpd[6125]: warningIllegal address syntax from unknown[10.0.0.111in MAIL command: <test@10.0.0.112>
Jan 21 10:36:41 testbox postfix/smtpd[6125]: disconnect from unknown[10.0.0.111]
extract_addrin: <saint@10.0.0.112>, resultsaint@10.0.0.112
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: > unknown[10.0.0.111]: 501 5.1.7 Bad sender address syntax
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: watchdog_pat0x21092b20
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: < unknown[10.0.0.111]: QUIT
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: > unknown[10.0.0.111]: 221 2.0.0 Bye
Jan 21 11
:54:50 Stestbox postfix/smtpd[7071]: match_hostnameunknown ~? 127.0.0.0/8
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: match_hostaddr10.0.0.111 ~? 127.0.0.0/8
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: match_hostnameunknown ~? 10.7.0.0/24
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: match_hostaddr10.0.0.111 ~? 10.7.0.0/24
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: match_hostnameunknown ~? 10.0.0.0/24
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: match_hostaddr10.0.0.111 ~? 10.0.0.0/24
Jan 21 11
:54:50 testbox postfix/smtpd[7071]: disconnect from unknown[10.0.0.111

it has to be something in the main.conf of postfix telling it not to receive email from this network. ?

Last edited by metallica1973; 01-21-2011 at 11:42 AM.
 
Old 01-26-2011, 03:00 PM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
After numerous hours of playing with in turned out to be multiple little items that was causing it not to work. This is what I did to create a local email server, that only sends and receives internally for testing purposes. I used CENTOS 5.5 is this example but also used Ubuntu 10.10. Here Go:

I used this how to

http://wiki.centos.org/HowTos/postfix

the same would have worked with the above

First things is first. Hostname of the box:

PHP Code:
vi /etc/sysconfig/network
HOSTNAME
=TESTmail.local.com 
and I edited my /etc/hosts to include the appropriate names

PHP Code:
127.0.0.1 TESTmail.local.com TESTmail localhost.localdomain localhost 
I edited /etc/postfix/main.cf to include:

PHP Code:
myhostname TESTmail.local.com
mydomain 
local.com
myorigin 
$mydomain
inet_interfaces 
all
mydestination 
$myhostnamelocalhost.$mydomainlocalhost$mydomain
mynetworks 
10.0.0.0/24127.0.0.0/8 10.7.0.0/24
relay_domains 
=
home_mailbox Maildir
I added theses entries to /etc/dovecot.conf

PHP Code:
protocols imap imaps pop3 pop3s
mail_location 
maildir:~/Maildir
pop3_uidl_format 
= %08Xu%08Xv
# Required on x86_64 kernels
login_process_size 64 
Super Important -- Permission to the their respective mail directories.

PHP Code:
mkdir /home/john/Maildir
chown john
:john /home/john/Maildir
chmod 
-R 700 /home/john/Maildir 
There wasnt a need for aliases but the how-to above puts in into basic english.I then just simply started my
services:

PHP Code:
chkconfig --level 345 dovecot on
/etc/init.d/dovecot start
/etc/init.d/postfix start 
At this point I needed to verify that all was working so I ran some basic test:

PHP Code:
test@testbox:~$ telnet 10.0.0.116 25
Trying 10.0.0.116
...
Connected to 10.0.0.116.
Escape character is '^]'.
220 TESTMail.local.com ESMTP Postfix
mail
501 5.5.4 Syntax
MAIL FROM:<address>
mail from:tom@TESTMail.local.com
250 2.1.0 Ok
rcpt to
:chris@TESTMail.local.com
250 2.1.5 Ok
data
354 End data with 
<CR><LF>.<CR><LF>
this is another test
.
250 2.0.0 Okqueued as 4E7C2430036
quit
221 2.0.0 Bye
Connection closed by foreign host

PHP Code:
telnet 10.0.0.112 110
trying 10.0.0.112 
..
Connected to 10.0.0.112 (10.0.0.112)
Escape character is '^]'.
+
OK Dovecot ready.
user test
+OK
quit 
This was the critical part. Configuration of the Client: I used Evolution:

PHP Code:
fullnametest
email address
test@TESTmail.local.com

server type
POP 
server 
<mail.server.ip
usernametest
security
:no encryption
authentication
password

server type
SMTP
server
: <mail.server.ip
security:no encrytion 
I just send an email to test:

PHP Code:
testuser@TESTmail.local.com 

and all should go well. Using Ubuntu is slightly different but basically the same.

edit /etc/dovecot/dovecot.conf and remove the remark and change it to no or you will receive a error.

PHP Code:
-ERR Plaintext authentication disallowed on non-secure (SSL/TLSconnections
PHP Code:
disable_plaintext_auth no 

Last edited by metallica1973; 02-01-2011 at 03:22 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dovecot/Postfix server - some mail not arriving technomeister Linux - General 4 12-28-2012 02:05 PM
Can't download messages from Mail Server (Dovecot, postfix) jax8 Linux - Server 2 09-29-2010 03:27 AM
Is My Postfix-Dovecot Mail Server Secure Enough? bper Linux - Security 4 09-19-2010 06:19 AM
Postfix/Dovecot Mail Server Redundancy haariseshu Linux - Server 2 05-29-2009 05:55 AM
LXer: Debian Mail Server Setup with Postfix + Dovecot + SASL + Squirrel Mail LXer Syndicated Linux News 0 03-12-2008 10:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration