
pawel.panek at inet
Dec 16, 2005, 6:11 AM
Post #3 of 49
(2633 views)
Permalink
|
Hi again, I have to write once again the example for this problem. Domain names which I used got x-ed :). Example: Domain department1.com is CNAME for mainsite.com Domain department2.com is CNAME for mainsite.com all departments and mainsite.com has MX mail.mainsite.com which is pointing at A record 1.2.3.4 this configuration is required because mainsite.com holds main services for whole organization and administrator can easly change ip addresses of whole structure making changes in only one place. When someone sends email for bob at department1 dot com using qmali MTA the mail will be delivered to bob at mainsite dot com. Those two addressess may belong to two different people. In fact mail.mainsite.com will try to deliver message to bob at mainsite dot com or will reject if there is no such account. Don't you think this rewritnig can cause false failures or were serious mistakes (wrong person reading confidential mail)? Sorry for repeating myself. Also sorry for my English. ----- Original Message ----- From: "Pawe³ Panek" <pawel.panek[at]inet.pl> To: <qmail[at]list.cr.yp.to> Sent: Friday, December 16, 2005 1:26 PM Subject: cname expand in qmail-remote > Hello, > I have noticed that qmail is still non rfc 2821 part 3.6 compliant. When > sender or reciver uses as domain name the CNAME record for another domain, > his/her domain part of address would be rewritten in MAIL FROM or/and RCPT > TO command. Since rfc 2821 which allows use of CNAME if they can be > successfully resolved to an A or MX, the MTAs are not allowed to rewrite > this addresses. Any of serious MTAs like Postfix or Exim are making such > rewritings. I think so should do qmail. > Example: > Domain department1.com is CNAME for mainsite.com > Domain department2.com is CNAME for mainsite.com > all departments and mainsite.com has MX mail.mainsite.com which is pointing > at A record 1.2.3.4 > this configuration is required because mainsite.com holds main services for > whole organization and administrator can easly change ip addresses of whole > structure making changes in only one place. > When someone sends email for bob[at]department1.com using qmali MTA the mail > will be delivered to bob[at]mainsite.com. Those two addressess may belong to > two different people. In fact mail.mainsite.com will try to deliver message > to bob[at]mainsite.com or will reject if there is no such account. Don't you > think this rewritnig can cause false failures or were serious mistakes > (wrong person reading confidential mail)? > Please don't argue with me that this dns structure is broken. It is very, > very usefull if you have to manage big sites which has many incorporated > domains. > I wrote a patch for this issue. It adds new configuration file placed into > control directory. It names: expcname. This accepts only integer value > placed in first line. For 0 the expansion of cname record will be disabled > so qmail wont rewrite sender or reciver address. For 1 (or any positive > integer) qmail will expand and rewrite cname into its target. The default > value is 1 (make rewrite). I think this patch should be added to netqmail > 1.05. Maybe not exactly this patch but this functionality should be added. > qmail-105.expand-cname.patch: > > --- qmail-remote.c.orig 2005-06-06 16:30:41.000000000 +0200 > +++ qmail-remote.c 2005-12-14 14:30:15.000000000 +0100 > @@ -106,6 +106,7 @@ > int timeoutconnect = 60; > int smtpfd; > int timeout = 1200; > +int expcname = 1; > > int saferead(fd,buf,len) int fd; char *buf; int len; > { > @@ -297,7 +298,7 @@ > if (!stralloc_cats(saout,"@")) temp_nomem(); > > if (!stralloc_copys(&canonhost,s + j + 1)) temp_nomem(); > - if (flagcname) > + if (flagcname && expcname) > switch(dns_cname(&canonhost)) { > case 0: *flagalias = 0; break; > case DNS_MEM: temp_nomem(); > @@ -314,6 +315,7 @@ > if (control_readint(&timeout,"control/timeoutremote") == -1) > temp_control(); > if (control_readint(&timeoutconnect,"control/timeoutconnect") == -1) > temp_control(); > + if (control_readint(&expcname,"control/expcname") == -1) temp_control(); > if (control_rldef(&helohost,"control/helohost",1,(char *) 0) != 1) > temp_control(); > switch(control_readfile(&routes,"control/smtproutes",0)) { > > Only 3 lines got changed so you can apply this patch manualy or use: > patch -p 0 < qmail-105.expand-cname.patch > with clean netqmail 1.05 source. The patch may be applied cleanly after > those patches: > qmail-1.03-mysql-0.7.4.patch > auth.patch > qmail-103.patch (big dns) > qmail-103.doublebounce-trim.patch > Comments will be appreciated. > Regards, > Pawel Panek > -- > Image Electronics http://www.inet.pl/ > Plac Rodla 8, 70-419 Szczecin, Poland > e-mail: Pawel.Panek[at]inet.pl > tel: +4891 4324200 fax: +4891 4882175 > >
|