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