Hi Doug,
"home" from your userdb query will dictate where mail will be dropped.
If you want to store in /var/mail/home_mail/<user_without_domain>, then
use %n. You were almost there with /%d/%n in your current configuration,
posted below, just remove the %d completely.
http://wiki.dovecot.org/Variables
The domain part is added by postfix. Postfix most often requires some
kind of domain, and if not added will append one (unless you have an
unorthodox configuration). It's not recommended to remove this feature
from your postfix configuration.
/Tobias
On 2016-06-17 16:10, Doug Hardie wrote:>> On 16 June 2016, at 22:53, Doug Hardie <bc979 at lafn.org> wrote:
>>
>> I am running a small server with a fixed number of users. Postfix is
>> using dovecot lda so that I can run pigeonhole. I have setup a user
>> file with the ids and passwords and everything authenticates properly.
>> Postfix uses that also. However, mail is consistently delivered to
>> user at domain. How do I tell it to deliver to just user? I have
tried
>> setting a variety of different things like:
>>
>> 10-mail.conf:mail_location = maildir:/var/mail/home_mail/%u
>>
>> userdb {
>> driver = static
>> args = uid=2222 gid=2222 home=/var/mail/home_mail/%u
>> }
>>
>> and a few other things. None of them affected the mailbox location.
>> Fortunately, this is a test system as I probably have mucked up the
>> config files by now.
>>
>> ? Doug
>
> here is config:
>
> root at test:/usr/local/etc/dovecot/conf.d # doveconf -n
> # 2.2.22 (fe789d2): /usr/local/etc/dovecot/dovecot.conf
> # Pigeonhole version 0.4.13 (7b14904)
> # OS: FreeBSD 10.3-RELEASE amd64 ufs
> auth_debug = yes
> auth_debug_passwords = yes
> auth_mechanisms = plain login
> auth_verbose_passwords = yes
> base_dir = /var/run/home_mail/
> first_valid_gid = 0
> login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e
> %c %k session=<%{session}> port=%a
> mail_debug = yes
> mail_gid = 2222
> mail_location = maildir:/var/mail/home_mail/%u
> mail_uid = 2222
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope
> encoded-character vacation subaddress comparator-i;ascii-numeric
> relational regex imap4flags copy include variables body enotify
> environment mailbox date index ihave duplicate mime foreverypart
> extracttext
> namespace inbox {
> inbox = yes
> location > mailbox Drafts {
> special_use = \Drafts
> }
> mailbox Junk {
> special_use = \Junk
> }
> mailbox Sent {
> special_use = \Sent
> }
> mailbox "Sent Messages" {
> special_use = \Sent
> }
> mailbox Trash {
> special_use = \Trash
> }
> prefix > }
> passdb {
> args = scheme=CRYPT username_format=%u /usr/local/etc/dovecot/users
> driver = passwd-file
> }
> plugin {
> mail_log_events = delete undelete expunge copy mailbox_delete
> mailbox_rename
> mail_log_fields = uid box msgid size from
> }
> postmaster_address = doug at sermon-archive.info
> protocols = imap
> service auth {
> unix_listener /var/spool/postfix/private/auth {
> group = postfix
> mode = 0660
> user = postfix
> }
> unix_listener auth-userdb {
> group = vmail
> mode = 0666
> user = vmail
> }
> }
> service imap-login {
> inet_listener imap {
> port = 143
> }
> inet_listener imaps {
> port = 993
> ssl = yes
> }
> }
> ssl_cert = </etc/ssl/certs/mail.pem
> ssl_key = </etc/ssl/private/mail.key
> syslog_facility = local0
> userdb {
> args = home=/var/mail/home_mail/%d/%n allow_all_users=yes
> driver = static
> }
> verbose_proctitle = yes
> protocol imap {
> mail_plugins = " mail_log notify"
> }
> protocol pop3 {
> mail_plugins = " mail_log notify"
> }
> root at test:/usr/local/etc/dovecot/conf.d #
>
>
> ? Doug