Re: [vchkpw] Multi domain bounce message handling

2003-10-18 Thread Jochen Schug
Tom Collins wrote:

On Friday, October 17, 2003, at 05:27  PM, David Bristol wrote:

This may not be the way to go about this, but have you verified that
both domains are in the qmail/control/locals file?


Don't put vpopmail domains in control/locals.  You'll mess things up.

There isn't a known solution to what was asked.  Doublebounces go to 
the postmaster of the server.  Bounce messages refer to the name of 
the physical server, and not the domain name.

You might be able to modify qmail-send, but it would be very difficult 
to determine what hostname to use in the bounce message.
There's actually a patch to qmail-send that does this, I've attached it 
to this mail. It was originally posted  on the qmail-list if I remember 
correctly. I've been using it for over a year, and it appears to work 
fine. But I'm not the author - if it doesn't work for you, don't blame me.

What if there are multiple recipients that bounced?
Then there are multiple bounce messages.

What if it's a message one of your user's is trying to send to a 
hotmail address?  You don't want it to say that your server is 
hotmail.com.
Well, I'm no expert - but the local mail server should only generate 
bounces it the mail is directed to one of the local domains. Otherwise, 
it should either not accept the mail at all, or relay it to the 
appropriate MX. If this MX can't deliver the mail, it will generate a 
bounce message on its own.

Regards
Jochen
--- qmail-send.c.orig   Tue Jun 11 17:59:23 2002
+++ qmail-send.cTue Jun 11 17:59:36 2002
@@ -193,6 +193,37 @@
 }
 
 
+int recipdomain(rd,fn2)
+stralloc* rd;
+stralloc fn2;
+{
+ int fd;
+ int ret = 0;
+ 
+ fd = open_read(fn2.s);
+ if (fd != -1)
+  {
+   int r;
+   char inbuf[128];
+   char buf[2];
+   substdio ssread;
+ 
+   buf[0] = 0; buf[1] = 0;
+   substdio_fdbuf(ssread,read,fd,inbuf,sizeof(inbuf));
+   while (((r = substdio_get(ssread,buf,1))  0)  (buf[0] != '@'));
+   if (buf[0] == '@')
+{
+  while (((r = substdio_get(ssread,buf,1))  0)  (buf[0] != ''))
+stralloc_cats(rd,buf);
+  stralloc_0(rd);
+  ret = (buf[0] == '');
+}
+   close(fd);
+  }
+  return ret;
+}
+ 
+ 
 /* this file is too long -- INFO */
 
 int getinfo(sa,dt,id)
@@ -659,8 +690,10 @@
  char inbuf[128];
  static stralloc sender = {0};
  static stralloc quoted = {0};
+ stralloc rdomain = {0};
  datetime_sec birth;
  unsigned long qp;
+ int rd = 0;
 
  if (!getinfo(sender,birth,id)) return 0; /* XXX: print warning */
 
@@ -685,6 +718,10 @@
log3(triple bounce: discarding ,fn2.s,\n);
  else
   {
+   rd = recipdomain(rdomain,fn2);
+   if (rd)
+ log3(modified bouncehost: ', rdomain.s, '\n);
+
if (qmail_open(qqt) == -1)
 { log1(warning: unable to start qmail-queue, will try later\n); return 0; }
qp = qmail_qp(qqt);
@@ -698,7 +735,10 @@
while (!quote(quoted,bouncefrom)) nomem();
qmail_put(qqt,quoted.s,quoted.len);
qmail_puts(qqt,@);
-   qmail_put(qqt,bouncehost.s,bouncehost.len);
+   if (rd)
+ qmail_put(qqt,rdomain.s,rdomain.len);
+   else
+ qmail_put(qqt,bouncehost.s,bouncehost.len);
qmail_puts(qqt,\nTo: );
while (!quote2(quoted,bouncerecip)) nomem();
qmail_put(qqt,quoted.s,quoted.len);
@@ -706,7 +746,10 @@
 Subject: failure notice\n\
 \n\
 Hi. This is the qmail-send program at );
