Mailing List CGatePro@mail.stalker.com Message #92720
From: Martin.Hepworth <martinh@solidstatelogic.com>
Subject: RE: Problem with legacy "mail" program
Date: Tue, 25 Sep 2007 14:59:54 +0100
To: CommuniGate Pro Discussions <CGatePro@mail.stalker.com>
X-Mailer: CommuniGate Pro MAPI Connector 1.2.12/1.2.12
John

Or create an email group on CGP and email to that instead...

--
Martin Hepworth
Snr Systems Administrator
Solid State Logic
Tel: +44 (0)1865 842300

> -----Original Message-----
> From: CommuniGate Pro Discussions [mailto:CGatePro@mail.stalker.com] On
> Behalf Of John Rudd
> Sent: 23 September 2007 07:36
> To: CommuniGate Pro Discussions
> Subject: Problem with legacy "mail" program
>
>
> The documentation for the legacy "mail" program says this:
>
> mail [-iInv]  [-d base-directory]
>       [-s subject] [-f from-address]
>       [-c Cc-addresses] [-b bcc-addresses] to-addresses
>
>
>
> In order to be compatible with legacy unix "mail" commands, the
> to-addresses need to be _space_ delimited instead of comma delimited.
> By providing a symlink from /usr/bin/mailx to /opt/CommuniGate/mail, for
> example, scripts called from cron which invoke the following:
>
>
> /usr/bin/mailx -s "Nightly Report" sysadmin@domain
> applicationadmin@domain servicemanager@domain
>
>
> break with the following error:
>
> usage: /bin/mailx [-iInv] [-d BaseDirectory] [-s Subject] [-c addresses]
> [-b addresses] [addresses]
>
>
> Yet, the space delimited syntax is the _correct_ syntax for the unix
> mail command (the thing which the CGP mail command is attempting to
> emulate).  The comma delimited syntax that CGP's mail command expects is
> NOT the correct syntax.
>
>
> My recommendation is to allow all 3 of the following:
>
> 1) allow comma delimited addresses for Cc-addresses bcc-addresses and
> to-addresses (same behavior as now)
>
> 2) allow multiple -c and -b arguments in order to specify multiple
> recipients, adding each extra argument to the list of that type of
> recipient (thus "mail -c tom -c dick harry" is semantically the same as
> "mail -c tom,dick harry").
>
> 3) if there are extra words on the command line past the to-addresses,
> add them to the list of to-addresses, providing the correct mail/mailx
> behavior.
>
>
> This will allow both comma and space delimited syntax to work, even
> allowing both to work at the same time.  This provides compatibility
> with both the legacy unix commands AND the legacy CGP legacy commands.
>
>
>
> (in order to keep solaris patches from re-enabling sendmail, I have a
> script that runs out of /var/CommuniGate/Startup.sh which checks to be
> sure /usr/lib/sendmail /usr/bin/mail and /usr/bin/mailx are all symlinks
> to the legacy CGP programs, or replaces them with symlinks if they're
> not ... so even if solaris tries to start sendmail, it will fail because
> the -bd argument isn't supported by CGP's legacy programs)
>
>
>
> Also, it might be a good idea to add -E to the list of arguments for
> "mail" (solaris, by default, runs "/bin/mail -E" from /etc/profile and
> /etc/.login, to see if you have new mail).  My suggestion is that the -E
> argument should cause an exit status of 1 (no mail).
>
>
>
> For those who are interested, here's the script I run out of Startup.sh:
>
> #!/usr/local/bin/perl
>
>
> sub movefile {
>     my $file = shift(@_);
>     my $i = shift(@_);
>     my $inc = $i + 1;
>     my $oldfile = ($i) ? ($file . "." . $i) : ($file);
>     my $newfile = $file . "." . $inc;
>
>     if (-e $newfile) {
>        movefile($file, $inc);
>        }
>     print "renaming $oldfile to $newfile\n";
>     rename($oldfile, $newfile);
>     }
>
> sub fixlink {
>     my $file = shift(@_);
>     my $target = shift(@_);
>     my ($i);
>
>     unless ( (-l $file) && (readlink($file) eq $target) ) {
>        movefile($file, 0);
>        print "symlinking $file -> $target\n";
>        symlink($target, $file);
>        }
>     }
>
> fixlink("/usr/lib/sendmail", "/opt/CommuniGate/sendmail");
> fixlink("/usr/bin/mailx", "/opt/CommuniGate/mail");
> fixlink("/usr/bin/mail", "/opt/CommuniGate/mail");
>
>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list <CGatePro@mail.stalker.com>.
> To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
> To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
> To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
> Send administrative queries to  <CGatePro-request@mail.stalker.com>




**********************************************************************
Confidentiality : This e-mail and any attachments are intended for the
addressee only and may be confidential. If they come to you in error
you must take no action based on them, nor must you copy or show them
to anyone. Please advise the sender by replying to this e-mail
immediately and then delete the original from your computer.
Opinion : Any opinions expressed in this e-mail are entirely those of
the author and unless specifically stated to the contrary, are not
necessarily those of the author's employer.
Security Warning : Internet e-mail is not necessarily a secure
communications medium and can be subject to data corruption. We advise
that you consider this fact when e-mailing us.
Viruses : We have taken steps to ensure that this e-mail and any
attachments are free from known viruses but in keeping with good
computing practice, you should ensure that they are virus free.

Red Lion 49 Ltd T/A Solid State Logic
Registered as a limited company in England and Wales
(Company No:5362730)
Registered Office: 25 Spring Hill Road, Begbroke, Oxford OX5 1RU,
United Kingdom
**********************************************************************

Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster