Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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
Trying 71.224.148.228...
Connected to fmxstudio.com.
Escape character is '^]'.
220 fmxstudio.com ESMTP Postfix
HELO something.something.com
250 fmxstudio.com
MAIL FROM:<fmxstudio@gmail.com>
But then telnet just hangs and i don't get a 250 response. Anybody know what the problem/solution could be? below is my main.cf:
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = fmxstudio.com
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
myorigin = fmxstudio.com
mydestination =
relayhost = outbound.mailhop.org
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
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.
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:
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:
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.
The mail is being sent to address/@fmxstudio.com instead of address@fmxstudio.com because you are using the maildir field in /etc/postfix/mysql_alias.cf.
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]
Aug 23 22:25:25 linux9 postfix/smtpd[4336]: 536A146972: client=localhost[127.0.0.1]
Aug 23 22:25:29 linux9 postfix/cleanup[4340]: 536A146972: message-id=<20100824022525.536A146972@mail.fmxstudio.com>
Aug 23 22:25:29 linux9 postfix/qmgr[3831]: 536A146972: from=<*externaluser*>, size=368, nrcpt=1 (queue active)
Aug 23 22:25:29 linux9 postfix/virtual[4341]: 536A146972: to=<*virtualuser*>, relay=virtual, delay=24, delays=24/0.01/0/0.06, dsn=2.0.0, status=sent (delivered to mailbox)
Aug 23 22:25:29 linux9 postfix/qmgr[3831]: 536A146972: removed
Aug 23 22:25:32 linux9 postfix/smtpd[4336]: disconnect from localhost[127.0.0.1]
As far as i can see, the mail is successfully delivered, but this is returned from dovecot (via telnet):
Code:
1 OK Logged in.
. examine INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1282615847] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
. OK [READ-ONLY] Select completed.
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.