-   qmail_put(qqt,bouncehost.s,bouncehost.len);
+   if (rd)
+ qmail_put(qqt,rdomain.s,rdomain.len);
+   else
+ qmail_put(qqt,bouncehost.s,bouncehost.len);
qmail_puts(qqt,*sender.s ? .\n\
 I'm afraid I wasn't able to deliver your message to the following addresses.\n\
 This is a permanent error; I've given up. Sorry it didn't work out.\n\


Re: [vchkpw] Multi domain bounce message handling

2003-10-18 Thread Sigmund Gudvangen
Le Samedi 18 Octobre 2003 02:50, Tom Collins a écrit :
 On Friday, October 17, 2003, at 05:27  PM, David Bristol wrote:
  This may not be the way to go about this, but have you verified that
  both domains are in the qmail/control/locals file?

 Don't put vpopmail domains in control/locals.  You'll mess things up.

 There isn't a known solution to what was asked.  Doublebounces go to
 the postmaster of the server.  Bounce messages refer to the name of the
 physical server, and not the domain name.

 You might be able to modify qmail-send, but it would be very difficult
 to determine what hostname to use in the bounce message.

 What if there are multiple recipients that bounced?
 What if it's a message one of your user's is trying to send to a
 hotmail address?  You don't want it to say that your server is
 hotmail.com.

 For debugging purposes, it's best to have the server use it's real
 name.  You can adjust that by editing control/bouncehost and setting it
 to a single name.

Yes, setting a bouncehost works. The snag is that the only sensible thing then 
must be to set bounchost to something neutral, like Mailserver. It cannot be 
set to domA or domB, as bounce messages from the other domain will then be 
utterly missleading. 

For the sake of argument, suppose that somebody wants to send mail to 
[EMAIL PROTECTED], but miss-spells the name and writes e.g. [EMAIL PROTECTED] He will 
receive a bounce message, but he will have no idea which message bounced, as 
there will no indication from where it come. So, his interlocateur Kvaksvik 
will be wondering why he hasn't received the message he is waiting for and 
thake his buisness elsewhere. 

Have I missunderstood something or is this really the state of affairs in 
2003?

Regards
Sigmund.






Re: [vchkpw] Multi domain bounce message handling

2003-10-18 Thread Sigmund Gudvangen
Le Samedi 18 Octobre 2003 10:05, Sigmund Gudvangen a écrit :
 Le Samedi 18 Octobre 2003 02:50, Tom Collins a écrit :
  On Friday, October 17, 2003, at 05:27  PM, David Bristol wrote:

 
  For debugging purposes, it's best to have the server use it's real
  name.  You can adjust that by editing control/bouncehost and setting it
  to a single name.

 Yes, setting a bouncehost works. The snag is that the only sensible thing
 then must be to set bounchost to something neutral, like Mailserver. It
 cannot be set to domA or domB, as bounce messages from the other domain
 will then be utterly missleading.

 For the sake of argument, suppose that somebody wants to send mail to
 [EMAIL PROTECTED], but miss-spells the name and writes e.g. [EMAIL PROTECTED] He
 will receive a bounce message, but he will have no idea which message
 bounced, as there will no indication from where it come. So, his
 interlocateur Kvaksvik will be wondering why he hasn't received the message
 he is waiting for and thake his buisness elsewhere.

 Have I missunderstood something or is this really the state of affairs in
 2003?

Yes, I think I did missunerstand it. The above scenario isn't true of cause, 
as the bounce message will say

Hi. This is the qmail-send program at Mailserver.
I'm afraid I wasn't able to deliver your message to the following addresses. 
This is a permanent error; I've given up. Sorry it didn't work out. 

[EMAIL PROTECTED] 
Sorry, no mailbox here by that name. vpopmail (#5.1.1) 

And then it isn't such a bad idea having the host name in the bounce message. 
Sorry, just a popmail newbie that hadn't had his coffe yet.


 Regards
 Sigmund.




Re: [vchkpw] Multi domain bounce message handling

2003-10-17 Thread X-Istence
Sigmund Gudvangen wrote:

Hi,

I am in the process of testing out a small qmail/vpopmail server, with two 
domains; domA.com and domB.com. I have set up one of the domains domA.com as 
the defult, i.e. /etc/qmail/defaultdomain contains domA.com.

Booth domains work as intended for normal mail delivery, but if I send mail to 
e.g. a nonexisting user at either domain, the bounce message is always from 
domainA.com:

Hi. This is the qmail-send program at domA.com. 
I'm afraid I wasn't able to deliver your message to the following addresses. 
This is a permanent error; I've given up. Sorry it didn't work out. 

Moreover, the failure notices are allways sent to [EMAIL PROTECTED], never 
to [EMAIL PROTECTED] 

Is there a way to ensure that bounce messages arrive from the correct domain 
and that fairure messages reches the correct postmaster? 

Regards
Sigmund.


 

I have the same problem, and have yet to find a fix.




Re: [vchkpw] Multi domain bounce message handling

2003-10-17 Thread David Bristol
This may not be the way to go about this, but have you verified that
both domains are in the qmail/control/locals file?

On Sat, 2003-10-18 at 02:16, X-Istence wrote:
 Sigmund Gudvangen wrote:
 
 Hi,
 
 I am in the process of testing out a small qmail/vpopmail server, with two 
 domains; domA.com and domB.com. I have set up one of the domains domA.com as 
 the defult, i.e. /etc/qmail/defaultdomain contains domA.com.
 
 Booth domains work as intended for normal mail delivery, but if I send mail to 
 e.g. a nonexisting user at either domain, the bounce message is always from 
 domainA.com:
 
 Hi. This is the qmail-send program at domA.com. 
 I'm afraid I wasn't able to deliver your message to the following addresses. 
 This is a permanent error; I've given up. Sorry it didn't work out. 
 
 Moreover, the failure notices are allways sent to [EMAIL PROTECTED], never 
 to [EMAIL PROTECTED] 
 
 Is there a way to ensure that bounce messages arrive from the correct domain 
 and that fairure messages reches the correct postmaster? 
 
 Regards
 Sigmund.
 
 
 
 
   
 
 I have the same problem, and have yet to find a fix.
 
 
 




Re: [vchkpw] Multi domain bounce message handling

2003-10-17 Thread Tom Collins
On Friday, October 17, 2003, at 05:27  PM, David Bristol wrote:
This may not be the way to go about this, but have you verified that
both domains are in the qmail/control/locals file?
Don't put vpopmail domains in control/locals.  You'll mess things up.

There isn't a known solution to what was asked.  Doublebounces go to 
the postmaster of the server.  Bounce messages refer to the name of the 
physical server, and not the domain name.

You might be able to modify qmail-send, but it would be very difficult 
to determine what hostname to use in the bounce message.

What if there are multiple recipients that bounced?
What if it's a message one of your user's is trying to send to a 
hotmail address?  You don't want it to say that your server is 
hotmail.com.

For debugging purposes, it's best to have the server use it's real 
name.  You can adjust that by editing control/bouncehost and setting it 
to a single name.

--
Tom Collins  -  [EMAIL PROTECTED]
Note: The Tom Logic offices will be closed October 23 to November 18.
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Re: [vchkpw] Multi domain bounce message handling

2003-10-17 Thread X-Istence




David Bristol wrote:

  This may not be the way to go about this, but have you verified that
both domains are in the qmail/control/locals file?

On Sat, 2003-10-18 at 02:16, X-Istence wrote:
  
  
Sigmund Gudvangen wrote:



  Hi,

I am in the process of testing out a small qmail/vpopmail server, with two 
domains; domA.com and domB.com. I have set up one of the domains domA.com as 
the defult, i.e. /etc/qmail/defaultdomain contains domA.com.

Booth domains work as intended for normal mail delivery, but if I send mail to 
e.g. a nonexisting user at either domain, the bounce message is always from 
domainA.com:

Hi. This is the qmail-send program at domA.com. 
I'm afraid I wasn't able to deliver your message to the following addresses. 
This is a permanent error; I've given up. Sorry it didn't work out. 

Moreover, the failure notices are allways sent to [EMAIL PROTECTED], never 
to [EMAIL PROTECTED]. 

Is there a way to ensure that bounce messages arrive from the correct domain 
and that fairure messages reches the correct postmaster? 

Regards
Sigmund.




 

  

I have the same problem, and have yet to find a fix.




  
  


  

They are with me.




Re: [vchkpw] Multi domain bounce message handling

2003-10-17 Thread X-Istence
Tom Collins wrote:

On Friday, October 17, 2003, at 05:27  PM, David Bristol wrote:

This may not be the way to go about this, but have you verified that
both domains are in the qmail/control/locals file?


Don't put vpopmail domains in control/locals.  You'll mess things up.

There isn't a known solution to what was asked.  Doublebounces go to 
the postmaster of the server.  Bounce messages refer to the name of 
the physical server, and not the domain name.

You might be able to modify qmail-send, but it would be very difficult 
to determine what hostname to use in the bounce message.

What if there are multiple recipients that bounced?
What if it's a message one of your user's is trying to send to a 
hotmail address?  You don't want it to say that your server is 
hotmail.com.

For debugging purposes, it's best to have the server use it's real 
name.  You can adjust that by editing control/bouncehost and setting 
it to a single name.

--
Tom Collins  -  [EMAIL PROTECTED]
Note: The Tom Logic offices will be closed October 23 to November 18.
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/




Hrm, i have the domains in locals, and it has been there for like ever. 
Shrug.