HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Configuration Issues with Virtual Users on Postfix/Courier/MySQL Fedora 12 (http://www.howtoforge.com/forums/showthread.php?t=45707)

issac 9th May 2010 20:00

Configuration Issues with Virtual Users on Postfix/Courier/MySQL Fedora 12
 
I can feel brain goop leaking from my nose.

http://www.howtoforge.com/virtual-us...dora-12-x86_64

I was following the above guide to get a mail server up and running. The major difference in it all is the fact that my server is running i686, but I compensated for that easily, just a difference in folder/RPM names.

Otherwise I followed it to a "T." Everything seemed to go smoothly, no trips or falls until the very end.

After installing squirrelmail and trying to login on admin@withfrosted.com returns ERROR: Connection dropped by IMAP server.

Uncle google tells me to run this command because SELinux is overzealous:
setsebool -P httpd_can_network_connect=1

And that works, and I thought I was home free. However, after that, I'm presented with a new error. I forget exactly what it was. However, google told me to send an email to create the mailbox because it wasn't there, yet. So I send a test email on over, but that fails, and so does mailx. So there's a lot goofed up, here.

Next I created /home/vmail/withfrosted.com/admin while logged into the vmail user for proper permissions. Squirrelmail now logs into the mail box but gives me yet another new error, in which I am now stuck on:
ERROR:
ERROR: Could not complete request.
Query: SELECT "INBOX"
Reason Given: Unable to open this mailbox.

As a summary, because I'm all over the place, here:
1. Can't view the mailbox via Squirrelmail.
2. Can't receive email, tried with mailx and a test email from gmail.

Regarding #2, the gmail test email, from the maillog:
Quote:

May 9 07:25:45 withfrosted postfix/smtpd[21095]: connect from mail-qy0-f177.google.com[209.85.221.177]
May 9 07:25:45 withfrosted postfix/smtpd[21095]: 26CE516241D: client=mail-qy0-f177.google.com[209.85.221.177]
May 9 07:25:45 withfrosted postfix/cleanup[21104]: 26CE516241D: message-id=<z2pe336661a1005090425zaee8dc71jc3002cb7cb25e0f a@mail.gmail.com>
May 9 07:25:45 withfrosted postfix/qmgr[19083]: 26CE516241D: from=<issact@gmail.com>, size=1866, nrcpt=1 (queue active)
May 9 07:25:45 withfrosted amavis[21024]: (21024-01) (!)connect_to_sql: unable to connect to DSN 'DBI:mysql:database=mail;host=127.0.0.1;port=3306' : Can't connect to MySQL server on '127.0.0.1' (13)
May 9 07:25:45 withfrosted amavis[21024]: (21024-01) (!!)TROUBLE in process_request: connect_to_sql: unable to connect to any dataset at (eval 98) line 241, <GEN15> line 5.
May 9 07:25:45 withfrosted amavis[21024]: (21024-01) (!)Requesting process rundown after fatal error
May 9 07:25:45 withfrosted postfix/smtp[21105]: 26CE516241D: to=<admin@withfrosted.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.2, delays=0.11/0.01/0.01/0.07, dsn=4.3.2, status=deferred (host 127.0.0.1[127.0.0.1] said: 421 4.3.2 Service shutting down, closing channel (in reply to RCPT TO command))
May 9 07:26:15 withfrosted postfix/smtpd[21095]: disconnect from mail-qy0-f177.google.com[209.85.221.177]
(What's really odd? No bounceback email in my gmail inbox! I'm assuming that sprouts from the DSN error returned, here.)

If you all need any more information at all, just please reply and let me know. I would really appreciate any leads. I generally don't like littering forums with useless topics, and I honestly don't mean to. I promise that I looked as hard as I could on this one, literally all night and now I'm at work. >.> Mailservers are my weak spot, they shotgun my brain-power.

falko 10th May 2010 14:09

Please disable SELinux and try again.

issac 10th May 2010 14:50

EDIT:

D'oh. Just sent myself another test email and everything looks a-okay.
But now I know more specifically what the problem is. Thanks so much for your help. :)

I'm going to research fixing SELinux, but please let me know if you have any guidance to share. :D

-------------
Heya falko,

Just disabled selinux, still experiencing the same issue:

ERROR:
ERROR: Could not complete request.
Query: SELECT "INBOX"
Reason Given: Unable to open this mailbox.

Thanks for taking the time. :) What do you suggest, next?

falko 11th May 2010 15:10

Did you send an email to that mail box before you tried to log in?
What's the output of
Code:

getenforce
?
Any errors in your mail log now?

issac 11th May 2010 16:06

getenforce returns "Permissive"

I re-enabled SELinux and everything is now working as it should, and I'm not exactly sure why that is. I can create new accounts, send them their first email, and everything is good to go.

If you have any idea why that is, I would love to know.

helicoptermcbill 19th July 2010 21:10

Virtual and non-virtual users
 
Falko,

