Sam Varshavchik wrote:
Alessandro Vesely writes:

Sam Varshavchik wrote:
Alessandro Vesely writes:
Sep 12 07:21:12 wmail courierlocal: id=000CA6A9.450554B7.00001F80,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>: Invalid address. Sep 12 07:21:12 wmail courierlocal: id=000CA6A9.450554B7.00001F80,from=<[EMAIL PROTECTED]>,addr=<[EMAIL PROTECTED]>,status: deferred

Addresses are slightly edited, but `archve' is a misspelled command
(meant to get the list archive). couriermlm prints "Invalid address."
and returns a temporary error.

Shouldn't it bounce?

It should.

Now figure out what you did to Courier's configuration that made it accept mail to nonexistent recipients.

Hm... you mean that a regular configuration would have bounced that,
don't you?

I have a .courier-default in aliasdir (I filter it with rcptfilter),
but "mylist" exists as a user, so it should never reach that point.

No, it would.

Apparently it does not. That .courier-default contains a dynamic delivery
(||) call to a script. I inserted logging for each call and got no mention
of that queued message.

 DEFAULT DELIVERY INSTRUCTIONS
     The  /etc/courier/aliasdir  directory  is  searched as the last resort,
     when all attempts to figure out how to deliver mail to a local address
     have failed.

Since no given delivery instructions could be found for the given recipient address, the aliasdir directory gets searched.

The "~mylist"/.courier-default exists. It contains an external program
(|) call to couriermlm ctlmsg. I straced courierd: it finds it but does
not open it. Doesn't look at aliasdir. I also straced courierlocal and
attach a slightly edited output. It shows courierdeliver running
couriermlm in "~mylist".

The dot-courier man page even explicitly tells you this:

     All the usual aspects of .courier deliveries  apply.  If  there  is  no
     account that corresponds to the address <[EMAIL PROTECTED]>, Courier
     looks      for      /etc/courier/aliasdir/.courier-user-foo,       then
     /etc/courier/aliasdir/.courier-user-default,         and        finally
     /etc/courier/aliasdir/.courier-default.

That man page actually mentions .courier-default only in relation to aliasdir.
However, since those are the "usual aspects", one should deduce that
.courier-default is looked for also in the home directory, as it actually
happens.

Logs from the original arrival (via courieresmtpd) of the message show that
the message was accepted and queued. I guess that's correct, as I can't see
how could a wrong command be diagnosed before queueing the relevant message.
Thereafter, the process depicted in the attached strace repeats indefinitely.

I replaced couriermlm with the patched version that returns EX_SOFTWARE.
A dsn has been issued to the user and the message has been purged from the 
queue.
I suggest you apply that patch too.


courierlocal:
883   select(1, [0], NULL, NULL, NULL)  = 1 (in [0])
883   read(0, "829097\t000CA6A9.450554B7.00001F8"..., 256) = 150
883   rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
883   clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x401592e8) 
= 2337
883   time([1158140649])                = 1158140649
883   rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
883   time(NULL)                        = 1158140649
883   select(1, [0], NULL, NULL, {900, 0} <unfinished ...>


courierlocal's child:
2337  rt_sigaction(SIGCHLD, {SIG_DFL}, {0x804a810, [CHLD], SA_RESTART}, 8) = 0
2337  rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
2337  setpgid(0, 0)                     = 0
2337  open("/var/courier/msgs/97/C829097", O_RDWR|O_APPEND) = 4
2337  fcntl64(4, F_SETFD, FD_CLOEXEC)   = 0
2337  fstat64(4, {st_mode=S_IFREG|0660, st_size=4736, ...}) = 0
2337  read(4, "[EMAIL PROTECTED]"..., 4736) = 4736
2337  pipe([5, 6])                      = 0
2337  pipe([7, 8])                      = 0
2337  clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x401592e8) 
= 2338
2337  open("/var/courier/msgs/97/D829097", O_RDONLY) = 9
2337  close(6)                          = 0
2337  close(8)                          = 0
2337  close(9)                          = 0
2337  select(8, [5 7], NULL, NULL, NULL <unfinished ...>


courierlocal's child's child:
2338  open("/var/courier/msgs/97/D829097", O_RDONLY) = 9
2338  close(5)                          = 0
2338  close(7)                          = 0
2338  dup2(8, 2)                        = 2
2338  close(8)                          = 0
2338  dup2(6, 1)                        = 1
2338  close(6)                          = 0
2338  close(0)                          = 0
2338  dup(9)                            = 0
2338  close(4)                          = 0
2338  close(9)                          = 0
2338  chdir("/home/path/mylist") = 0
2338  execve("/usr/local/libexec/courier/modules/local/courierdeliver", 
["courierdeliver", "[EMAIL PROTECTED]", "/home/path/mylist", "archve", "[EMAIL 
PROTECTED]", "[EMAIL PROTECTED]", "", ""], [/* 25 vars */]) = 0

courierdeliver:
2338  socket(PF_FILE, SOCK_DGRAM, 0)    = 3
2338  fcntl64(3, F_SETFD, FD_CLOEXEC)   = 0
2338  connect(3, {sa_family=AF_FILE, path="/dev/log"}, 16) = 0
2338  open("/etc/courier/dotextension", O_RDONLY) = -1 ENOENT (No such file or 
directory)
2338  lstat64("./.courier-archve", 0xbffff98c) = -1 ENOENT (No such file or 
directory)
2338  lstat64("./.courier-default", {st_mode=S_IFREG|0600, st_size=40, ...}) = 0
2338  open(".courier-default", O_RDONLY) = 4
2338  read(4, "| /usr/local/bin/couriermlm ctlm"..., 4096) = 40
2338  close(4)                          = 0
2338  fstat64(0, {st_mode=S_IFREG|0660, st_size=8854, ...}) = 0
2338  read(0, "Received: from truxi.wincor-nixd"..., 4096) = 4096
2338  time([1158140649])                = 1158140649
2338  dup(0)                            = 4
2338  lseek(4, 0, SEEK_SET)             = 0
2338  fcntl64(4, F_GETFL)               = 0 (flags O_RDONLY)
2338  fstat64(4, {st_mode=S_IFREG|0660, st_size=8854, ...}) = 0
2338  _llseek(4, 0, [0], SEEK_CUR)      = 0
2338  clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x401592e8) 
= 2339
2338  wait4(-1,  <unfinished ...>

courierdeliver's child:
2339  dup2(2, 1)                        = 1
2339  dup2(4, 0)                        = 0
2339  close(4)                          = 0
2339  open("/etc/courier/maildrop", O_RDONLY) = 4
2339  fstat64(4, {st_mode=S_IFREG|0644, st_size=24, ...}) = 0
2339  read(4, "/usr/local/bin/maildrop\n", 4096) = 24
2339  close(4)                          = 0
2339  access("/usr/local/bin/maildrop", F_OK) = 0
2339  lseek(0, 0, SEEK_SET)             = 0
2339  execve("/bin/sh", ["/bin/sh", "-c", "/usr/local/bin/couriermlm 
ctlmsg"...], [/* 18 vars */]) = 0

sh:
2339  getcwd("/home/path/mylist", 4096) = 30
2339  getpid()                          = 2339
2339  getppid()                         = 2338
2339  getpgrp()                         = 2337
2339  rt_sigaction(SIGCHLD, {0x8076f20, [], 0}, {SIG_DFL}, 8) = 0
2339  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
2339  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
2339  rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
2339  rt_sigaction(SIGINT, {SIG_IGN}, {SIG_IGN}, 8) = 0
2339  rt_sigaction(SIGQUIT, {SIG_IGN}, {SIG_IGN}, 8) = 0
2339  rt_sigaction(SIGCHLD, {SIG_DFL}, {0x8076f20, [], 0}, 8) = 0
2339  execve("/usr/local/bin/couriermlm", ["/usr/local/bin/couriermlm", 
"ctlmsg", "list"], [/* 21 vars */]) = 0

couriermlm:
2339  rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_DFL}, 8) = 0
2339  rt_sigaction(SIGCHLD, {SIG_DFL}, {SIG_DFL}, 8) = 0
2339  chdir("list")                     = 0
2339  write(2, "I", 1 <unfinished ...>

courierlocal's child:
2337  <... select resumed> )            = 1 (in [7])
2337  read(7, "I", 8192)                = 1
2337  select(8, [5 7], NULL, NULL, NULL <unfinished ...>

couriermlm:
2339  <... write resumed> )             = 1
2339  write(2, "n", 1 <unfinished ...>

read/write exchanges continue several times,
the complete string is "Invalid address.\n"
...

courierlocal's child:
2337  <... select resumed> )            = 1 (in [7])
2337  read(7, "\n", 8192)               = 1
2337  select(8, [5 7], NULL, NULL, NULL <unfinished ...>

couriermlm:
2339  <... write resumed> )             = 1
2339  exit_group(1)                     = ?


courierdeliver:
2338  <... wait4 resumed> [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 
2339
2338  --- SIGCHLD (Child exited) @ 0 (0) ---
2338  exit_group(1)                     = ?


courierlocal's child:
2337  <... select resumed> )            = 1 (in [5])
2337  read(5, "", 8192)                 = 0
2337  close(5)                          = 0
2337  wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 2338
2337  --- SIGCHLD (Child exited) @ 0 (0) ---
2337  time([1158140649])                = 1158140649
2337  rt_sigaction(SIGPIPE, {0x400f8a70, [], 0}, {SIG_DFL}, 8) = 0
2337  send(3, "<22>Sep 13 11:44:09 courierlocal"..., 151, 0) = 151
2337  rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
2337  writev(4, [{"I0 ", 3}, {"R ", 2}, {"Invalid address.", 16}, {"\n", 1}], 
4) = 22
2337  time([1158140649])                = 1158140649
2337  rt_sigaction(SIGPIPE, {0x400f8a70, [], 0}, {SIG_DFL}, 8) = 0
2337  send(3, "<22>Sep 13 11:44:09 courierlocal"..., 150, 0) = 150
2337  rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
2337  time([1158140649])                = 1158140649
2337  writev(4, [{"D", 1}, {"0 ", 2}, {"1158140649", 10}, {"\n", 1}], 4) = 14
2337  time(NULL)                        = 1158140649
2337  open("/var/courier/track/321705", O_RDONLY) = 5
2337  fstat64(5, {st_mode=S_IFREG|0644, st_size=33, ...}) = 0
2337  read(5, "1158140043 [EMAIL PROTECTED]"..., 4096) = 33
2337  read(5, "", 4096)                 = 0
2337  close(5)                          = 0
2337  time(NULL)                        = 1158140649
2337  fsync(4)                          = 0
2337  close(4)                          = 0
2337  exit_group(0)                     = ?

courierlocal:
883   <... select resumed> )            = ? ERESTARTNOHAND (To be restarted)
883   --- SIGCHLD (Child exited) @ 0 (0) ---
883   rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
883   wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 2337
883   write(1, "8\n", 2)                = 2
883   wait4(-1, 0xbffff5e0, WNOHANG, NULL) = -1 ECHILD (No child processes)
883   rt_sigaction(SIGCHLD, {0x804a810, [CHLD], SA_RESTART}, {0x804a810, 
[CHLD], SA_RESTART}, 8) = 0
883   rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
883   sigreturn()                       = ? (mask now [])
883   time(NULL)                        = 1158140649
883   select(1, [0], NULL, NULL, NULL)  = 1 (in [0])
883   read(0, "829133\t000CA6CD.4507D2EF.0000092"..., 256) = 138
883   rt_sigprocmask(SIG_BLOCK, [CHLD], NULL, 8) = 0
883   clone(child_stack=0, 
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x401592e8) 
= 2350
883   time([1158140657])                = 1158140657
883   rt_sigprocmask(SIG_UNBLOCK, [CHLD], NULL, 8) = 0
883   time(NULL)                        = 1158140657
883   select(1, [0], NULL, NULL, {900, 0} <unfinished ...>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to