I use Dovecot's deliver as the LDA for Postfix in a virtual user setting. My
maillog reads:
 
Oct 22 00:17:51 mail dovecot: auth(default): master in: USER    1
mark.ruys at in2sports.net service=deliver
Oct 22 00:17:51 mail dovecot: auth-worker(default):
sql(mark.ruys at in2sports.net): SELECT maildir AS home, 5000 AS uid, 5000 AS
gid, CONCAT('dirsize:storage=', round(quota/1000)) AS quota FROM mailbox
WHERE username = 'mark.ruys at in2sports.net' AND active = 1
Oct 22 00:17:51 mail dovecot: auth(default): master out: USER   1
mark.ruys at in2sports.net home=in2sports.net/mark.ruys/   uid=5000
gid=5000        quota=dirsize:storage=10240
Oct 22 00:17:51 mail deliver(mark.ruys at in2sports.net):
msgid=<00c801c6f55e$af416fb0$8801a8c0 at Moskou>: save failed to INBOX
Oct 22 00:17:51 mail deliver(mark.ruys at in2sports.net):
open(in2sports.net/mark.ruys//.temp.mail.in2sports.net.12777.5c70c02bb158bd1
a) failed: No such file or directory
 
The reason is, I'm out of quota. I expected some kind of bounce, but the
message is killed by Amavis because of a bad header:
 
 
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
 
Your message was automatically rejected by Dovecot Mail Delivery Agent.
 
The following reason was given:
Quota exceeded
 
--12684/mail.in2sports.net
Content-Type: message/disposition-notification
 
Reporting-UA: mail.in2sports.net; Dovecot Mail Delivery Agent
Final-Recipient: rfc822; mark.ruys at in2sports.net
 
 
The problem is, there is no recipient (header is missing).
 
Anyone a clue how to fix it? Thanks for some directions.
 
Mark Ruys
 
 
 
Config:
-        Dovecot rc 10
-        postfix-2.3.3-2.mysql.sasl2.vda.fc4
 
dovecot.conf:
protocol imap {
  mail_plugins = quota imap_quota
}
protocol lda {
  postmaster_address = postmaster at in2sports.net
  mail_plugins = quota
  auth_socket_path = /var/run/dovecot/auth-master
}
 
postfix/main.cf:
dovecot_destination_recipient_limit = 1
virtual_transport = dovecot
virtual_create_maildirsize = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql/limits.cfg
virtual_mailbox_limit_override = yes
virtual_overquota_bounce = yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://dovecot.org/pipermail/dovecot/attachments/20061022/b97fdb82/attachment-0002.html>
I investigated the deliver with quota's bug a little more (rc10, mysql,
virtual domains, maildir). My log files reads:
 
deliver(test at ruijs.cc): Info: msgid=<000f01c6fac1$bd4e8670$8801a8c0 at
Moskou>:
save failed to INBOX
deliver(test at ruijs.cc): Info: sieve runtime error: Keep: Generic Error
deliver(test at ruijs.cc): Info: msgid=<000f01c6fac1$bd4e8670$8801a8c0 at
Moskou>:
save failed to INBOX
deliver(test at ruijs.cc): Error:
open(ruijs.cc/test//.temp.in2sports2.vianetworks.nl.13210.72d247ac698d0019)
failed: No such file or directory
deliver(mark at ruijs.cc): Info:
msgid=<dovecot-1162066721-407295-0 at in2sports2.vianetworks.nl>: saved
mail to
Junk
 
Dovecot tries to deliver, but notices quota exceeded. I don't think Sieve is
playing a role here - I added Sieve before I encountered the problem.
 
Two problems:
1)       The .dovecot.lda-dupes can't be written (that's what the
open...failed notice is about).
2)       The Quota Exceed mail seem to contain mal-formed headers (that's
why it the notice-mail ends in my junk-folder).
 
Digging into deliver.c, I noticed that auth_client_put_user_env() changes
the HOME environment from /var/mail (which is ok), to ruijs.cc/test/ (which
is the maildir, relative to /var/mail). And then fopen fails (see the trace
below). So I think that the code
 
    auth_socket = getenv("AUTH_SOCKET_PATH");
    if (auth_socket == NULL)
      auth_socket = DEFAULT_AUTH_SOCKET_PATH;
 
    ret = auth_client_put_user_env(ioloop, auth_socket,
                 destination, process_euid);
    if (ret != 0)
      return ret;
 
    home = getenv("HOME");
    if (home != NULL) {
      /* If possible chdir to home directory so core file
         could be written. If it fails, don't worry. */
      (void)chdir(home);
 
is the key. Should the chdir be done *before* the call to
auth_client_put_user_env()? I'm not familiar with the internal workings of
the Dovecot LDA, so I won't suggest a proper fix. Who will.
 
As for the mal-formed headers, I'll take a look at it later.
 
Mark
 
#0  i_error (format=0x80ac5f7 "open(%s) failed: %m") at failures.c:203
#1  0x0809f900 in dotlock_create (path=0x9ece2c0
"ruijs.cc/test//.dovecot.lda-dupes", dotlock=0x9edfc48, flags=Variable
"flags" is not available.
) at file-dotlock.c:265
#2  0x0809fb71 in file_dotlock_open (set=0x80b9c90, path=0x9ece2c0
"ruijs.cc/test//.dovecot.lda-dupes", flags=0, dotlock_r=0x9ee7920) at
file-dotlock.c:614
#3  0x08056ec5 in duplicate_new (path=0x9ece2c0
"ruijs.cc/test//.dovecot.lda-dupes") at duplicate.c:157
#4  0x080571c6 in duplicate_mark (id=0x9ece270, id_size=55, user=0xbf9edb45
"test at ruijs.cc", time=1162163205) at duplicate.c:195
#5  0x080573c9 in mail_send_rejection (mail=0x9ede7e0, recipient=0xbf9edb45
"test at ruijs.cc", reason=0x9edc218 "Quota exceeded") at
mail-send.c:51
#6  0x08056c51 in main (argc=5, argv=0xbf9ec5d4) at deliver.c:595
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://dovecot.org/pipermail/dovecot/attachments/20061029/c9e2f1a3/attachment-0001.html>
On Sun, 2006-10-22 at 00:51 +0200, Mark Ruijs wrote:> Oct 22 00:17:51 mail deliver(mark.ruys at in2sports.net): > open(in2sports.net/mark.ruys//.temp.mail.in2sports.net.12777.5c70c02bb158bd1a) failed: No such file or directory..> The reason is, I?m out of quota. I expected some kind of bounce, but > the message is killed by Amavis because of a bad header:Is that error really given when it happens? It should give "Out of quota" error then instead.. ..> Content-Type: text/plain; charset=utf-8 > > Content-Disposition: inline > > Content-Transfer-Encoding: 8bit..> The problem is, there is no recipient (header is missing).You showed only the message's body, not its headers (it's a multipart message). It is sent with To headers and all. So as far as I know there are no headers missing. What exactly is Amavis's error message? And what exactly are the headers that it sees? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://dovecot.org/pipermail/dovecot/attachments/20061102/a577ae93/attachment.pgp
On Sun, 2006-10-29 at 02:04 +0100, Mark Ruijs wrote:> Digging into deliver.c, I noticed that auth_client_put_user_env() > changes the HOME environment from /var/mail (which is ok), to > ruijs.cc/test/ (which is the maildir, relative to /var/mail).How's Dovecot supposed to know it's relative to /var/mail? Why does it even work with imap/pop? Don't use relative paths for home directory.. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://dovecot.org/pipermail/dovecot/attachments/20061102/0249e66b/attachment.pgp