Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Apr 29, 2013 5:56 pm 
Offline
Senior Newbie

Joined: Mon Apr 29, 2013 5:12 pm
Posts: 7
I'm trying to set up a mail server on my Linode running Ubuntu 12.04 LTS. I started by following this tutorial in its entirety:

http://www.exratione.com/2012/05/a-mail ... cot-mysql/

I was able to install alpine and send/receive mail with that setup, but I couldn't set up my local mail client (Postbox on OSX 10.8). I checked the /var/log/mail.log and the most relevant line was:

Code:
Apr 29 16:50:28 cosmos dovecot: pop3-login: Login: user=<casey@friday-next.com>, method=PLAIN, rip=71.144.19.194, lip=72.14.178.224, mpid=2465, TLS
Apr 29 16:50:28 cosmos dovecot: pop3(casey@friday-next.com): Error: user casey@friday-next.com: Couldn't drop privileges: Mail access for users with UID 150 not permitted (see first_valid_uid in config file, uid from userdb lookup).


I did set up the vmail user as uid 150 (per the prior linked tutorial) from these lines:

Code:
useradd -r -u 150 -g mail -d /var/vmail -s /sbin/nologin -c "Virtual maildir handler" vmail
mkdir /var/vmail
chmod 770 /var/vmail
chown vmail:mail /var/vmail


And I adjusted user and pw query in dovecot-sql.conf.ext as such:

Code:
# Define the query to obtain a user password.
password_query = \
  SELECT username as user, password, '/var/vmail/%d/%n' as userdb_home, \
  'maildir:/var/vmail/%d/%n' as userdb_mail, 150 as userdb_uid, 8 as userdb_gid \
  FROM mailbox WHERE username = '%u' AND active = '1'

# Define the query to obtain user information.
user_query = \
  SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, \
  150 AS uid, 8 AS gid, concat('dirsize:storage=', quota) AS quota \
  FROM mailbox WHERE username = '%u' AND active = '1'


So I'm guessing there's a database connection issue, or a permissions issue with uid 150. Now Postfix isn't sending or receiving mail, nor can I connect via POP3 (my connection of choice). I'm hoping someone here will have an idea as to how I can get my mail working.

Here's the output of postconf -n:

Code:
casey@cosmos:~$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
enable_original_recipient = no
header_checks = regexp:/etc/postfix/header_checks
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
message_size_limit = 30720000
mydestination = mail.friday-next.com, localhost, localhost.localdomain
myhostname = mail.friday-next.com
mynetworks = 127.0.0.0/8
myorigin = /etc/mailname
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:150
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_transport = dovecot
virtual_uid_maps = static:150


Top
   
PostPosted: Mon Apr 29, 2013 6:48 pm 
Offline
Senior Newbie

Joined: Mon Apr 29, 2013 5:12 pm
Posts: 7
Okay, I fixed the initial problem by finding that I had GID set to 8 in the password_query and user_query in dovecot-sql.conf.ext. I changed them from '8' to '150', and I finally connected via my OSX mail client. The issue now is that when I try to send a message, I get this error:

Code:
Apr 29 17:45:46 cosmos postfix/error[3307]: 06F7B30ECF: to=<casey.friday@gmail.com>, relay=none, delay=0.01, delays=0.01/0/0/0, dsn=4.3.0, status=deferred (mail transport unavailable)


And when I watch a message attempt to be received, I see this error in the log, stating that relay access is denied:

Code:
Apr 29 17:47:47 cosmos postfix/smtpd[3328]: connect from mail-oa0-f44.google.com[209.85.219.44]
Apr 29 17:47:47 cosmos dovecot: auth: Debug: auth client connected (pid=3328)
Apr 29 17:47:47 cosmos postfix/smtpd[3328]: NOQUEUE: reject: RCPT from mail-oa0-f44.google.com[209.85.219.44]: 554 5.7.1 <casey@friday-next.com>: Relay access denied; from=<casey.friday@gmail.com> to=<casey@friday-next.com> proto=ESMTP helo=<mail-oa0-f44.google.com>


Top
   
PostPosted: Mon Apr 29, 2013 10:50 pm 
Offline
Senior Newbie

Joined: Mon Apr 29, 2013 5:12 pm
Posts: 7
The email server is working with everything except receiving mail via POP3. I can send mail with my OSX email client, and I can send via alpine. I can receive / read mail in alpine, but I can't receive mail in my OSX email client.

Ideas?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group