From owner-freebsd-questions Sun Jun 21 13:18:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA24174 for freebsd-questions-outgoing; Sun, 21 Jun 1998 13:18:52 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from phoenix.volant.org (phoenix.volant.org [205.179.79.193]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA24169 for ; Sun, 21 Jun 1998 13:18:50 -0700 (PDT) (envelope-from patl@phoenix.volant.org) From: patl@phoenix.volant.org Received: from asimov.phoenix.volant.org [205.179.79.65] by phoenix.volant.org with smtp (Exim 1.62 #1) id 0ynqZh-00076Q-00; Sun, 21 Jun 1998 13:18:53 -0700 Received: from localhost by asimov.phoenix.volant.org (SMI-8.6/SMI-SVR4) id NAA09959; Sun, 21 Jun 1998 13:18:50 -0700 Date: Sun, 21 Jun 1998 13:18:50 -0700 (PDT) Reply-To: patl@phoenix.volant.org Subject: Re: sendmail: How do I make sendmail 'fake' my 'online' mail address? (fwd) To: drmarsh@bigfoot.com cc: freebsd-questions@FreeBSD.ORG In-Reply-To: <199806192155.WAA01001@bigfoot.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > ...<> > The most major is that I don't know how to convince sendmail to tell the > world who I am when I'm online: > > My local login name is 'dm'. > > My mailbox name with my ISP (Zetnet) is 'dmarsh', and just to make things > more difficult, my Bigfoot mailbox name (my preferred email address for > the From: field) is 'drmarsh' (Somebody beat me to the obvious choice!). > > I've been forced to introduce this short-term (I hope) kludge in the > meantime by creating another local user called 'drmarsh', in order to make > sendmail supply a genuine From: field. > > I've managed to get sendmail to masquerade as 'bigfoot.com' successfully, > so hopefully (this is my first message with this new user: using dm worked > similarly) this will 'assemble' a correct return-address, using the drmarsh > from my *local* login, and the bigfoot.com from the MASQUERADE_AS line in > my .mc file. > > > My question is: is it possible to 'order' sendmail to insert a From: field > of your own choosing, rather than have it do its > too-smart-for-its-own-good method of actually assembling one from your local > login name and the 'masquerade' domain? > > This would allow me to send mail when logged in as 'dm' (less typing, you > see) which would be send with a _correct_ From: field. You -REALLY- don't want to do this in sendmail (or any other Mail Transfer Agent.) It should always correctly identify itself as your host in your domain. And most knowlegable email gurus agree that header rewriting is generally a Bad Idea. (Some claim it is downright evil.) In particular, I suspect that BigFoot.com would object strongly to your machine masquerading as one of theirs... And even if they never find out; it is likely that the forgery would be detected by some of the more sophisticated forgery/SPAM detection setups. This would lead to automatic complaints to your ISP, or to your messages simply being discarded as they pass through the filtered sites. Not to mention how badly you'd lose if you ever added another local user that -didn't- use bigfoot.com... > [Actually, I now seem to have got around this problem, but I'm not sure if > my solution is the right one: > > I've set the FROM and REPLYTO environment variables to contain my 'real' > online email address, and for double paranoia, I've also included the > same address in the From: header in my ~dm/.elm/elmheaders file. > > This /seems/ to have got around my mixture of personalities ;-) ] You've hit on the correct approach - configure your Mail User Agent(s) to insert a correct Reply-to: header. If you also configure it to set From: to a non-local address, you should probably make sure that it adds a Sender: header with your local address. (IIRC the RFCs are a bit vague on this particular situation; but it seems to fit within the usage of Sender; and it should help bypass filters that might otherwise classify your messages as forgeries.) > My other problem is that I don't seem able to send mail from the localhost > to either of my online incarnations (dmarsh@zetnet.. or drmarsh@bigfoot..) > In either case, the message is bounced back. > > I suspect that this may be because I have included some wrong information > in my .mc file, which I have included below (obviously this will be > crucial in solving my first problem anyway). > > I suspect that I may have made a mistake in including one or more of the > lines beginning Cw ... I can't remember (or understand!) exactly what > these are supposed to do, but the guide in the HTML docs suggested that > these were necessary? I've a horrible feeling that including those lines in > the file has convinced sendmail that my localhost is able to route mail to > those domains, which obviously it is not! It is difficult to attempt any sort of diagnosis without the specific bounce messages; but if you still have sendmail claiming to be in bigfoot.com, it would fail a reverse DNS lookup. Yet another reason why your machine should always correctly identify itself. > I can see now how it's possible to write an 800 page book on sendmail! :-(( > > > Anyway, here's the pertinant part of my .mc file (initial comment fluff > snipped). I replaced sendmail with Exim long ago, partially because Exim configuration is so much easier. But I'll take a stab at this. > include(`../m4/cf.m4') > VERSIONID(`@(#)trek.squelch.localnet.mc $Revision: 1.01, 1998-06-12 $') > OSTYPE(bsd4.4)dnl > DOMAIN(generic)dnl > MAILER(local)dnl > MAILER(smtp)dnl > Cw trek.squelch.localnet This is not a legitimate Fully Qualified Domain Name - there is no 'localnet' top-level domain. You should have a legitimate FQDN. Either your own domain name, or your hostname within zetnet.co.uk. ZetNet should be able to tell you whether they have set up the necessary DNS records to show your host within their domain. > Cw bigfoot.com This is a forgery. It will fail any sort of verification performed by the receiving MTA. > Cw zetnet.co.uk IIRC, this should be your complete host name. Since you are not handling all mail for zetnet.co.uk, it should probably be Cw .zetnet.co.uk > MASQUERADE_AS(`bigfoot.com')dnl This is intended to be used on a central mail server to make all mail from within the domain appear to come from the domain itself instead of from individual machines. It is -NOT- intended to be used to pretend to be from another domain entirely. > FEATURE(masquerade_envelope)dnl > EXPOSED_USER(root) > FEATURE(mailertable, `hash -o /etc/mailertable')dnl > FEATURE(nodns)dnl > FEATURE(nouucp)dnl > define(`confCW_FILE', `-o /etc/sendmail.cw')dnl > define(SMART_HOST, `mail.zetnet.co.uk') > Dm bigfoot.com > define(`confDOMAIN_NAME', `bigfoot.com')dnl -Pat To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message