Pop3 Help
I thought I was done with the hard part, getting BIND/Apache/MySQL/Perl/PHP working so soon, but then I stumbled into what one would assume to be an easy part; email. So far it's only managed to stump me. I need virtual domain support, so that's possibly why it's so complicated.
I did manage to get Postfix configured I believe, having it deliver primarydomain.com and secondarydomain.com email to /var/spool/virtual/XXXXXdomain.com/ (the X a substitute of course). But now I need to get pop3 running so I can actually login to check it.
I've tried messing with Courier and Cyrus, since I heard they work with virtual hosts, but so far I haven't been able to figure out anything on how to do it. I see lots of people suggesting to use MySQL and such for storage, and while I'd like to try that one day, for now I just want flat files.
So if someone could show me some example configurations or point me to a good tutorial on the web, I'd be grateful. I'm not entirely sure if my Postfix is configured properly either (since I thought
6 Replies
I can suggest using postfix-admin's MySQL setup for virtual users, which Courier-authd can then be set to authenticate off - but I will also recommend exporting your virtual users to a hash file for postfix, or else your performance will die a horribly.
When I telnet into smtp, it greets me and all, but if I try to use the "MAIL FROM:" command, it'll just sit there forever. Though if I use "MAIL FROM: <>" it'll OK.
The other problem is telnetting into pop (I installed courier-pop along with courier-imap, even though I don't need the latter I don't guess), I try to log in with the email address I created in postfix-admin, and I get a Login Failed.
For the record, I'm running Debian, if that helps any.
UPDATE: I set postfix to use proxy:mysql: instead of just mysql: and that got rid of the MAIL FROM: problem. But I still don't know how to get the mail through pop, or where to check on the drive to see if I'm even receiving mail properly. The tutorial said something about /usr/local/virtual, but there's nothing in it.
I think that's when I started getting the following errors:
postfix/virtual[4759]: fatal: mysql:/etc/postfix/mysqlvirtualmailbox_maps.cf: proxy map is not allowed for security sensitive data
And so, the only way around this error that I could figure out was to change everything back from proxy:mysql: to mysql: in Postfix's main.cf, which didn't cause the freezing smtp connection problem like before since I had set the mysqld.lock path correctly. But, then I got a different error.
postfix/trivial-rewrite[1245]: fatal: mysql:/etc/postfix/mysqlvirtualalias_maps.cf(0,100): table lookup problem
I did come across a post on the forums here:
I un-chroot'd the things mentioned, and then it seemed to work. I also chroot'd them back and tried the mount trick, and again, I was able to receive mail. So I guess those are my solutions. Not sure about the security involved in doing that way though.
What I'm curious about though is how come I get errors when using proxy:mysql: as described in the link you gave? Is there a way to fix it? I assume using proxy:mysql: is better, but I can't figure out how to make it work.
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, hash:/var/lib/mailman/data/virtual-mailman
virtual_gid_maps = static:105
virtual_mailbox_base = /var/spool/virtual/
#virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_domains = /etc/postfix/vdomains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit = 51200000
#virtual_minimum_uid = 106
virtual_transport = virtual
virtual_uid_maps = static:108
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
virtual_overquota_bounce = yes
Watch the hashed out stuff - i only use the db for user look up, i have a script that periodicly generates hash files for vdomains.
in master.cf
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd
# -o content_filter=smtp-amavis:[127.0.0.1]:10024
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - - 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - n n - - proxymap
smtp unix - - - - - smtp
relay unix - - - - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
make note of the smtp and smtpd settings
I won't worry about setting up the proxy map stuff then. I doubt I'd ever have enough users on my box to need any optimization it might provide.
I guess the only other thing I'm wondering is if there's any way in particular to still have the actual unix accounts get their mail like before. There's a cron job, for example, which I now get its output through