Postfix, Dovecot, Ubuntu 12.04 - "Mail access not permitted"
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:
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).</casey@friday-next.com>
I did set up the vmail user as uid 150 (per the prior linked tutorial) from these lines:
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:
# 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:
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
2 Replies
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)</casey.friday@gmail.com>
And when I watch a message attempt to be received, I see this error in the log, stating that relay access is denied:
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></mail-oa0-f44.google.com></casey@friday-next.com></casey.friday@gmail.com></casey@friday-next.com>
Ideas?