[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rewriting headers



Hi,

    I am using zmailer (2.99.49p9) as the MTA on my Debian
GNU/Linux workstation.  I use dialup PPP to connect to my ISP,
which dynamically allocates an IP address each time I make a
connection.  I get my email from a POP3 mailbox provided by my
ISP.  Pretty standard, huh?

    I have read the documentation supplied with the Debian
zmailer package, along with the 1998 zmailer mailing list archive,
and I have subscribed to this (zmailer) mailing list.  I have hit
a bump in the road trying to configure zmailer to do exactly what
I want it to do, any suggestions would be greatly appreciated.

    Here is my /etc/mail.conf, actually the results produced by
the mailconf function (zm1 is just some commands to echo the
values),

    z$ . zm1
    hostname = `eden-sda2'
    orgdomain = `'
    mydomain = `erols.com'

    So, here is a synopsis of my situation.

    1. I want to be able to send all outbound (smtp) mail with the
       envelope and message headers as follows,

       EHLO $hostname
       MAIL From:<jeffsh@erols.com>
     not, as is currently the case ->
       MAIL From:<$user@erols.com>

       FROM: $gecos_name <jeffsh@erols.com>
       SENDER: $user@$hostname
     or ->
       SENDER: $user
     not, as is currently the case ->
       SENDER: $user@erols.com

    2. I want to be able to send and receive local (intramachine)
       mail locally(!), with the mail identified as follows,

       FROM: $user
     or ->
       FROM: $user@$hostname
       TO: $user_to

    I would also like to see the $gecos_name appear in these local
headers too, but it really isn't that important.  Otherwise, the
local headers are ok, except notice that in these syslog messages
regarding local mail, how `erols.com' ($mydomain) has appeared,

       Mar 21 21:08:40 eden-sda2 router[606]: S.qxOMS166109: \
       from=<jeff@erols.com>, rrelay=jeff@localhost size=95, \
             ^^^^^^^^^^^^^^
       nrcpts=1, msgid=<19990322020840Z166109-606+2@eden-sda2>

       Mar 21 21:08:48 eden-sda2 mailbox[1070]: S.qxOMS166109: \
       to=<jeff@erols.com>, delay=00:00:18, xdelay=00:00:00, \
           ^^^^^^^^^^^^^^
       mailer=local, stat=ok3 Ok

    And here is the router -i output for some addresses,

    z$ router jeff
    <jeff.interactive@eden-sda2>: address: jeff
    (((local jeff jeff@erols.com default_attributes)))

    z$ router jeffsh  #this is /etc/alias-ed to jeffsh@erols.com
    <jeff.interactive@eden-sda2>: address: jeffsh
    (((smtp erols.com jeffsh@erols.com g0)))

    z$ router jeffsh@erols.com
    <jeff.interactive@eden-sda2>: address: jeffsh@erols.com
    (((smtp erols.com jeffsh@erols.com default_attributes)))

    The biggest problem is the `MAIL From:<$user@erols.com>', as
this is a real big lie.

    The following is the set of diffs that comprise my complete
zmailer configuration,

===================================================================
RCS file: /etc/zmailer/cf/RCS/crossbar.cf,v
retrieving revision 1.1
diff -u -r1.1 /etc/zmailer/cf/crossbar.cf
--- /etc/zmailer/cf/crossbar.cf	1999-03-14 14:08:23-05	1.1
+++ /etc/zmailer/cf/crossbar.cf	1999-03-14 20:29:05-05
@@ -60,8 +60,8 @@
 		;;
 	error)	rewrite=null ;;
 	local)	case "$(channel $from)" in
-		local)	#rewrite=intramachine
-			rewrite=internet ;;
+		local)	rewrite=intramachine ;;
+			#rewrite=internet ;;
 		*)	# addresses should be saved the way they arrive
 			rewrite=null ;;
 		esac
@@ -127,6 +127,20 @@
 #	smtp)
 	smtp|smtpx|local|bsmtp3*)
 		tmp="$(smtproute "$(user $from)")"
+#FIX mea@nic.funet.fi Feb 16 78/2398 "Re: Rewriting headers"
+#		case "$(channel $from)" in
+#		local)
+#			# This looks weird, doesn't it ?
+#			# the 'host' component contains FQDN form of
+#			# address on 'local' channels, others have it
+#			# also in the 'user' part.
+#			tmp="$(smtproute "$(host $from)")"
+#			;;
+#		*)
+#			tmp="$(smtproute "$(user $from)")"
+#			;;
+#		esac
+#FIX DONT use it yet (it makes From: jeffsh@erols.com -> jeff@erols.com)??
 		sift "$tmp" in
 		(@$hostname[:,].*)|([^@:,]+@$hostname)
 			break ;;
@@ -253,11 +267,12 @@
 	# 'hname'   is the header whose address(es) we are rewriting;
 	#           value here is usually: 'From', 'To', etc.
 
-#	# Alexis Yushin <alexis@NL.net> mentioned that he does following:
-#	$(sender) && {
-#		local tmp
-#		tmp=$(masquerades $address) && address=$tmp
-#	}
+	# See: Alexey Gadzhiev Feb 12 26/799 "Re: Rewriting headers"
+	# Alexis Yushin <alexis@NL.net> mentioned that he does following:
+	$(sender) && {
+		local tmp
+		tmp=$(masquerades $address) && address=$tmp
+	}
 
 	address="$(canonicalize "$address")"	# Canonicalize does local
 						# hostname hiding...
===================================================================
RCS file: /etc/zmailer/db/RCS/localnames,v
retrieving revision 1.1
diff -u -r1.1 /etc/zmailer/db/localnames
--- /etc/zmailer/db/localnames	1999-03-13 17:23:35-05	1.1
+++ /etc/zmailer/db/localnames	1999-03-19 17:11:55-05
@@ -3,5 +3,7 @@
 #c  thus having multiple machines on the same mailer..
 #d
 
-#archie                  archie.funet.fi
-#archie.funet.fi
+EDEN-SDA2		eden-sda2
+LOCALHOST		localhost
+eden-sda2		eden-sda2
+localhost		localhost
===================================================================
RCS file: /etc/zmailer/db/RCS/masquerades,v
retrieving revision 1.1
diff -u -r1.1 /etc/zmailer/db/masquerades
--- /etc/zmailer/db/masquerades	1999-03-14 19:25:48-05	1.1
+++ /etc/zmailer/db/masquerades	1999-03-14 19:52:44-05
@@ -1,4 +1,4 @@
-jeff	jeffsh@erols.com
-jss	jeffsh@erols.com
-luser	jeffsh@erols.com
-root	jeffsh@erols.com
+jeff@erols.com		jeffsh@erols.com
+jss@erols.com		jeffsh@erols.com
+luser@erols.com		jeffsh@erols.com
+root@erols.com		jeffsh@erols.com
===================================================================
RCS file: /etc/zmailer/RCS/router.cf,v
retrieving revision 1.1
diff -u -r1.1 /etc/zmailer/router.cf
--- /etc/zmailer/router.cf	1999-03-14 19:15:24-05	1.1
+++ /etc/zmailer/router.cf	1999-03-14 19:23:04-05
@@ -60,6 +60,15 @@
 	test -f $MAILSHARE/cf/i-${method}.cf && . i-${method}.cf
 done
 
+# Load envelope masquerading database.
+# See: Alexey Gadzhiev Feb 12 26/799 "Re: Rewriting headers"
+
+if [ -r $MAILVAR/db/masquerades ] ; then
+	relation -lmt unordered  -f $MAILVAR/db/masquerades masquerades
+else
+	masquerades () { return 1 }
+fi
+
 mailconf () {
 	orgdomain=$(/bin/hostname --domain)
 	hostname=$(/bin/hostname --fqdn)
===================================================================
RCS file: /etc/zmailer/RCS/zmailer.conf,v
retrieving revision 1.1
diff -u -r1.1 /etc/zmailer/zmailer.conf
--- /etc/zmailer/zmailer.conf	1999-03-13 18:15:10-05	1.1
+++ /etc/zmailer/zmailer.conf	1999-03-14 11:06:41-05
@@ -73,7 +73,8 @@
 # address verification options they can be specified here.  The default
 # value is "-asve".   This is also used, when invoking  ``sendmail'' with
 # "-bs" option.
-SMTPOPTIONS="-a -sve -l /var/log/mail/smtpserver"
+##SMTPOPTIONS="-a -sve -l /var/log/mail/smtpserver"
+SMTPOPTIONS="-a -sve"
 
 # ALLOWSOURCEROUTE (when present) stops the system from ignoring
 # the old RFC821/822 source routes of type:  @a,@b:c@d;  By "ignoring"
@@ -86,11 +87,12 @@
 # non-default logging options, the can be specified here.  The default
 # value is ""
 #
-SCHEDULEROPTIONS="-l /var/log/mail/scheduler.perflog -S -H"
+##SCHEDULEROPTIONS="-l /var/log/mail/scheduler.perflog -S -H"
+SCHEDULEROPTIONS="-S -H"
 
 # ROUTEROPTIONS are command line options given to the router when started
 # from the zmailer shell script. The default values are "-dkn 4"
-ROUTEROPTIONS="-dkn 4"
+ROUTEROPTIONS="-dkn 1"
 
 # Here you can put any ZM ``environment'' variables you want to place in
 # the system-wide configuration file (/etc/zmailer.conf).  Typically this
@@ -167,7 +169,7 @@
 # This really should be done with some system ioctl(), but those are
 # damn varying, and often still do kmem reads...
 #SELFADDRESSES=[1.2.3.4],[2.3.4.5],[ipv6.::1.2.3.4]
-SELFADDRESSES=
+SELFADDRESSES=[127.0.0.1]
 
 # What kind of DB type we prefer to use ?  We can support several,
 # after all...  btree/ndbm/gdbm ... (DBEXT: pag/db/dat)
===================================================================

Thanks in advance for any and all help,

-- 
Jeff Sheinberg  <jeffsh@erols.com>