[Dovecot] Lost %d variable
I'm trying to set up sieve with dovecot, and for some reason, sieve is not getting the %d variable that is part of the path to where its script should be.
Here's the version:
ops:/var/log/mail# dovecot --version
1.2.13
And, here's the configuration (I've left it all for reference, but moved the lda & plugins portions together and marked them out):
ops:/var/log/mail# dovecot -n
# 1.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-3-686 i686 Debian 4.0 ext3
log_path: /var/log/mail/dovecot.log
info_log_path: /var/log/mail/dovecot.info
log_timestamp: %Y-%m-%d %H:%M:%S
protocols: imap imaps pop3 pop3s
ssl_parameters_regenerate: 0
disable_plaintext_auth: no
verbose_ssl: yes
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
mail_location: maildir:/var/mail/%d/%n:CONTROL=/var/mail/%d/%n:INDEX=/var/mail/%d/%n:INBOX= /var/mail/%d/%n
mbox_write_locks: fcntl dotlock
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
----------- Start lda/sieve part --------------
lda:
log_path: /var/log/mail/deliver-errors.log
info_log_path: /var/log/mail/deliver.log
postmaster_address: aladdin@csunv.com
mail_plugin_dir: /usr/lib/dovecot/modules/lda
mail_plugins: sieve
plugin:
sieve: /var/mail/%d/%n/.sieve
----------- End lda/sieve part --------------
auth default:
verbose: yes
passdb:
driver: passwd-file
args: /etc/dovecot/passwd.dovecot
userdb:
driver: static
args: uid=vmail gid=vmail home=/var/mail/home/%u
userdb:
driver: passwd
plugin:
sieve: /var/mail/%d/%n/.sieve
And, here is the log output:
ops:/var/log/mail# cat deliver-errors.log
2010-09-11 18:23:46 deliver(aladdin): Error: sieve: failed to stat user's sieve script: stat(/var/mail//aladdin/.sieve) failed: Not a directory (using global script path in stead)
2010-09-11 18:23:46 deliver(aladdin): Error: stat(/var/mail//aladdin/tmp) failed: Not a directory
Obviously, the double slashes shouldn't be there; there should be the domain name: /var/mail/csunv.com/aladdin
The "regular" dovecot gets the path fine; that is also where it puts the mail, and I'm getting mail just fine.
TIA,
Allen
On 9/12/2010 7:24 AM, Aladdin wrote:
I'm trying to set up sieve with dovecot, and for some reason, sieve is not getting the %d variable that is part of the path to where its script should be.
Something like what's described here comes to mind:
http://wiki.dovecot.org/DomainLost
Regards,
Stephan.
Thanks, Stephan, for the quick reply.
Unfortunately, that doesn't seem to be the problem. I don't have any of the configuration options set to which that wiki page refers and I'm not using SQL; furthermore, I set the "auth_debug" variable which that page also recommended and it does not show any modification of the user/domain variables. My logs and errors are identical to those on my OP.
What else could be the problem?
Thanks, Allen
-----Original Message----- From: Stephan Bosch [mailto:stephan@rename-it.nl] Sent: Sunday, September 12, 2010 3:37 AM To: anw-dist@infoisland.net Cc: Aladdin; dovecot@dovecot.org Subject: Re: [Dovecot] Lost %d variable
On 9/12/2010 7:24 AM, Aladdin wrote:
I'm trying to set up sieve with dovecot, and for some reason, sieve is not getting the %d variable that is part of the path to where its script should be.
Something like what's described here comes to mind:
http://wiki.dovecot.org/DomainLost
Regards,
Stephan.
On 9/12/2010 6:14 PM, Aladdin wrote:
Thanks, Stephan, for the quick reply.
Unfortunately, that doesn't seem to be the problem. I don't have any of the configuration options set to which that wiki page refers and I'm not using SQL; furthermore, I set the "auth_debug" variable which that page also recommended and it does not show any modification of the user/domain variables. My logs and errors are identical to those on my OP.
What else could be the problem?
I must say I haven toyed with this for a long time.
Well, clearly LDA is using a bare username and not username@domain.tld. Now I am interested in how dovecot-lda is called from your MTA (e.g. from Exim/Postfix/Qmail). Particularly these arguments are interesting (http://wiki2.dovecot.org/LDA):
-d <username>: Destination username. If given, the user information is looked up from dovecot-auth. Typically used with virtual users, but not necessarily with system users. -a <address>: Destination address (e.g. user+ext@domain). Default is the same as username.
Also take a look at the MTA-specific pages referenced from the LDA wiki page for examples.
Regards,
Stephan.
OK- and thanks again.
I'll check this out in detail tomorrow, but regarding "Also take a look at the MTA-specific pages...", I basically cut and pasted them into my exim4 conf file. I'll go through this in detail and post again.
-----Original Message----- From: dovecot-bounces+aladdin=csunv.com@dovecot.org [mailto:dovecot- bounces+aladdin=csunv.com@dovecot.org] On Behalf Of Stephan Bosch Sent: Sunday, September 12, 2010 8:15 PM To: anw-dist@infoisland.net Cc: Aladdin; dovecot@dovecot.org Subject: Re: [Dovecot] Lost %d variable
On 9/12/2010 6:14 PM, Aladdin wrote:
Thanks, Stephan, for the quick reply.
Unfortunately, that doesn't seem to be the problem. I don't have any of the configuration options set to which that wiki page refers and I'm not using SQL; furthermore, I set the "auth_debug" variable which that page also recommended and it does not show any modification of the user/domain variables. My logs and errors are identical to those on my OP.
What else could be the problem?
I must say I haven toyed with this for a long time.
Well, clearly LDA is using a bare username and not username@domain.tld. Now I am interested in how dovecot-lda is called from your MTA (e.g. from Exim/Postfix/Qmail). Particularly these arguments are interesting (http://wiki2.dovecot.org/LDA):
-d <username>: Destination username. If given, the user information is looked up from dovecot-auth. Typically used with virtual users, but not necessarily with system users. -a <address>: Destination address (e.g. user+ext@domain). Default is the same as username.
Also take a look at the MTA-specific pages referenced from the LDA wiki page for examples.
Regards,
Stephan.
-----Original Message----- From: dovecot-bounces+aladdin=csunv.com@dovecot.org [mailto:dovecot- bounces+aladdin=csunv.com@dovecot.org] On Behalf Of Aladdin Sent: Monday, September 13, 2010 12:53 AM To: 'Stephan Bosch' Cc: dovecot@dovecot.org Subject: Re: [Dovecot] Lost %d variable
OK- and thanks again.
I'll check this out in detail tomorrow, but regarding "Also take a look at the MTA-specific pages...", I basically cut and pasted them into my exim4 conf file. I'll go through this in detail and post again.
-----Original Message----- From: dovecot-bounces+aladdin=csunv.com@dovecot.org [mailto:dovecot- bounces+aladdin=csunv.com@dovecot.org] On Behalf Of Stephan Bosch Sent: Sunday, September 12, 2010 8:15 PM To: anw-dist@infoisland.net Cc: Aladdin; dovecot@dovecot.org Subject: Re: [Dovecot] Lost %d variable
On 9/12/2010 6:14 PM, Aladdin wrote:
Thanks, Stephan, for the quick reply.
Unfortunately, that doesn't seem to be the problem. I don't have any of the configuration options set to which that wiki page refers and I'm not using SQL; furthermore, I set the "auth_debug" variable which that page also recommended and it does not show any modification of the user/domain variables. My logs and errors are identical to those on my OP.
What else could be the problem?
I must say I haven toyed with this for a long time.
Well, clearly LDA is using a bare username and not username@domain.tld. Now I am interested in how dovecot-lda is called from your MTA (e.g. from Exim/Postfix/Qmail). Particularly these arguments are interesting (http://wiki2.dovecot.org/LDA):
-d <username>: Destination username. If given, the user information is looked up from dovecot-auth. Typically used with virtual users, but not necessarily with system users. -a <address>: Destination address (e.g. user+ext@domain). Default is the same as username.
Also take a look at the MTA-specific pages referenced from the LDA wiki page for examples.
Regards,
Stephan.
Sorry about the top posts; I thought that was netiquette for this list, but was reminded on another list, and now see that this list doesn't top post either.
OK, I've checked this out, and *seemed* to fix it. I've move on to a new error, but will not hijack my own thread. However, this fix has raised a couple of questions.
I'm using exim4 with strictly system users. As stated earlier, I just cut-and-pasted the section from the wiki into my exim4 file, so I started out with this entry:
command = /usr/lib/dovecot/deliver
which according to the wiki should work. Based on this response, I changed it to this, which was cut from the *Virtual Users* section of the wiki:
command = /usr/lib/dovecot/deliver -d $local_part@$domain -f $sender_address -a $original_local_part@$original_domain
This raises several questions, so, in the interest of fooling myself into believing I understand this, I'm going to ask them:
As printed in the wiki and quoted by Stephan, the documentation says, "-d <username>: Destination username. If given, the user information is looked up from dovecot-auth. Typically used with virtual users, but not necessarily with system users." So, why did I have to use it here?
Why do the -f and -a switches have to be given? Aren't those things unchanged in the mail header?
TIA, Allen
On 2010-09-13 12:51 PM, Aladdin aladdin@csunv.com wrote:
Sorry about the top posts; I thought that was netiquette for this list, but was reminded on another list, and now see that this list doesn't top post either.
Thanks for your efforts, but bottom/inline posting without trimming the quoted text is even worse than top-posting...
Please endeavor to trim your quoted text to include only the relevant.
:)
--
Best regards,
Charles
On 2010-09-13 12:51 PM, Aladdinaladdin@csunv.com wrote: Thanks for your efforts, but bottom/inline posting without trimming the quoted text is even worse than top-posting...
Please endeavor to trim your quoted text to include only the relevant.
:) Hmm. Looks like latest Thunderbird suddenly prevents me from doing just
Op 13-9-2010 19:02, Charles Marcus schreef: that in a sensible manner. If I try to delete parts of the (top-level) quoted text, all gets removed :/ Anyone else seen this bug?
Regards,
Stephan.
On 2010-09-13 1:08 PM, Stephan Bosch stephan@rename-it.nl wrote:
Hmm. Looks like latest Thunderbird suddenly prevents me from doing just that in a sensible manner. If I try to delete parts of the (top-level) quoted text, all gets removed :/ Anyone else seen this bug?
I wouldn't notice, since I use the feature of highlighting only the relevant text before hitting Reply-To-List, so that only what I've highlighted is quoted...
But I just tested, and I was able to delete selected parts of the quoted text above my reply with no problem...
An extension issue maybe?
--
Best regards,
Charles
On Mon, 2010-09-13 at 12:51 -0400, Aladdin wrote:
command = /usr/lib/dovecot/deliver
which according to the wiki should work.
Yeah.. It's for system user setups, which means there are no domains.
command = /usr/lib/dovecot/deliver -d $local_part@$domain -f $sender_address -a $original_local_part@$original_domain
This raises several questions, so, in the interest of fooling myself into believing I understand this, I'm going to ask them:
- As printed in the wiki and quoted by Stephan, the documentation says, "-d <username>: Destination username. If given, the user information is looked up from dovecot-auth. Typically used with virtual users, but not necessarily with system users." So, why did I have to use it here?
Because Postfix doesn't add @domain to USER environment.
- Why do the -f and -a switches have to be given? Aren't those things unchanged in the mail header?
If -a isn't given, it's taken from Envelope-To: header. I don't know if Postfix adds this header.
If -f isn't given, it's taken from Return-Path: header. Postfix adds this header, so this shouldn't be necessary.
Of course, it's possible that the actual original addresses differ from what is written to headers (like +ext part could be dropped).
On Mon, 2010-09-13 at 12:51 -0400, Aladdin wrote:
command = /usr/lib/dovecot/deliver
which according to the wiki should work.
Yeah.. It's for system user setups, which means there are no domains.
Ha! So *that* explains why there was no domain in being picked up for me to use in the file path. Makes perfect sense now.
command = /usr/lib/dovecot/deliver -d $local_part@$domain -f $sender_address -a $original_local_part@$original_domain
<snip> > > 1. As printed in the wiki and quoted by Stephan, the documentation > says, "-d > > <username>: Destination username. If given, the user information is > looked > > up from dovecot-auth. Typically used with virtual users, but not > necessarily > > with system users." So, why did I have to use it here? > > Because Postfix doesn't add @domain to USER environment. > > > 2. Why do the -f and -a switches have to be given? Aren't those > things > > unchanged in the mail header? > > If -a isn't given, it's taken from Envelope-To: header. I don't know if > Postfix adds this header. > > If -f isn't given, it's taken from Return-Path: header. Postfix adds > this header, so this shouldn't be necessary. > > Of course, it's possible that the actual original addresses differ from > what is written to headers (like +ext part could be dropped).
I'm not using Postfix (exim4/dovecot), but to the extent exim4 behaves the same way, this, too, makes perfect sense. Actually, my exim4 config should be adding both the Envelope-To and the Return-Path headers, so it's probably superfluous.
Thanks! For me, that closes out this topic (although there still may be some TB-deleting discussions going on;-). I'm now having problems with auth-master and userdb stuff, but going to do a little RTFM'ing and Googlin' before posting, then open a new topic if I can't get it right on my on.
Thanks to everyone for the help!
Regards, Allen
On Sun, 2010-09-12 at 01:24 -0400, Aladdin wrote:
mail_location: maildir:/var/mail/%d/%n:CONTROL=/var/mail/%d/%n:INDEX=/var/mail/%d/%n:INBOX= /var/mail/%d/%n
This looks wrong- maildir:/var/mail/%d/%n it should be maildir:/var/mail/%d/%n/Maildir
and it appears strange that you're using INBOX=... but, it is your system you should know what you're doing with those options.
plugin:
sieve: /var/mail/%d/%n/.sieve
----------- End lda/sieve part --------------
userdb:
driver: static args: uid=vmail gid=vmail home=/var/mail/home/%u
??????? you are not specifying %d this also doesnt look right based on other information you have supplied /home/ ?? I suspect this section here is the main culprit, but it has been a long time since I've used any non mysql based solution, so I could be rusty.
userdb:
driver: passwd
plugin:
sieve: /var/mail/%d/%n/.sieve
And, here is the log output:
ops:/var/log/mail# cat deliver-errors.log
2010-09-11 18:23:46 deliver(aladdin): Error: sieve: failed to stat user's sieve script: stat(/var/mail//aladdin/.sieve) failed: Not a directory (using global script path in stead)
I would expect this error given the above criteria
Well, in case you haven't yet been able to tell, I'm certainly no dovecot guru. For my email address, aladdin@csunv.com, I thought the referenced line would give me a mail location of /var/mail/csunv.com/aladdin, and indeed it does. I would think your way would give me a mail location of /var/mail/csunv.com/aladdin/Maildir, which is not what I want.
This seems to be working fine. Regarding INBOX, I have a directory .INBOX in /var/mail/csunv.com/aladdin, which I think is what I want and is correct. At any rate, using both Outlook/imap and Thunderbird/imap clients I'm accessing my mail and mail folders just fine.
My problem isn't the location of the mail boxes, my problem is that dovecot is not filling in the %d variable in deliver & sieve, while it is doing so in the main part of dovecot just fine and and, again in the main part of dovecot, finding all the mailboxes with no problem. I have none of the issues referenced in Stephan's http://wiki.dovecot.org/DomainLost, and the auth_debug printout shows no change occurring to the user name/domain.
Thanks, Allen
-----Original Message----- From: dovecot-bounces+aladdin=csunv.com@dovecot.org [mailto:dovecot- bounces+aladdin=csunv.com@dovecot.org] On Behalf Of Noel Butler Sent: Sunday, September 12, 2010 6:56 PM To: dovecot@dovecot.org Subject: Re: [Dovecot] Lost %d variable
On Sun, 2010-09-12 at 01:24 -0400, Aladdin wrote:
mail_location:
maildir:/var/mail/%d/%n:CONTROL=/var/mail/%d/%n:INDEX=/var/mail/%d/%n:I NBOX=
/var/mail/%d/%n
This looks wrong- maildir:/var/mail/%d/%n it should be maildir:/var/mail/%d/%n/Maildir
and it appears strange that you're using INBOX=... but, it is your system you should know what you're doing with those options.
plugin:
sieve: /var/mail/%d/%n/.sieve
----------- End lda/sieve part --------------
userdb:
driver: static args: uid=vmail gid=vmail home=/var/mail/home/%u
??????? you are not specifying %d this also doesnt look right based on other information you have supplied /home/ ?? I suspect this section here is the main culprit, but it has been a long time since I've used any non mysql based solution, so I could be rusty.
userdb:
driver: passwd
plugin:
sieve: /var/mail/%d/%n/.sieve
And, here is the log output:
ops:/var/log/mail# cat deliver-errors.log
2010-09-11 18:23:46 deliver(aladdin): Error: sieve: failed to stat user's sieve script: stat(/var/mail//aladdin/.sieve) failed: Not a directory (using global script path in stead)
I would expect this error given the above criteria
participants (5)
-
Aladdin
-
Charles Marcus
-
Noel Butler
-
Stephan Bosch
-
Timo Sirainen