postfix/dovecot issues
I'm a newbie to linux trying to setup postfix on my ubuntu box to work with my website.
I followed the setup procedure at http://flurdy.com/docs/postfix/ Now when i test the server using telnet i run into problems. Here's what i'm running: Code:
telnet fmxstudio.com 25 Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version |
I would recommend using the following documents.
http://www.postfix.org/INSTALL.html http://www.postfix.org/BASIC_CONFIGURATION_README.html You will not need the first if you are using the version that comes with Ubuntu. It is best to make as few changes as possible in the beginning. This will help you understand how Postfix works. Once you have the basic Postfix working with local accounts, you can try using it with virtual accounts. When you have that working, you can add ssl. |
Thanks much. I was able to figure out what needed to be fixed. In the mysql files, host=localhost needed to be changed to host=127.0.0.1
But now i'm running into more issues. when i telnet in, or send mail to the server otherwise, i put in the recipient as address@fmxstudio.com but postfix changes this. Looking at the logs i see that "orig_to" is address@fmxstudio.com but then "to" is either address/@fmxstudio.com or someotheraddress/@fmxstudio.com and then that postfix can't find the "to" mailbox. Explanation? |
Take a look at the following files:
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf Are you using the Maildir mailbox format? The Maildir format requires a / at the end. This is normally done by adding / to the user name during the search. For example, with ldap the virtual_mailbox_maps file will look like: server_host = ldap://mail.testcompany.com:389 version = 3 search_base = cn=users,dc=testcompay,dc=com query_filter = (&(mail=%s) (objectClass=user)) result_attribute = samaccountname result_format = %s/ bind_dn = postfix bind_pw = DFD321 The result format adds / to the user account. On the other hand, the virtual_alias_maps file will look like this: server_host = ldap://mail.testcompany.com:389 version = 3 search_base = cn=users,dc=testcompay,dc=com query_filter = (&(mail=%s) (objectClass=user)) result_attribute = samaccountname bind_dn = postfix bind_pw = DFD321 There is no result format. |
Wow, my files look nothing like that. Instead i've got
Code:
# /etc/postfix/mysql_mailbox.cf Code:
# /etc/postfix/mysql_alias.cf |
The differences between my files and yours are not so shocking. I use ldap for virtual users and you use MySQL. The same principles are common to both formats.
/etc/postfix/mysql_mailbox.cf tells Postfix the mailbox in which the mail must be stored. /etc/postfix/mysql_alias.cf tells Postfix the user to whom the mail must be addressed. You have select_field=maildir in both files. I don't think this is correct. The format for the maildir value is "username/. If the user name is daled, the maildir (mailbox) value will be daled/. select_field=maildir should work for /etc/postfix/mysql_mailbox.cf since this file shows mailbox information. Is there another field such as user or username that you can use in the /etc/postfix/mysql_alias.cf? This file shows the username to whom the mail should be addressed. Quote:
|
Thanks much jamrock! That really helped and now postfix doesn't bounce back the incoming email! now to get dovecot imap authentication working to actually view the mail...
|
Alright, so I've finally gotten dovecot IMAP authentication working. The only problem now is that when i try to read the mail in the inbox, it's not there!
When i send the message (via telnet) the mail log reports: Code:
Aug 23 22:24:54 linux9 postfix/smtpd[4336]: connect from localhost[127.0.0.1] Code:
1 OK Logged in. |
I use Dovecot for POP3 not IMAP. Not sure how much of a difference this will make.
I see the following line in your main.cf. virtual_mailbox_base = /var/spool/mail/virtual The mailboxes should therefore be created in sub directories below this. You should see the username and below that the new, cur and tmp directories. New mail should be placed in the directory called new. Do you see the mail there? You can use the ll or ls commands to check. In your dovecot.conf file you should have the following line: mail_location = maildir:/var/spool/mail/virtual/%u This tells Dovecot where to look for the mail. Is it pointing to the correct location? |
jamrock, youre the best. I changed the setting in the dovecot.conf and also noticed that my postfix query to get the mailbox for a user didn't get the directory but the user's email address, which wasn't right. It works now and I can view the emails on my client! thanks so much!
|
All times are GMT -5. The time now is 04:46 PM. |