LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-28-2007, 04:35 PM   #1
rdnewman
Member
 
Registered: Jul 2005
Location: Meridian, ID
Distribution: FC6
Posts: 30

Rep: Reputation: 15
EMail server setup: FC6+Postfix+Dovecot+Squirrelmail


I'm setting up a server for a small home network to bring mail and web hosting in house, but have gotten stuck part of the way. I have dovecot and postfix installed and running. I have already set up a local DNS server and it seems to be working okay:

If I send mail from the command line as root, it shows up in root's mailbox just fine:
Quote:
# echo "test of a test" | mail -s "a test" root
# cat /root/Mailbox
From root@mydomain.org Sat Jul 28 14:47:54 2007
Return-Path: <root@mydomain.org>
X-Original-To: root
Delivered-To: root@mydomain.org
Received: by mail.mydomain.org (Postfix, from userid 0)
id 2490CC404F5; Sat, 28 Jul 2007 14:47:54 -0600 (MDT)
To: root@mydomain.org
Subject: a test
Message-Id: <20070728204754.2490CC404F5@mail.mydomain.org>
Date: Sat, 28 Jul 2007 14:47:54 -0600 (MDT)
From: root@mydomain.org (root)

test of a test
When I log into the squirrelmail though, the INBOX is empty. This seems wrong. This same behavior also occurs for a non-root account (richard@mydomain.org).

When I send mail from the command line from a non-root account, all seems okay and the message is received fine (note that otherdomain.com is completely external to mydomain.org):
Quote:
$ mail -s "from non-root" someone@otherdomain.com < ./.bashrc
$ tail /var/log/maillog
<...snip...>
Jul 28 14:16:42 poppa postfix/pickup[7750]: 2338AC404F5: uid=500 from=<richard>
Jul 28 14:16:42 poppa postfix/cleanup[7825]: 2338AC404F5: message-id=<20070728201642.2338AC404F5@mail.mydomain.org>
Jul 28 14:16:42 poppa postfix/qmgr[7751]: 2338AC404F5: from=<richard@mydomain.org>, size=453, nrcpt=1 (queue active)
Jul 28 14:16:44 poppa postfix/smtp[7827]: 2338AC404F5: to=<someone@otherdomain.com>, relay=mail.otherdomain.com[zzz.zzz.128.138]:25, delay=2.3, delays=0.43/0.05/0.23/1.6, dsn=2.0.0, status=sent (250 2.0.0 l6SKGgbT007706 Message accepted for delivery)
Jul 28 14:16:44 poppa postfix/qmgr[7751]: 2338AC404F5: removed

But sending via squirrelmail is not so successful, although the message is received on the other end.
Quote:
$ tail /var/log/maillog
<...snip...>
Jul 28 14:16:59 poppa dovecot: imap-login: Login: user=<richard>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Jul 28 14:16:59 poppa dovecot: IMAP(richard): Disconnected: Logged out
Jul 28 14:17:30 poppa postfix/pickup[7750]: 3F832C404F5: uid=48 from=<richard@localhost>
Jul 28 14:17:30 poppa postfix/cleanup[7825]: 3F832C404F5: message-id=<59293.127.0.0.1.1185653850.squirrel@poppa.mydomain.org>
Jul 28 14:17:30 poppa postfix/qmgr[7751]: 3F832C404F5: from=<richard@localhost.mydomain.org>, size=717, nrcpt=2 (queue active)
Jul 28 14:17:30 poppa postfix/local[7844]: 3F832C404F5: to=<richard@mydomain.org>, relay=local, delay=0.21, delays=0.06/0.12/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 28 14:17:30 poppa dovecot: imap-login: Login: user=<richard>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Jul 28 14:17:30 poppa dovecot: IMAP(richard): Disconnected: Logged out
Jul 28 14:17:32 poppa postfix/smtp[7827]: 3F832C404F5: to=<someone@otherdomain.com>, relay=mail.otherdomain.com[zzz.zzz.128.138]:25, delay=2, delays=0.06/0.05/0.32/1.6, dsn=2.0.0, status=sent (250 2.0.0 l6SKHUtE007730 Message accepted for delivery)
Jul 28 14:17:32 poppa postfix/qmgr[7751]: 3F832C404F5: removed
Jul 28 14:17:32 poppa dovecot: imap-login: Login: user=<richard>, method=PLAIN, rip=::ffff:127.0.0.1, lip=::ffff:127.0.0.1, secured
Jul 28 14:17:32 poppa dovecot: IMAP(richard): Disconnected: Logged out
Notice that the sender address has "localhost" embedded in it address. In fact, the 3rd line above (for "postfix/pickup") refers to richard@localhost.

