[philiptellis] /bb|[^b]{2}/
Never stop Grokking


Friday, November 14, 2003

Self extracting tarball

install_tar.sh:
   #!/bin/bash

   skip=9
   # blah blah blah
   tail -n +$skip $0 | tar jxvf - | (while read a; do echo -n "."; done; echo;)

   exit
   __LINE_8_END_OF_CODE__

and then cat whatever.tar.bz2 >> install_tar.sh

voila, you have a self extracting tarball. Don't forget the exit just before the __LINE_8_END_OF_CODE__, and make sure that that *is* the last line of your shell code.

set skip to the line where your tar.bz2 data starts.

Wednesday, November 12, 2003

Thoughts on MovableType

[cloned from my livejournal]

So, after having used MT for a while, and reading everyone's blogs, and listening to cribs, I'm finally ready to write something on it. Here goes.

On the whole, it's a nice tool, and yes, it does cut down on the work required to publish sites. Once mastered, MT can prove to be a very useful CMS... but... I think it's too cumbersome to customise. Anyone who's tried editing their templates will concur.

So, what do I like and what do I not like.

I like the fact that MT, and most CMSes for that matter, take away the need to write a lot of HTML. A poster can concentrate on content, and forget about presentation. Anyone not familiar with HTML will love this. The new entry screen is quite simple and straightforward, and has a help button associated with every field. I think that's a good idea, but then I did do the same for the reviewer interface in the conference management system :)