I too followed the tutorial to the letter, had the same problem with i686. Since I have used many of your tutorials, I have learned to adjust on the fly. Here is my issue, prior to using the Postfix/Courier/MySQL tutorial I was running my Fedora 12 server based on your perfect server tutorial minus the ISPConfig part. Therefore I was running Postfix and Dovecot, I shutdown Dovecot and disabled it so it is out of the way. I had trouble logging into my primary mail account, checked the maillog and found an entry about warning, don't put server name in both the hostname and virtual hostname. So I deleted the servers domain from the MySQL database and that error went away. However I could not find emails for my wamtechnology.com account. I change the main.cf for postfix and un-commented the Maildir entry, sent an email with mailx and it showed up in /home/bill.mcdonald/Maildir.

Is is possible to set Postfix up for both virtual and non-virtual accounts and retrieve emails from the server for non-virtual accounts using Thunderbird? I can get my virtual accounts through Squirrelmail just fine, send and receive. It's the non-virtual account I cannot seem to access from Thunderbird or Squirrelmail

Here is my Postfix main.cf

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = all
inet_protocols = all
mydestination = wamtechnology.com, localhost, localhost.localdomain
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
debug_peer_level = 2
debugger command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5 This is the Sendmail-compatible mail posting interface.
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/manThis parameter is obsolete as of Postfix 2.1.
sample_directory = /usr/share/doc/postfix-2.6.5/samples
readme_directory = /usr/share/doc/postfix-2.6.5/README_FILES
myhostname = wamtechnology.com
mynetworks = 127.0.0.0/8
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = "The user you are trying to reach is over quota."
virtual_overquota_bounce = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recip
ient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_
maps
content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings

falko 20th July 2010 14:27

Quote:

Originally Posted by helicoptermcbill (Post 234178)
Is is possible to set Postfix up for both virtual and non-virtual accounts

Yes, but only for different domains.

Any errors in your mail log?

helicoptermcbill 21st July 2010 03:01

The domain is different from the ones in the MySQL database. I have a web server running under the wamtechnology (hostname) domain then two virtual domains. Postfix is receiving mail, for wamtechnology and putting it in Maildir. I just can't seem to connect to the mailbox from Thunderbird. The only error I am getting is a loop back error.

Jul 20 18:56:01 web clamd[1645]: SelfCheck: Database status OK.
Jul 20 19:06:06 web clamd[1645]: SelfCheck: Database modification detected. Forcing reload.
Jul 20 19:06:07 web clamd[1645]: Reading databases from /var/lib/clamav
Jul 20 19:06:13 web clamd[1645]: Database correctly reloaded (806931 signatures)
Jul 20 19:16:13 web clamd[1645]: SelfCheck: Database status OK.
Jul 20 19:22:55 web postfix/qmgr[1774]: A03CBA968A: from=<root@web.wamtechnology.com>, size=1353, nrcpt=1 (queue active)
Jul 20 19:22:55 web postfix/smtp[2653]: A03CBA968A: to=<root@web.wamtechnology.com>, relay=none, delay=25576, delays=25576/0.08/0/0, dsn=5.4.6, status=bounced (mail for web.wamtechnology.com loops back to myself)
Jul 20 19:22:55 web postfix/cleanup[2656]: 7AAFAA9689: message-id=<20100721002255.7AAFAA9689@wamtechnology.com>
Jul 20 19:22:55 web postfix/qmgr[1774]: 7AAFAA9689: from=<>, size=3306, nrcpt=1 (queue active)
Jul 20 19:22:55 web postfix/bounce[2654]: A03CBA968A: sender non-delivery notification: 7AAFAA9689
Jul 20 19:22:55 web postfix/qmgr[1774]: A03CBA968A: removed
Jul 20 19:22:55 web postfix/smtp[2653]: 7AAFAA9689: to=<root@web.wamtechnology.com>, relay=none, delay=0.14, delays=0.13/0.01/0/0, dsn=5.4.6, status=bounced (mail for web.wamtechnology.com loops back to myself)
Jul 20 19:22:55 web postfix/qmgr[1774]: 7AAFAA9689: removed

I can connect to the virtual mailboxes through Squirrelmail.

Bill

falko 21st July 2010 13:49

Add web.wamtechnology.com to the mydestination line in /etc/postfix/main.cf and restart Postfix.

helicoptermcbill 22nd July 2010 03:09

Okay,

I followed the above advice to correct the error. However, I still cannot get Thunderbird to connect to the incoming pop3 or imap courier server. I can send emails through that server using the wamtechnology.com account, but not retrieved them. The wamtechnology account is a non virtual that uses a system account. I can authenticate using authtest so that part is working. I made this change to the authdaemonrc file to get the authentication working for this account

authmodulelist="authpam authmysql"

Oh, and I just found out I can access this email account through Squirrelmail, so if I cannot get Thunderbird to connect, I may be able to live without it.

Thanks,

Bill.


All times are GMT +2. The time now is 06:41.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.