This led me to check on my host designations. I'm still new at networking details, so I may have made some mistakes here. Note that this server is my firewall and gateway for the rest of the network and so has two NICS: ethOUT (IP=yyy.yyy.110.54) and ethLOCAL (IP=192.168.xxx.115). As part of my testing, I lowered the firewall briefly to verify that it wasn't a factor. Finally, hosting of mydomain.org is actually currently elsewhere as I'm trying to set up to bring it in before I switch the public dns records: nonetheless, given the symptoms so far, I doubt that would be a contributing issue.

Quote:
# uname -a
Linux poppa.mydomain.org 2.6.20-1.2962.fc6 #1 SMP Tue Jun 19 18:24:12 EDT 2007 i686 i686 i386 GNU/Linux
# uname -n
poppa.mydomain.org
# hostname
poppa.mydomain.org
# hostname -a

# hostname -d
mydomain.org
# hostname -s
poppa
# hostname -f
poppa.mydomain.org

# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
192.168.xxx.115 poppa.mydomain.org
192.168.xxx.114 wap.mydomain.org
192.168.xxx.112 momma.mydomain.org
yyy.yyy.110.54 inet.mydomain.org mydomain.org mydomain
yyy.yyy.110.1 inetgate

# cat var/named/chroot/var/named/mydomain.zone
$ORIGIN mydomain.org.
$TTL 1D
@ SOA poppa.mydomain.org. postmaster.mydomain.org. (
2007072801 ; serial
8H ; refresh
4H ; retry
4W ; expire
1D ) ; minimum
NS poppa.mydomain.org.
MX 10 mail.mydomain.org.
localhost A 127.0.0.1
poppa A 192.168.xxx.115
inet A yyy.yyy.110.54
momma A 192.168.xxx.112
wap A 192.168.xxx.114
www CNAME inet
mail CNAME ine

# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=poppa.mydomain.org
NETWORKING_IPV6=no
Just in case you need it re postfix and dovecot:
Quote:
# cat /etc/postfix/main.cf | egrep -v "^#|^$"
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = mail.mydomain.org
mydomain = mydomain.org
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, $mydomain, localhost, localhost.localdomain, mail.$mydomain
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Mailbox
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

# cat /etc/dovecot.conf | egrep -v "^ *#|^$"
protocols = imap imaps pop3 pop3s
protocol imap {
}
protocol pop3 {
}
protocol lda {
postmaster_address = postmaster@example.com
}
auth default {
mechanisms = plain
passdb pam {
}
userdb passwd {
}
user = root
}
dict {
}
plugin {
}
So my questions:
1) why isn't Squirrelmail seeing the email in the user mailboxes?
2) why does sending through Squirrelmail embed localhost in the sender address?

Some ancillary questions:
3) is there anything that looks out of whack on my hostname setup?
4) if I don't do a # setsebool httpd_can_network_connect = 1, squirrelmail fails. I can make this permanent, but is that the right thing to do or is there a preferred way to more directly target Squirrelmail as an allowed script engine?

Sorry for all the quoted detail, but I'm at loss as to what is the likely culprit. Thanks for reading this far....

Richard
 
Old 07-29-2007, 10:46 PM   #2
rdnewman
Member
 
Registered: Jul 2005
Location: Meridian, ID
Distribution: FC6
Posts: 30