Another thing I like is the ability to save an entry without publishing it yet. One is well aware of how many times one has lost a long post because `the browser just closed'. Well, whatever the reason for the browser closing, the Save button down there ensures that we don't have to redo too much work.

Hmm, what else do I like? Trackback is a nice feature, but I haven't used it too much. I guess it isn't too useful when I'm doing TBs on myself. Then there's the look and feel of the management interface, yeah, nice, docs are nice too...

Now, my cribs.

Where the hell is the Access Control? Vivek Nallur has a post on his private blog that shows how to edit another author's permissions. I don't know about others, but if I were deploying MT in a multi-author environment, I'd like some kind of access and work-flow control. Working on trust alone may be fine for the authoring process, but it just does not work at the admin level (think CVS).

Then there's the oh-so-cumbersome template editors. When I said the new entry interface was easy to use without knowing HTML, I meant exactly that. It's easy to use if you don't know HTML, and only if you don't know, or at least don't need to use, HTML.

The moment you need to edit code of any kind, HTML text boxes are a pain. Editing code requires a code editor. Even if it's just notepad, the fact that a TAB inserts a TAB rather than taking one to the next field makes a huge difference. Then, there's search and replace, and of course, a nice large code editing window. Ok, I'm cribbing. In reality, you can link the template to a local file, and edit that instead... but then file permissions come into play, and that's another headache that I won't go into just yet.

Ok, so you're done with editing code, now you need to rebuild the pages. That pops up a new window, from which you select which pages to rebuild. This is fine if you're just doing it once a week, or even once a day, but try doing it once a minute and you'll know what a pain it is. Frankly, I like to be able to just edit my stylesheet and hit refresh on the browser to see what it looks like.

So, finally, I come to file permissions. When creating a new blog, MT requires the new blog's directory to already exist. So, just create a directory under your web path, and tell MT about it right? Wrong. Since MT needs to write to that directory, it needs to either be owned by MT, or in the same group as MT, with group write permissions, or world writable. The first case is not possible unless you are the MT user or root - these are the only two users who can create directories owned by MT. To enable the second option, you must be in the MT group... and so must all other authors... which leads to the same problem that we have with world writable directories.

Agreed, this isn't such a big problem, as these folders only contain generated files. The real data is stored in a database owned by MT and writable only by MT. Still, I'd like to see MT be able to create blog subdirectories on its own, and provide a sensible default for a new blog path.

Yes, I do have a small wishlish, and I might at some point fix some of these issues with MT - if time and licences permit. MT is not distributed under a Libre licence, so any changes I make will remain in house only, or sent back to MT. Right now I don't think I should even look at the code, because if it does in any way influence future code that I write, there could be problems.

Sunday, October 05, 2003

Generating random names

Had to generate a lot of names and emails for a project I'm working on.
Aborts, Weidman weidman@shock.net
Abreast, Periclean periclean@tier.org
Adequately, Misconstrues misconstrues@quartets.net
Antibody, Dodged dodged@sparking.org
Arteries, Shiver shiver@perpetual.net
Attired, Cindy cindy@became.net
Awaiting, Gillette gillette@crimson.com
Babying, Billed billed@arithmetical.net
Bacilli, Versailles versailles@mervin.net
Belabors, Humoring humoring@available.org
Benedikt, Microarchitecture microarchitecture@cezannes.com
Bites, Transposition transposition@husker.com
Botanical, Caboose caboose@uselessness.net
Brimful, Trickiest trickiest@mcgowan.org
Bunters, Prosper prosper@wacke.org
Buttressing, Revolutionize revolutionize@pandas.com
Cashew, Crave crave@avalanches.org
Chagrin, Debussy debussy@pistol.net
Commitments, Incapacitate incapacitate@westinghouse.org
Concentration, Greetings greetings@subspace.org
Counterexamples, Screwing screwing@bellicosity.com
Counters, Bryce bryce@simplicity.net
Cowered, Coasting coasting@accessing.org
Cultivate, Sophias sophias@sherwin.com
Demanded, Prediction prediction@transplanted.com
Dent, Subprocesses subprocesses@international.com
Dinghy, Rickets rickets@lexicographic.org
Dostoevsky, Fritz fritz@shoveled.org
Doughnuts, Arbitrariness arbitrariness@noon.com
Drip, Flatly flatly@subsegment.com
Enid, Bunter bunter@propagandist.net
Envious, Belonging belonging@nests.com
Epaulet, Wilder wilder@timers.net
Europeanizations, Crasher crasher@hews.com
Evokes, Confusions confusions@clap.com
Excusable, Filming filming@colonist.net
Fascinates, Gantry gantry@frisk.net
Fates, Regressions regressions@abides.net
Fiddle, Holiness holiness@unwrap.net
Fifteen, Francois francois@pithing.org
Finishers, Assenter assenter@prospered.org
Fleischman, Cocktail cocktail@perishable.net
Formants, Import import@flexibly.net
Freakish, Predominantly predominantly@checks.net
Glen, Obese obese@midrange.net
Greeted, Kneecap kneecap@fancifully.net
Grievance, Yellow yellow@loy.org
Guam, Herring herring@cobblestone.com
Hepburn, Felix felix@limitations.net
Highly, Pounced pounced@chirps.org
Homicide, Mute mute@vertical.net
Imagery, Athenians athenians@comforts.com
Incites, Dusk dusk@infighting.net
Industrialized, Viscous viscous@hoarsely.com
Input, Scale scale@jolla.org
Intellectuals, Raritan raritan@five.org
Joule, Farmyard farmyard@boisterously.com
Langford, Canberra canberra@forbearance.org
Leadership, Vibrate vibrate@rockaway.com
Librarian, Generic generic@hoff.com
Loopholes, Sequester sequester@fairchild.com
Makable, Avis avis@sprinkled.net
Marinade, Prominently prominently@stumps.com
Massachusetts, Angriest angriest@formatively.com
Milkiness, Marxism marxism@modulated.net
Mississippians, Teresa teresa@hike.net
Oligocene, Consenting consenting@ivy.com
Pavilion, Alertedly alertedly@anglo.org
Popish, Cicada cicada@very.org
Possessor, Hawks hawks@currently.org
Prepositions, Believers believers@condemnations.com
Pressings, Toad toad@sheriff.net
Refilled, Coarseness coarseness@poster.com
Ruined, Charity charity@qualifications.net
Rumpled, Blabbermouths blabbermouths@averaged.com
Scots, Gregory gregory@realest.org
Skillfulness, Entrenched entrenched@disillusionment.org
Slower, Mcmullen mcmullen@desirous.com
Snakelike, Arisen arisen@wakeup.org
Solids, Exertion exertion@encoded.com
Squabbles, Bridge bridge@piloting.com
Squinting, Catholicism catholicism@circumspect.net
Standards, Breakdown breakdown@bullseye.net
Starting, Unconditional unconditional@rooting.org
Stratify, Repudiate repudiate@assailant.net
Stupendous, Cochran cochran@wagner.net
Subgraph, Unfamiliar unfamiliar@hanoverian.com
Surpasses, Introspect introspect@sealed.com
Swallowed, Restlessly restlessly@padlock.net
Swallowing, Solidified solidified@unemployment.com
Taster, Calcutta calcutta@attractor.com
Thames, Limiter limiter@arterial.org
Tiresomely, Achiever achiever@glimpse.org
Tracers, Charlie charlie@busy.net
Unravels, Voided voided@bituminous.net
Unties, Conveyances conveyances@outbreak.net
Urinates, Balkiness balkiness@conveyances.net
Waltzes, Coulomb coulomb@quasar.net
Wiping, Foresee foresee@championships.com


I used /usr/share/dict/words as my wordlist - over 45000 words.
my @words = <>;
die "No wordlist" unless @words;
my $MAX = @words;

$dbh = DBI->connect("dbi:mysql:$db_name;host=$db_host", $db_user, $db_pass,
  { RaiseError => 1, AutoCommit => 0 })
 or die $DBI::errstr unless $dbh;

my $sth=$dbh->prepare(qq{INSERT INTO account (name, email) VALUES (?, ?)});
for my $i (1..100) {
 my $fname = $words[rand($MAX)];
 my $lname = $words[rand($MAX)];
 my $domain = $words[rand($MAX)];

 $fname =~ s/(\w+)/\u\L$1/;
 $lname =~ s/(\w+)/\u\L$1/;

 chomp($lname, $fname, $domain);
 my $email = lc "$fname\@$domain." . (qw(com net org))[rand 3];

 $sth->execute("$lname, $fname", $email);
}
The program took 0.1036 seconds to execute.

Thursday, September 25, 2003

Sendmail Header and Envelope rewriting for offline mailing mini HOWTO

v1.3, 25 October 2003

This document contains information on rewriting your mail header and mail envelope through sendmail for mailing through your ISP. You should still read the sendmail docs and Sendmail-Offline howto.

0. ChangeLog

  • Sat Oct 25 2003 Philip S Tellis v1.3
    • Updated the patch for sendmail v 8.12.9
    • Moved the ChangeLog to the start of the file
    • Added URLs to References and Further Reading
    • Fixed wording a little
  • Tue Jan 1 2003 Philip S Tellis v1.2
    • Updates for sendmail 8.11
  • Sat Dec 8 2001 Philip S Tellis v1.1
    • Added patch file
    • genericsdomain file is same as sendmail.cw
    • changed from dgenerics to egenerics
  • Sun Aug 26 2001 Philip S Tellis v1.0
    • Initial release

1. About this document

1.1. Copyright

Copyright © Philip S Tellis.

Permission is granted to make and distribute copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the derived work is distributed under the terms of a permission notice identical to this one. Translations fall under the catagory of "modified versions".

1.2. Disclaimer

The information in this document is based on my own experience. It works on my system, but may not work on yours. No guarantees are made on its accuracy. The users of this information take full responsibility for any damage that may occur through its use.

1.3. Feedback

If you have questions or comments about this document, please feel free to contact me by email at <philip DOT tellis AT gmail DOT com>.

Please, do not ask me questions about sendmail, m4 or sendmail.cf. Do not ask me questions about receiving mail.

2. Introduction

2.1. The problem

You connect to your ISP to send and receive mail. You have an email account with another email service provider (not your ISP). You want outgoing mails to appear to come from your other account, but you want to use your ISP's mail gateway to send the mail.

You must use your ISP's mail gateway, because you are not permanently connected to the Internet. Your ISP does not allow relay - i.e. only mail coming from or going to an email address in your ISP's domain will be allowed through their gateway.

You also want that mails sent out from the system do not have any local addresses in the header (To:, Cc:, From: lines), while mails between two local users always have the local addresses - i.e. you want rewrite to work only on mails leaving the system.

Finally, you want that local mails are delivered immediately, while remote mails are stored in a queue until you are connected to the Internet.

2.2. Software Environment

I use Sendmail v 8.9.3, 8.11 and 8.12.11 with the corresponding versions of sendmail-cf. I also use GNU m4 1.4 for macro processing of sendmail.mc. This HOWTO will assume that all configuration files, including sendmail.cf are stored in /etc/mail. It also assume that the sendmail binary is /usr/sbin/sendmail, that the m4 binary is in your path, and that the cf directories are correctly installed.

NOTE: Some systems keep the sendmail.cf file at /etc/sendmail.cf, in that case, you should do the same. An easy way would be to either symlink /etc/sendmail.cf to /etc/mail/sendmail.cf or copy /etc/mail/sendmail.cf to /etc/sendmail.cf after you've generated it. The latter method can be more reliable as it sort of ensures that you don't have a half generated cf file when sendmail runs. YMMV.

If you have installed from rpm, you will need the sendmail-cf rpm, if you installed from source, then these will be in your source tree. For debian, the sendmail/cf directory is installed as part of the sendmail package.

I use pine as my mail client, in particular, pine uses `sendmail -bs' to send mail. There shouldn't be any difference with a client that connects to your smtp port.

