Email user not created properly

This is my first time setting up postfix and I have followed the guide here: http://library.linode.com/email-guides/ … 8.04-hardy">http://library.linode.com/email-guides/postfix/postfix-courier-mysql-ubuntu-8.04-hardy

However, after I creating 2 user account sales@topdesignblogs.com and test@topdesignblogs.com. I can't connect to my account using my Windows Mail.

I got the following errors:

"Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Your IMAP command could not be sent to the server, due to non-netowrk errors."

"Your IMAP server wishes to alert you to the following: Fatal error: topdesignblogs.com/sales/ No such file or directory"

When I ehlo my localhost. There are no problems. When I telnet, I got the following:

Trying 127.0.0.1…

Connected to localhost.

Escape character is '^]'.

+OK Hello there.

Something different from the tutorial. The tutorial shows "Connected to localhost.localdomain."

When I send emails to my this new accounts, it got bounced back. I look into /var/mail and only saw "tony" file there. No "sales" and "test" file.

Can anyone help? Also after I finish my postfix setup, I got problems connecting to sftp using "tony" as the user name. But I have no problem using ssh. Another problem too… :(

Maybe this might help. My main.cf file:

# 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 (Ubuntu)
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 = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.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 = topdesignblogs.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = topdesignblogs.com, localhost, localhost.localdomain
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
html_directory = /usr/share/doc/postfix/html
message_size_limit = 30720000
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
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains    

6 Replies

@illusime:

virtual_mailbox_base = /home/vmail

I'm not too familiar with how virtual domains in Postfix work, but given this and the /etc/postfix/mysql-virtual_mailboxes.cf suggested in the library article:

user = mail_admin
password = mail_admin_password
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
        FROM users WHERE email='%s'
hosts = 127.0.0.1

it looks to me like you need to create directories under /home/vmail for each domain and user. Try mkdir -p /home/vmail/topdesignblogs.com/sales /home/vmail/topdesignblogs.com/test and see if that helps. (Your mail user will probably need write permission to these directories.)

@illusime:

Trying 127.0.0.1…

Connected to localhost.

Escape character is '^]'.

+OK Hello there.

Hmm, that's a POP3 welcome banner. Are you sure you're telnetting to port 143 and not 110 when checking this?

Vance,

You problem removed the error but it Keeps handing my windows mail, can't seems to retrieve the inbox.

hoopycat,

That was when I telnet localhost 25. When I telnet localhost 143, I got the following…

OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THRE AD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2005 Double Precision, Inc.  See COPYING for distribution information.

Any other help?

Generally when I have setup postfix virtual domains, the directories aren't created until the account in question receives some mail. So if you try to retrieve mail for an account you have not sent any mail, it will fail, as the directories have yet to be created.

Also if you are using IMAP you need (I think) to use qmail style mail boxes.

 # DELIVERY TO MAILBOX
 #
 # The home_mailbox parameter specifies the optional pathname of a
 # mailbox file relative to a user's home directory. The default
 # mailbox file is /var/spool/mail/user or /var/mail/user.  Specify
 # "Maildir/" for qmail-style delivery (the / is required).
 #
 home_mailbox = Maildir/ 

Edit: See if this helps

http://www.linode.com/wiki/index.php/Us … ail_Server">http://www.linode.com/wiki/index.php/User:Kangaby#SetupPostfixMail_Server

I have tried sending email to the user but email got bounced back. The mail system <sales@topdesignblogs.com>: unknown user: "sales"

I'd dump the MySQL tables, and get it working with plain text files first. Once that works, move it over to MySQL bit by bit.

Problem with most tutorials is they assume you know certain stuff, or (like mine) they evolve over may attempts to get stuff to work, and things get left out or forgotten.

They show what to do, but not why you are doing it, (I've tried to explain what I can as I've gone along) and when it doesn't work, you don't know why, because you don't know why you are doing certain things in the first place.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct