mail to unknown users

Laurence Culhane lists at holmes.demon.co.uk
Wed May 21 04:46:38 EDT 2003


Hi,

After many happy years with a sendmail and mbox setup, I recently
installed cyrus-imapd 2.1.12 to enable a webmail service locally.  All
the spam I get to non-existent users which I'd previously dumped to a
dead-letter box started being replied to by imap.
I needed to divert all mail to non-existent accounts to a mailbox of my
choosing.
I spent ages trying to find a fix but in the end was forced to patch
lmtpd to allow the equivalent functionality of sendmail's luser_relay
option.

I've seen at least one message that indicates someone else has had to do
this in the past.

How does one go about getting the patch adopted into future
distributions?  Does anyone else think this sort of thing is useful?  Is
there a "proper" way of doing this that I've missed in the
documentation?

For those who are interested, this was my quick and dirty patch - I only
delved into the source far enough to find an immediate solution to my
problem.  I'm sure it needs more work before it could be included in a
release - but at least it gives you an idea of what I was trying to
achieve.

Laurence
________________________________
*** lmtpengine.c.orig   2003-04-18 16:13:41.000000000 +0100
--- lmtpengine.c        2003-04-18 16:28:26.000000000 +0100
***************
*** 1113,1116 ****
--- 1113,1117 ----
      char *dest;
      char *user;
+     const char *luser_relay;
      int r, sl;
      address_data_t *ret = (address_data_t *)
xmalloc(sizeof(address_data_t));
***************
*** 1156,1164 ****
        
      r = verify_user(user, ignorequota ? -1 : msg->size,
msg->authstate);
!     if (r) {
!       /* we lost */
!       free(ret->all);
!       free(ret);
!       return r;
      }
      ret->user = xstrdup(user);
--- 1157,1170 ----
        
      r = verify_user(user, ignorequota ? -1 : msg->size,
msg->authstate);
!     if (r) { /* Not a valid user or mailbox - or some other error
forward to lmtp_luser_relay */
!       luser_relay = config_getstring("lmtp_luser_relay", "root");
!       r = verify_user(luser_relay, ignorequota ? -1 : msg->size,
msg->authstate);
!       if (r) {
!         /* we lost */
!         free(ret->all);
!         free(ret);
!         return r;
!       }
!       user = luser_relay;
      }
      ret->user = xstrdup(user);









More information about the Info-cyrus mailing list