Original Poster
Rep: Reputation: 15
I have tried to set up KMail to read from both the root and non-root accounts through both imap and pop3. The imap won't connect, so that seems related to some security setting, but the pop3 connects but comes back empty. The pop3 behavior leads me to believe that there is a mismatch between where postfix sends the email and where dovecot expects to find it.

I don't know where to look for this discrepancy and it isn't obvious from the configuration files. If I can resolve the pop3 issue, it might simplify the imap issue.

Any advice? Is there a way to confirm my hypothesis on the mailbox mismatch?

Thanks,
Richard
 
Old 07-30-2007, 08:32 AM   #3
ScooterB
Member
 
Registered: Sep 2003
Location: NW Arkansas
Distribution: Linux Redhat 9.0, Fedora Core 2,Debian 3.0, Win 2K, Win95, Win98, WinXp Pro
Posts: 344

Rep: Reputation: 31
You will have to set up someone in your sendmail's access file to send root's mail to. It won't allow "root" to log in and retrieve mail from that account. If you look in etc/mail for the access file, enter in someone (a valid user) to recieve root's mail, it should work just fine. Try that and repost.
 
Old 07-30-2007, 07:02 PM   #4
rdnewman
Member
 
Registered: Jul 2005
Location: Meridian, ID
Distribution: FC6
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks for replying ScooterB.

It might have been obscured with all my description, but the issue with squirrelmail happens even with non-root accounts. The mailbox for a non-root account, richard@mydomain.org, accessed via POP3 comes up empty even though mail is sitting in /home/richard/Mailbox.

Quote:
You will have to set up someone in your sendmail's access file to send root's mail to.
I'm running Postfix instead of sendmail. I found /etc/postfix/access but that doesn't seem to be what you're suggesting.

Incidentally, I was originally following the advice at http://news.softpedia.com/news/HOWTO...C6-39412.shtml and got stuck at the step quoted below:
Quote:
Test it: Open your favorite browser and go to http://your.hostname.com/webmail and log in with the NON-ROOT user and password. If everything worked out well, you should have a new mail in your inbox.
Richard
 
Old 08-01-2007, 07:47 PM   #5
rdnewman
Member
 
Registered: Jul 2005
Location: Meridian, ID
Distribution: FC6
Posts: 30

Original Poster
Rep: Reputation: 15
I figured out the answer to question 1:
Quote:
why isn't Squirrelmail seeing the email in the user mailboxes?
Because my /etc/postfix/main.cf had the following line:
Quote:
home_mailbox = Mailbox
from http://news.softpedia.com/news/HOWTO...C6-39412.shtml. This might be fine in a lot of situations, but didn't work for me.

Fixing this and restarting postfix solved the problem.
 
Old 08-04-2007, 06:59 PM   #6
rdnewman
Member
 
Registered: Jul 2005
Location: Meridian, ID
Distribution: FC6
Posts: 30

Original Poster
Rep: Reputation: 15
Quote:
2) why does sending through Squirrelmail embed localhost in the sender address?
I was put on the right track to answering this question by post #2187976

My solution was to add the following lines to /etc/postfix/main.cf:
Quote:
# Domain masquerade
#
masquerade_domains = mydomain.org
masquerade_exceptions = root
masquerade_classes = envelope_sender, envelope_recipient, header_sender, header_recipient
My server is now online and receiving mail from the Internet fine. Incidentally, I'm only the using DNS setup internally, my domain name provider is handling my public DNS records, so that part of my setup in my original post is not really relevant.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Setup Mail Server with Postfix/Dovecot/SquirrelMail olddocks Linux - Server 2 03-24-2009 01:34 AM
Configuring and Email Server with Squirrelmail, sendmail and dovecot. ashesh0326 Linux - Server 6 04-08-2007 01:15 AM
LXer: Book review: Setup and Run a Small Office Email Server Using Postfix, Courier, Procmail, Squirrelmail, Clamav and Spamassassin LXer Syndicated Linux News 0 08-24-2006 09:21 AM
Postfix, Dovecot, SquirrelMail Troubles?! simonsez711 Linux - Software 14 07-22-2005 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:24 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