3. Configuring Sendmail

3.1. Creating the mc file

Sendmail's configuration file - /etc/sendmail.cf is not necessarily human readable. In an earlier version of this Howto, I listed changes that were needed in sendmail.cf. While it isn't important to understand what those changes were, I've decided to get rid of that, and just write some m4 files that you can use. For the main part, we will edit a sendmail.mc file, and use m4 along with these additional files to generate the sendmail.cf file. This has the added advantage of being easier to maintain when you update your sendmail.mc file and need to regenerate sendmail.cf.

The patch for sendmail-cf's macro files is attached at the end of this document.

At this point, it may be be wise to read the cf/README (or README.cf) file that came with your sendmail/sendmail-cf package. It explains the mc file well.

You should already have a file called /etc/mail/sendmail.mc, but if you don't, now is a good time to create it. You can use mine as a template:


divert(-1)
dnl This is the macro configuration file used to generate the /etc/sendmail.cf
dnl file. If you modify this file you will have to regenerate the
dnl /etc/sendmail.cf by running this macro configuration through the m4
dnl preprocessor:
dnl
dnl        m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
dnl
dnl You will need to have the sendmail-cf package installed for this to
dnl work.
include(`/usr/lib/sendmail-cf/m4/cf.m4')
define(`confDEF_USER_ID',``8:12'')dnl
OSTYPE(`linux')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
define(`confAUTO_REBUILD')dnl
define(`confPRIVACY_FLAGS', `goaway authwarnings')dnl
dnl
define(`SMART_HOST', `esmtp:isp.com')dnl
define(`confCON_EXPENSIVE', `True')dnl
define(`SMTP_MAILER_FLAGS', `e')dnl
define(`confTO_QUEUEWARN', `')dnl
define(`confTO_INITIAL', `10s')dnl
define(`confTO_CONNECT', `10s')dnl
define(`confTO_ICONNECT', `10s')dnl
define(`confCW_FILE', `/etc/mail/local_host_names')dnl
dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`nocanonify')dnl
dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`allmasquerade')dnl
FEATURE(`genericstable', `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/local_host_names')dnl
dnl
dnl The egenericstable is a feature that will be added through
dnl my patch for the macro files
dnl
FEATURE(`egenericstable', `hash -o /etc/mail/egenericstable')dnl
dnl
FEATURE(`access_db')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(`accept_unresolvable_domains')dnl
dnl
MAILER(`local')dnl
MAILER(`smtp')dnl

First of all, change the path in the include line to whatever it is on your system. If you've installed from source or using apt on a debian system, this would be /usr/share/sendmail/cf. Also, replace isp.com with the host-name of your isp's smtp server.

I will now attempt to explain the important parts of this file. Most of these things are documented in the README file, so I'll skip those. I will only explain the masquerading options.

Before that, if you're wondering what all the dnl commands are. It simply means delete till new line. Since m4 is a stream processor, it does not care about newlines, and will read and write all white space. These commands just tell it to skip the extra white space. You can also place comments after a dnl.

define(`confCON_EXPENSIVE', `True')dnl
define(`SMTP_MAILER_FLAGS', `e')dnl

These two lines tell sendmail that SMTP mailers are expensive (the e flag), and not to try expensive mailers on the first try. This will cause sendmail to put any mail that requires a connect to a remote smtp server to stay in a queue until you flush the queue with `sendmail -q'.

Local mails will be delivered immediately, because the local mailer is not marked as expensive.

Furthermore, since we are not always connected to the Internet, we don't want warnings of mail being stuck in the queue too long (because that's a perfectly valid situation).

define(`confTO_QUEUEWARN', `')dnl

tells sendmail to unset the QUEUE WARN TimeOut. Set it if you want notifications of mail not being sent for more than a day. You can set it to 1d for 1 day or 1m for 1 minute, etc.

This solves the third part of our problem - mail delivery.

FEATURE(`always_add_domain')dnl
FEATURE(`use_cw_file')dnl
define(`confCW_FILE', `/etc/mail/local_host_names')dnl

These lines tell sendmail to add a domain name to all mails, even if they are sent locally. The cw file is a file containing a list of aliases for your system. It is /etc/local_host_names by default, but we tell sendmail to use /etc/mail/local_host_names through confCW_FILE. This is so that all mail related sub-configuration files are in a common subdirectory.

FEATURE(`nocanonify')dnl

This line tells sendmail not to do DNS (Domain Name System) look ups on host names. Since we are not permanently connected to the Internet, this is required to prevent sendmail from locking up until it gets a DNS time-out.

FEATURE(`masquerade_envelope')dnl
FEATURE(`allmasquerade')dnl

By default, sendmail will only masquerade addresses in the mail header, i.e. the From:, To:, Cc: lines. masquerade_envelope tells sendmail to also masquerade the address used to make the smtp connection with the remote host. In our case, this would be the smart host.

We need this address to be the one that our isp has given us.

`allmasquerade' tells sendmail to also rewrite recipient addresses. Normally, local recipients would receive mail will the local domain name attached to their address. This will cause their masqueraded name to appear.

The advantage of this is that if you send a mail to both, a remote and a local user, then the remote user will see all valid addresses in the To: line, because all local addresses have been masqueraded. He can reply to all, and the mail will reach correctly.

Unfortunately, local users receive mail with all foreign domains, so their replies will take longer to reach (as they will go to the masquerade host instead).

There is a workaround for this, as we shall see later.

FEATURE(`genericstable', `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/local_host_names')dnl

The generics table gives us a very high level of flexibility in setting aliases for outgoing mails. The genericsdomain file tells sendmail which hosts the genericstable applies to. Since we already have a local_host_names file, which contains a list of domains we accept mail for, it makes sense to use the same for outgoing domains.

Finally, we add our own rule, which tells sendmail how to rewrite the envelope (hence the `e' prefix).

FEATURE(`egenericstable', `hash -o /etc/mail/egenericstable')dnl

This rule will add the code to sendmail.cf that v1 of this document required you to add manually.

3.2. Generics tables

My /etc/mail/genericstable looks like this:

philip		philip.tellis@mydomain.com

While my /etc/mail/egenericstable looks like this:

philip		tellis@isp.com

My local_host_names file is:

tae.tellis.home

which is the output of hostname -f

Once you've made your tables, you have to convert them to hash databases using the make map command:

makemap -r hash genericstable.db < genericstable
makemap -r hash egenericstable.db > egenericstable

These are the files that are actually read by sendmail.

3.3. Making sendmail.cf

Finally, convert your sendmail.mc file to sendmail.cf using m4:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

It's actually a good idea to write this to a different file, and then move that to sendmail.cf. You could first check the file for errors, and also, you won't overwrite a file that is currently being processed. However, since you're on a home machine with presumably only one person using the machine at a time, this isn't such an issue. You decide what you need to do.

3.4. Restart sendmail

Now, restart sendmail using whatever method you normally use. On systems using SysV startup scripts, this would be /etc/init.d/sendmail restart

4. Further configuration

4.1. Flushing the queue

Since I connect to the net using a ppp link, I have this in /etc/ppp/ip-up.local:

/usr/sbin/sendmail -q3m

which tells sendmail to process the queue every three minutes.

I also have this in /etc/ppp/ip-down.local:

/usr/sbin/sendmail -q1d

which tells sendmail to process the queue once a day if not connected. Make it more if you want.

4.2. A Makefile

Some distributions have a makefile to regenerate all databases and the sendmail.cf file. You'll have to add an entry for your egenericstable there. You're on your own for this.

5. Acknowledgements

  • Thanks to my ISP for forcing me to do this
  • Thanks to some of the members of Ilug-Bom for ideas

6. References

  • cf/README Sendmail distribution
  • Sendmail - friend or foe? by Matthew Palmer, talk for Manchester Lug http://ieee.uow.edu.au/~mjp16/sendmail/
  • The Sendmail+Dialup mini-HOWTO v 1.00 by Leif Erlingsson <leif AT lege.com>, Jan P Tietze <jptietze AT mail.hh.provi.de>, Vincent Zweije <zweije AT xs4all.nl> http://www.lege.com/Sendmail+Dialup.v1.00.html
  • Configuring Sendmail for Offline Use mini-HOWTO by Simone Govoni <simgov AT tin.it> http://www.thinkunix.net/unix/email/sendmail/sendmail-offline.html
  • A quick HOWTO for genericstable (on comp.mail.sendmail) by Chris Johnston

7. Further Reading

Apart from the references above, you may want to check all the documentation that comes with sendmail.

  • Eric Allman, Sendmail: Installation and Operation Guide, file doc/op/op.ps in sendmail source archive.
  • Thomas Roessler, Sendmail Address Rewriting mini-HOWTO. http://www.guug.de/~roessler/genericstable.html
  • sendmail.org: Sendmail FAQ, especially the section on virtual users and generics table.
  • Sendmail on a dialup by Suresh Ramasubramanian http://www.hserus.net/sendmail.html

8. The patchfile

IMPORTANT: This patch is for sendmail v 8.12, if your version is different, this may not work. Have a look at older versions of this document for older versions of sendmail.

Most versions of the patch utility can patch your directories straight from this howto itself.

First change to the directory where your sendmail-cf m4 macros and documentation is. On RedHat this is /usr/share/sendmail-cf while on debian or source installs, it is /usr/share/sendmail/cf. Some older systems used /usr/lib/sendmail-cf - the patch would most likely not work with these systems.

To verify that you are in the correct directory, check that the feature, m4 and mailer directories are listed in there.

Then, run the patch command on this file:

patch -p0 < Hdr-Env-Masq-miniHOWTO.txt

That's it. Don't worry about all the stuff before the actual patch. The patch util knows to ignore everything until it finds the actual patch.

If the patch doesn't work for you, then you might have to revert to the steps outlined in version 1 of this document. If you have sendmail v 8.9, you can use the patch in version 1.1 of this document, for sendmail v 8.11, use version 1.2 of this Howto.

diff -Pru feature/egenericstable.m4 feature/egenericstable.m4
--- feature/egenericstable.m4	1970-01-01 01:00:00.000000000 +0100
+++ feature/egenericstable.m4	2003-10-25 14:30:34.000000000 +0200
@@ -0,0 +1,20 @@
+divert(-1)
+#
+# Copyright (c) 2001-2003 Philip S Tellis.  All rights reserved.
+#
+# This file added by Philip S Tellis for envelope rewriting.
+# Licence is the same as that of Sendmail.
+#
+#
+
+divert(0)
+VERSIONID(`@(#)egenericstable.m4, 1.2 2003/01/07 23:00:00 philip')
+divert(-1)
+
+define(`_EGENERICS_TABLE_', `')
+
+LOCAL_CONFIG
+# EGenerics table (mapping outgoing addresses in envelopes)
+Kegenerics ifelse(defn(`_ARG_'), `',
+                 DATABASE_MAP_TYPE MAIL_SETTINGS_DIR`egenericstable',
+                 `_ARG_')
diff -Pru m4/proto.m4 m4/proto.m4
--- m4/proto.m4	2003-10-25 13:41:48.000000000 +0200
+++ m4/proto.m4	2003-10-25 14:30:34.000000000 +0200
@@ -1333,6 +1333,25 @@
 R<lt; $+ > $* 			$#_LOCAL_ $@ $2    $: $1
 
 ###################################################################
+###  Ruleset EnvRewrite -- convert envelope names to masq form  ###
+###################################################################
+SEnvRewrite
+
+ifdef(`_EGENERICS_TABLE_', `dnl
+# handle generics database for envelope
+ifdef(`_GENERICS_ENTIRE_DOMAIN_',
+`R$+ <lt; @ $* $=G . >	$: <lt; $1@$2$3 > $1 <lt; @ $2$3 . > @	mark',
+`R$+ <lt; @ $=G . >	$: <lt; $1@$2 > $1 <lt; @ $2 . > @	mark')
+R$+ <lt; @ *LOCAL* >	$: <lt; $1@$j > $1 <lt; @ *LOCAL* > @ mark
+R<lt; $+ > $+ <lt; $* > @	$: <lt; $( egenerics $1 $: $) > $2 <lt; $3 >
+R<lt; > $+ <lt; @ $+ >	$: <lt; $( egenerics $1 $: $) > $1 <lt; @ $2 >
+R<lt; $* @ $* > $* <lt; $* >	$@ $>3 $1 @ $2			found qualified
+R<lt; $+ > $* <lt; $* >	$: $>3 $1 @ *LOCAL*		found unqualified
+R<lt; > $*		$: $1				not found',
+`dnl')
+
+
+###################################################################
 ###  Ruleset 93 -- convert header names to masqueraded form	###
 ###################################################################
 
@@ -1401,7 +1420,9 @@
 
 SMasqEnv=94
 ifdef(`_MASQUERADE_ENVELOPE_',
-`R$+			$@ $>MasqHdr $1',
+ifdef(`_EGENERICS_TABLE_',
+`R$+			$@ $>EnvRewrite $1',
+`R$+			$@ $>MasqHdr $1'),
 `R$* <lt; @ *LOCAL* > $*	$: $1 <lt; @ $j . > $2')
 
 ###################################################################
diff -Pru mailer/local.m4 mailer/local.m4
--- mailer/local.m4	2003-10-25 13:41:48.000000000 +0200
+++ mailer/local.m4	2003-10-25 14:32:28.000000000 +0200
@@ -42,7 +42,8 @@
 R@ <lt;@ $*>		$n			temporarily bypass Sun bogosity
 R$+			$: $>AddDomain $1	add local domain if needed
 ifdef(`_LOCAL_NO_MASQUERADE_', `dnl', `dnl
-R$*			$: $>MasqEnv $1		do masquerading')
+ifdef(`_EGENERICS_TABLE_', `dnl', `dnl
+R$*			$: $>MasqEnv $1		do masquerading')')
 
 #
 #  Envelope recipient rewriting

Wednesday, January 01, 2003

Categorical Index

Preface

System level hacks

Databases

Web stuff

Programming

Ideas and Applications

Hacks

...===...