[Dovecot] %d is empty in mail_location
I have this in dovecot-postfix.conf:
mail_location = maildir:/home/mail/dnamesum=%12MLd/dname=%Ld/unamesum=%12MLn/uname=%Ln/mail
Yes, it is excessive, but that's just for testing. The pattern I really want is less clear for debugging. In postfix/main.cf I have:
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot-postfix.conf -a "${RECIPIENT}"
I verified through strace that -a "${RECIPIENT}" is in fact getting a full user@domain address. The problem is that %d and %Ld are coming up as empty, and %12MLd is giving me the first 12 hex characters of an md5 of an empty content. It's losing the domain name somewhere. It's in the mail headers and in the -a option. So what else is needed?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 10 May 2010, Phil Howard wrote:
user@domain address. The problem is that %d and %Ld are coming up as empty, and %12MLd is giving me the first 12 hex characters of an md5 of an empty content. It's losing the domain name somewhere. It's in the mail headers and in the -a option. So what else is needed?
Do you re-write the "user" attribute in the passdb?
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBS+kOib+Vh58GPL/cAQIq6ggAlnLzmjfwCMKhtoN2pq5eXIeoPs+fZB7J EJaPHEtEMn5PTsml+DI3ZRjqGVGCz1GhiTOXc18i/LSSDEL5CBhX6cqpaf8wskEX ppZXgQ8h0ogy/yIX1izHqoCEn8FYOtmRA6OgLrOyzP8Fm5DSWnYGFoysLH+fpIdF oelJMmhSOvIGSvmxaPlfZCnV+QbKC7Z74A0VINo7byUgwNPanxDCrE2OjtchEFJi Vul17oXcwVcTfxZXtbcpbucTbsddj+L+5SCzp8Lg9HKcMNnhYSFaijPyE0WscIge sxwYTbKct7HTSlb6SZmxnJbI9B8l43D/AhQX16uPBQec5S88I3Atqg== =Rm2S -----END PGP SIGNATURE-----
On Tue, May 11, 2010 at 04:00, Steffen Kaiser wrote: -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 On Mon, 10 May 2010, Phil Howard wrote: user@domain address. The problem is that %d and %Ld are coming up as empty,
and %12MLd is giving me the first 12 hex characters of an md5 of an empty
content. It's losing the domain name somewhere. It's in the mail headers
and in the -a option. So what else is needed? Do you re-write the "user" attribute in the passdb? I do whatever this means: auth default {
mechanisms = plain login #### passdb passwd-file {
#### args = username_format=%Ln@%Ld /etc/mailauth/ALL.deny
#### deny = yes
#### }
passdb passwd-file {
args = username_format=%Ln /etc/mailauth/%Ld.deny
deny = yes
}
#### passdb passwd-file {
#### args = scheme=crypt username_format=%Ln@%Ld
/etc/mailauth/ALL.passwd
#### }
passdb passwd-file {
args = scheme=crypt username_format=%Ln /etc/mailauth/%Ld.passwd
}
#### userdb passwd-file {
#### args = username_format=%Ln@%Ld /etc/mailauth/ALL.passwd
#### }
userdb passwd-file {
args = username_format=%Ln /etc/mailauth/%Ld.passwd
} The intention of the above is that these passwd-file format files have only
the username part of the full email address being logged in as, and a
separate file be there for each domain. So if I login to IMAP as
phil@example.com, then I would be authenticated by accessing file
"/etc/mailauth/example.com.passwd" and searching for user "phil" in that
file. I would not expect the formatting of what username I search for in these
files to cause the %d variable to lose its content.
So what I am wondering, right now, is where the value for %d ... as used in mail_location ... comes from when running in dovecot/deliver. Apparently it is not getting anything through that means. Not know where it gets it from, I don't know where to look to see what is misconfigured.
Hi,
You are stripping the domain part of the username with the username_format specifiers:
passdb passwd-file { args = scheme=crypt username_format=%Ln /etc/mailauth/%Ld.passwd }
userdb passwd-file { args = username_format=%Ln /etc/mailauth/%Ld.passwd }
Try replacing %Ln with %Lu in both these cases.
Chris
Phil Howard wrote:
So what I am wondering, right now, is where the value for %d ... as used in mail_location ... comes from when running in dovecot/deliver. Apparently it is not getting anything through that means. Not know where it gets it from, I don't know where to look to see what is misconfigured.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 11 May 2010, Phil Howard wrote:
actually it looks like, nobody uses passwd-file like you do :)
The doc at http://wiki.dovecot.org/AuthDatabase/PasswdFile would lead to your assumption of operation, that is:
- you auth using user@domain
- look up the user in the domain-specific file without domain
- but you don't overwrite "user", hence, further processing should have the domainin %d
Could you verify that the domain gets stripped by setting mail_debug, auth_verbose and auth_debug?
This page http://wiki.dovecot.org/VirtualUsers catches my eyes:
"In the above examples users are expected to log in as "user@domain". Their mail is kept in their home directory at /home/<domain>/<username>/Maildir.
The usernames in the passwd and shadow files are expected to contain only the user part, no domain. This is because the path itself already contained %d to specify the domain. If you want the files to contain full user@domain names, you can use %0.d instead of %d."
This is exactly what you want, IMO.
These pages also describes your idea: http://neranjara.org/article/title/How_to_configure_PostFix_and_Dovecot_for_...
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBS+pku7+Vh58GPL/cAQKbnAf+Ow0xbN3LcUqNWJ0fsZV2wy0o8/LCHjQR RynUPYP5XWGhb4WIwZesmwd7Lo/Pi0l0vnqHKVgRBB827KuvxFJk7Nab7ZI2xM5W 4OHRrPz5SvKQGagoN2p7uf5D3Njdlg4HKoeW0ikp67jR8I8Mu16Mp9BPSv/7eqbL ViulJRqNU4gdnadF/XEh1g+mWFxNAUT6KeMxcihdA+C6FA4wM8NSZqoKScfFD1xp FPin+oN0PebY8I5Pr1zKdCCCn889lShU/GvdKlgqcq80Ue5/NR3X0LcktjdDgyqW Elgq2OyLummQu2aZ0a9ULyZKsoaNYnV4s75C0R1cRM/3uPeXiqPbKQ== =V1gw -----END PGP SIGNATURE-----
On Wed, May 12, 2010 at 04:20, Steffen Kaiser wrote: actually it looks like, nobody uses passwd-file like you do :) This aspect can be changed, if needed. If needed, one big file with
user@domain in the first colon-separated field would be doable, too. The doc at http://wiki.dovecot.org/AuthDatabase/PasswdFile would lead to
your assumption of operation, that is: Yes, the user will need to provide the full user@domain they want to login
as. Just user alone is insufficient in some cases, and even if user fred is
only in one domain today, it might also be in another domain, tomorrow. So
all users will need to login with user@domain. The initial scheme was looking for user by itself in a passwd-file format
file identified with domain name. But this can be changed to looking for
user@domain (which seems pointless unless it is one big file). Overwrite? It looks like my understanding of %n and %u was swapped. But that shouldn't
affect %d. I can't imagine that by using %u it would cause %d to be empty
(as in "oh, domain is already used, can't use it again"). I'd be using CDB format if it were available. So far, passwd-file is the
only plain file format Dovecot supports. Postfix supports CDB and others,
but not passwd-file. I wish there was common ground there. That or the
Berkeley-DB format. Yet another "format" I suggested many years ago is not supported anywhere
(except in some code I wrote unrelated to email). That "format" is where
the key is a file name in a specified directory, and the contents of that
file would be the value yielded. It's a wasteful format in filesystems like
ext2/3, but in reiserfs it works well as long as tail packing is not
disabled. Could you verify that the domain gets stripped by setting mail_debug, auth_verbose and auth_debug? Gonna work on that, today. This page http://wiki.dovecot.org/VirtualUsers catches my eyes: "In the above examples users are expected to log in as "user@domain".
Their mail is kept in their home directory at
/home/<domain>/<username>/Maildir. The usernames in the passwd and shadow files are expected to contain only
the user part, no domain. This is because the path itself already contained
%d to specify the domain. If you want the files to contain full user@domainnames, you can use %0.d instead of %d." This is exactly what you want, IMO. I believe so. But I'm still not so sure Postfix's idea of "virtual users"
is the same. I need to try it both ways. I do know in the past, virtual_*
in Postfix was treating all domains as one and didn't work right for what I
was doing (didn't involve Dovecot way back then). These pages also describes your idea: http://neranjara.org/article/title/How_to_configure_PostFix_and_Dovecot_for_... http://serverfault.com/questions/80590/how-do-i-persuade-dovecot-and-postfix... They do seem to be using %d in the same kind of way I'm expecting to. I'll
look these over to see if any differences in how other parts are configured
can make sure %d has the recipient's domain.
Am 14.05.2010 um 17:05 schrieb Phil Howard:
On Wed, May 12, 2010 at 04:20, Steffen Kaiser
wrote:
Could you verify that the domain gets stripped by setting mail_debug, auth_verbose and auth_debug?
Where would I see the results of this?
In whatever logging facility you set up. It will simply raise verbosity.
Thomas
On Fri, May 14, 2010 at 12:47, Thomas Leuxner tlx@leuxner.net wrote:
Am 14.05.2010 um 17:05 schrieb Phil Howard:
On Wed, May 12, 2010 at 04:20, Steffen Kaiser < skdovecot@smail.inf.fh-brs.de
wrote:
Could you verify that the domain gets stripped by setting mail_debug, auth_verbose and auth_debug?
Where would I see the results of this?
In whatever logging facility you set up. It will simply raise verbosity.
Nothing new is showing up when I test sending some mail through (which does get delivered to that path constructed with an empty string for %).
marconi/root/x1 /root 53# cd /var/log/dovecot marconi/root/x1 /var/log/dovecot 54# ls -l total 8 -rw------- 1 root root 120 2010-05-14 11:26 error.log -rw------- 1 root root 1130 2010-05-14 11:22 info.log marconi/root/x1 /var/log/dovecot 55# cat error.log dovecot: 2010-05-14 11:21:39 Warning: Killed with signal 15 dovecot: 2010-05-14 11:26:52 Warning: Killed with signal 15 marconi/root/x1 /var/log/dovecot 56# cat info.log dovecot: 2010-05-14 11:00:27 Info: dovecot v1.1.11 starting up (core dumps disabled) dovecot: 2010-05-14 11:00:28 Info: auth(default): new auth connection: pid=3233 dovecot: 2010-05-14 11:00:28 Info: auth(default): new auth connection: pid=3234 dovecot: 2010-05-14 11:00:28 Info: auth(default): new auth connection: pid=3236 dovecot: 2010-05-14 11:00:28 Info: auth(default): new auth connection: pid=3235 dovecot: 2010-05-14 11:00:28 Info: auth(default): new auth connection: pid=3237 dovecot: 2010-05-14 11:00:28 Info: auth(default): new auth connection: pid=3238 dovecot: 2010-05-14 11:22:17 Info: dovecot v1.1.11 starting up (core dumps disabled) dovecot: 2010-05-14 11:22:18 Info: auth(default): new auth connection: pid=3328 dovecot: 2010-05-14 11:22:18 Info: auth(default): new auth connection: pid=3327 dovecot: 2010-05-14 11:22:18 Info: auth(default): new auth connection: pid=3329 dovecot: 2010-05-14 11:22:18 Info: auth(default): new auth connection: pid=3326 dovecot: 2010-05-14 11:22:18 Info: auth(default): new auth connection: pid=3330 dovecot: 2010-05-14 11:22:18 Info: auth(default): new auth connection: pid=3331 marconi/root/x1 /var/log/dovecot 57#
Am 14.05.2010 um 19:25 schrieb Phil Howard:
Nothing new is showing up when I test sending some mail through (which does get delivered to that path constructed with an empty string for %).
Which version are you now testing on? Recent posts were set around the beta. Is this for the 2.x beta or this rather old build you're showing here?
Regards Thomas
On Fri, May 14, 2010 at 13:30, Thomas Leuxner tlx@leuxner.net wrote:
Am 14.05.2010 um 19:25 schrieb Phil Howard:
Nothing new is showing up when I test sending some mail through (which does get delivered to that path constructed with an empty string for %).
Which version are you now testing on? Recent posts were set around the beta. Is this for the 2.x beta or this rather old build you're showing here?
It is the version packaged in Ubuntu 9.10 ...
marconi/root/x0 /root 51# dpkg -l | egrep 'dovecot|postfix' ii dovecot-antispam 1.1+20090218.git.g28075fa-2 a Dovecot plugin that helps train spam filte ii dovecot-common 1:1.1.11-0ubuntu11 secure mail server that supports mbox and ma ii dovecot-dev 1:1.1.11-0ubuntu11 header files for the dovecot mail server ii dovecot-imapd 1:1.1.11-0ubuntu11 secure IMAP server that supports mbox and ma ii dovecot-pop3d 1:1.1.11-0ubuntu11 secure POP3 server that supports mbox and ma ii dovecot-postfix 1:1.1.11-0ubuntu11 full mail server stack provided by Ubuntu se ii postfix 2.6.5-3 High-performance mail transport agent ii postfix-cdb 2.6.5-3 CDB map support for Postfix ii postfix-doc 2.6.5-3 Documentation for Postfix ii postfix-pcre 2.6.5-3 PCRE map support for Postfix ii postfix-pgsql 2.6.5-3 PostgreSQL map support for Postfix marconi/root/x0 /root 52#
On Fri, May 14, 2010 at 14:00, Thomas Leuxner tlx@leuxner.net wrote:
Am 14.05.2010 um 19:51 schrieb Phil Howard:
It is the version packaged in Ubuntu 9.10 …
This one is ancient. Also it has configuration syntax changes compared to the latest production release. Anyway the debug parameters should work, given they are in the right conf file...
I've been thinking that as soon as I get this working, I will plan a transition over to a newer server with Slackware instead of Ubuntu. Slackware is easier about letting you run packages you build from source.
Am 14.05.2010 um 20:03 schrieb Phil Howard:
I've been thinking that as soon as I get this working, I will plan a transition over to a newer server with Slackware instead of Ubuntu. Slackware is easier about letting you run packages you build from source.
Probably OT, but did you consider using Stephan Bosch's builds for that?
http://xi.rename-it.nl/debian/pool/testing-auto/dovecot-1.2/
On Fri, May 14, 2010 at 14:06, Thomas Leuxner tlx@leuxner.net wrote:
Am 14.05.2010 um 20:03 schrieb Phil Howard:
I've been thinking that as soon as I get this working, I will plan a transition over to a newer server with Slackware instead of Ubuntu. Slackware is easier about letting you run packages you build from source.
Probably OT, but did you consider using Stephan Bosch's builds for that?
http://xi.rename-it.nl/debian/pool/testing-auto/dovecot-1.2/
No, I haven't. Due to some management policy, that might not even be an option. I've got a couple other ideas for config changes on 1.11 that I still need to try.
On Fri, 2010-05-14 at 14:03 -0400, Phil Howard wrote:
On Fri, May 14, 2010 at 14:00, Thomas Leuxner tlx@leuxner.net wrote:
Am 14.05.2010 um 19:51 schrieb Phil Howard:
It is the version packaged in Ubuntu 9.10 …
This one is ancient. Also it has configuration syntax changes compared to the latest production release. Anyway the debug parameters should work, given they are in the right conf file...
I've been thinking that as soon as I get this working, I will plan a transition over to a newer server with Slackware instead of Ubuntu. Slackware is easier about letting you run packages you build from source.
Indeed it is, and hassle free.
On Mon, May 10, 2010 at 15:21, Phil Howard ttiphil@gmail.com wrote:
I have this in dovecot-postfix.conf:
mail_location = maildir:/home/mail/dnamesum=%12MLd/dname=%Ld/unamesum=%12MLn/uname=%Ln/mail
Yes, it is excessive, but that's just for testing. The pattern I really want is less clear for debugging. In postfix/main.cf I have:
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot-postfix.conf -a "${RECIPIENT}"
I verified through strace that -a "${RECIPIENT}" is in fact getting a full user@domain address. The problem is that %d and %Ld are coming up as empty, and %12MLd is giving me the first 12 hex characters of an md5 of an empty content. It's losing the domain name somewhere. It's in the mail headers and in the -a option. So what else is needed?
There was a typo in an earlier config item:
auth_username_format = %Ln@Ld
Maybe that was what someone was screaming at me about when I looked at username_format. I didn't see this until I was trying to figure out why the passwd file wasn't being read. I ran strace, and saw that it was trying to access a file with "ld" in it. Even then it took a while because the domain had been reformed as "Ld" and subsequently lower cased later.
I found this while trying out a subset of a couple suggested configurations with some virtual_* settings in Postfix, and using dovecot/deliver via transport.
I will now clean up the mess and hope I don't break it doing that. Then slam it with email and see what happens next.
Add in your auth,conf configuration:
auth_default_realm = [your domain]
2010/5/14 Phil Howard ttiphil@gmail.com
On Mon, May 10, 2010 at 15:21, Phil Howard ttiphil@gmail.com wrote:
I have this in dovecot-postfix.conf:
mail_location =
maildir:/home/mail/dnamesum=%12MLd/dname=%Ld/unamesum=%12MLn/uname=%Ln/mail
Yes, it is excessive, but that's just for testing. The pattern I really want is less clear for debugging. In postfix/main.cf I have:
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/dovecot-postfix.conf -a "${RECIPIENT}"
I verified through strace that -a "${RECIPIENT}" is in fact getting a
full
user@domain address. The problem is that %d and %Ld are coming up as empty, and %12MLd is giving me the first 12 hex characters of an md5 of an empty content. It's losing the domain name somewhere. It's in the mail headers and in the -a option. So what else is needed?
There was a typo in an earlier config item:
auth_username_format = %Ln@Ld
Maybe that was what someone was screaming at me about when I looked at username_format. I didn't see this until I was trying to figure out why the passwd file wasn't being read. I ran strace, and saw that it was trying to access a file with "ld" in it. Even then it took a while because the domain had been reformed as "Ld" and subsequently lower cased later.
I found this while trying out a subset of a couple suggested configurations with some virtual_* settings in Postfix, and using dovecot/deliver via transport.
I will now clean up the mess and hope I don't break it doing that. Then slam it with email and see what happens next.
On Fri, May 14, 2010 at 15:51, Alex Baule alexwbaule@gmail.com wrote:
Add in your auth,conf configuration:
auth_default_realm = [your domain]
Which domain goes there? I have many.
On 2010-05-14 3:52 PM, Phil Howard wrote:
On Fri, May 14, 2010 at 15:51, Alex Baule alexwbaule@gmail.com wrote:
Add in your auth,conf configuration:
auth_default_realm = [your domain]
Which domain goes there? I have many.
Whichever one you want to be the 'default' if the user neglects to add a domain to their client username field.
--
Best regards,
Charles
On Sat, May 15, 2010 at 10:10, Charles Marcus CMarcus@media-brokers.comwrote:
On 2010-05-14 3:52 PM, Phil Howard wrote:
On Fri, May 14, 2010 at 15:51, Alex Baule alexwbaule@gmail.com wrote:
Add in your auth,conf configuration:
auth_default_realm = [your domain]
Which domain goes there? I have many.
Whichever one you want to be the 'default' if the user neglects to add a domain to their client username field.
I don't want a default. I want them to get an authentication failure. If that failure could be informative and tell them that the domain is missing, fine (but other aspects like "no such user" vs. "wrong password" vs. "no such domain" I want to be left unexplained, and just be a simple "authentication failed").
On 2010-05-17 9:34 AM, Phil Howard wrote:
On Sat, May 15, 2010 at 10:10, Charles Marcus wrote:
On 2010-05-14 3:52 PM, Phil Howard wrote:
On Fri, May 14, 2010 at 15:51, Alex Baule alexwbaule@gmail.com wrote:
auth_default_realm = [your domain]
Which domain goes there? I have many.
Whichever one you want to be the 'default' if the user neglects to add a domain to their client username field.
I don't want a default. I want them to get an authentication failure.
So... remove the setting...?
--
Best regards,
Charles
On Mon, May 17, 2010 at 10:56, Charles Marcus CMarcus@media-brokers.comwrote:
On 2010-05-17 9:34 AM, Phil Howard wrote:
On Sat, May 15, 2010 at 10:10, Charles Marcus wrote:
On 2010-05-14 3:52 PM, Phil Howard wrote:
On Fri, May 14, 2010 at 15:51, Alex Baule alexwbaule@gmail.com wrote:
auth_default_realm = [your domain]
Which domain goes there? I have many.
Whichever one you want to be the 'default' if the user neglects to add a domain to their client username field.
I don't want a default. I want them to get an authentication failure.
So... remove the setting...?
I currently have it commented out, and will remove that line in the config file completely when I go back to clean everything.
On 2010-05-14 3:37 PM, Phil Howard wrote:
There was a typo in an earlier config item:
auth_username_format = %Ln@Ld
I looked back in this thread and don't see any post where you provided output of dovecot -n...
For future reference, I think this would have been easily seen in the beginning had you done so. One of the things it will do is tell you when there is a syntax error and make typos more evident...
--
Best regards,
Charles
On Sat, May 15, 2010 at 10:22, Charles Marcus CMarcus@media-brokers.comwrote:
On 2010-05-14 3:37 PM, Phil Howard wrote:
There was a typo in an earlier config item:
auth_username_format = %Ln@Ld
I looked back in this thread and don't see any post where you provided output of dovecot -n...
For future reference, I think this would have been easily seen in the beginning had you done so. One of the things it will do is tell you when there is a syntax error and make typos more evident...
I know I posted it, but it might have been in one of the other threads. I overlooked that syntax error several times, myself, so I'm in no position to blame anyone else for that (nor was I expecting someone to directly find a syntax error ... posting the configuration was expected to be more of a help to see how I was doing things in general ... when it was asked for). Sure, extra eyes might have caught it had I posted the config in every thread. But I'm not thinking that a mailing list should be for that.
participants (7)
-
Alex Baule
-
Charles Marcus
-
Christopher Balmain
-
Noel Butler
-
Phil Howard
-
Steffen Kaiser
-
Thomas Leuxner