Mailing List Archive

Re: MailUtils...
In <Pine.LNX.3.91.950820220308.853B-100000@kjahds.com>
On Sun, 20 Aug 1995 22:06:18 -0400 (EDT)
Kenneth Albanowski <kjahds@kjahds.com> writes:
>Grahm, I haven't received word from you yet, so I'm trying another
>message: perlbug has been converted over to MailUtils (and is much more
>strict, Tom) but Mail::Util::maildomain has a couple of glitches: first,
>if either SMTP lookup fails because of an invalid address (unable to
>resolve "localhost" or "mailhost" then you get a warning message on the
>screen, and secondly, if it falls back to Sys::Domainname, then it only
>returns a domain name, and not a host, unlike the SMTP mail domains,
>which include hosts.

Apply this patch in the MailTools-1.02a directory this should improve
maildomain. It now also looks in /etc/sendmail.cf if it exists before
calling smtp.

This patch will not fix the warnings from the Net::SMTP module (just
remove the warn statement, that is all I am going to do)


On a related subject I always used ICRF for my ftp releases. As Jack Shirazi
has mentioned in an earlier message that he cannot maintain that site anymore.
Could someone mention another site I could send my releases to


Regards,
Graham.

--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--
diff -c -r ../MailTools-1.02a/lib/Mail/Util.pm lib/Mail/Util.pm
*** ../MailTools-1.02a/lib/Mail/Util.pm Mon Aug 14 13:37:11 1995
--- lib/Mail/Util.pm Tue Aug 22 07:13:49 1995
***************
*** 6,12 ****

package Mail::Util;

! sub Version { sprintf("%d.%02da", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/) }

require 5.000;
require AutoLoader;
--- 6,12 ----

package Mail::Util;

! sub Version { sprintf("%d.%02da", q$Revision: 1.3 $ =~ /(\d+)\.(\d+)/) }

require 5.000;
require AutoLoader;
***************
*** 16,22 ****

@ISA = qw(Exporter AutoLoader);

! @EXPORT_OK = qw(read_mbox maildomain);

1;

--- 16,22 ----

@ISA = qw(Exporter AutoLoader);

! @EXPORT_OK = qw(read_mbox maildomain mailaddress);

1;

***************
*** 51,58 ****
--- 51,84 ----
}

sub maildomain {
+
+ ##
+ ## return imediately if already found
+ ##
+
return $domain if(defined $domain);

+ ##
+ ## Try sendmail config file if exists
+ ##
+
+ local *CF;
+
+ if(open(CF,"/etc/sendmail.cf")) {
+ while(<CF>) {
+ if(/\ADF(\S+)/) {
+ $domain = $1;
+ last;
+ }
+ }
+ close(CF);
+ return $domain if(defined $domain);
+ }
+
+ ##
+ ## Try a SMTP connection to 'mailhost'
+ ##
+
if(eval "require Net::SMTP") {

my $smtp = Net::SMTP->new("mailhost");
***************
*** 65,76 ****
}
}

unless(defined $domain) {
! if(eval "require Sys::Domainname") {
! $domain = Sys::Domainname::domainname();
}
}

return $domain;
}

--- 91,133 ----
}
}

+ ##
+ ## Use internet domain name, if it can be found
+ ##
+
unless(defined $domain) {
! if(eval "require Sys::Domainname" && eval "require Sys::Hostname") {
! my $host = (split(/\./,Sys::Hostname::hostname()))[0];
!
! $domain = $host . "." . Sys::Domainname::domainname();
}
}

return $domain;
+ }
+
+ sub mailaddress {
+
+ ##
+ ## Return imediately if already found
+ ##
+
+ return $mailaddress if(defined $mailaddress);
+
+ ##
+ ## first look for $ENV{MAILADDRESS}
+ ##
+
+ return $mailaddress = $ENV{MAILADDRESS} if(defined $ENV{MAILADDRESS});
+
+ ##
+ ## Default to user name and maildomain
+ ##
+
+ maildomain() unless(defined $domain);
+
+ my $user = $ENV{USER} || $ENV{LOGNAME} || "";
+
+ $mailaddress = $user . "@" . $domain;
}

--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--%<--

--
.-----------------------------------------------------------.
//// | Graham Barr Email: bodg@tiuk.ti.com | \\\\
| 00 | VLSI Cell Designer or: bodg@ti.com | 00 |
O ^ | MOS Design TI MSG: BODG | ^ O
\ ~/ | Texas Instruments Ltd Phone: +44 (0)1604 66 3419 | \~ /
| ENGLAND Fax: +44 (0)1604 66 3456 |
`-----------------------------------------------------------'
Re: MailUtils... [ In reply to ]
Citing Graham Barr:
On a related subject I always used ICRF for my ftp releases. As Jack Shirazi
has mentioned in an earlier message that he cannot maintain that site anymore.
Could someone mention another site I could send my releases to

Yes, please,

be the first to use my upload facilities!

ftp://franz.ww.tu-berlin.de/incoming

After you've uploaded, dial

http://franz.ww.tu-berlin.de/cgi-bin/pml/user/pml_add_url

authenticate yourself as GBARR with the password I sent to you earlier
and type in the filename. (If your file has another URL, say,
temporarily, then you can enter this URL as well)

Every full hour the stuff from franz goes to

ftp://ftp.pasteur.fr/pub/Perl/CPAN/pml/byauthor

which is the place you should announce (franz is not well connected
and will delete files after a short period).



Hope you like it,
andreas

PS: This service is valid for everybody on the module list. If I
haven't sent you a password yet, and you need one, mail me. It would
be very handy, if you would send me your PGP public key for that
matter.
Re: MailUtils... [ In reply to ]
On Tue, 22 Aug 1995, Graham Barr wrote:

> Apply this patch in the MailTools-1.02a directory this should improve
> maildomain. It now also looks in /etc/sendmail.cf if it exists before
> calling smtp.

You might also like to try /usr/lib/smail/config, although I have no idea
how standard it'll be.

> This patch will not fix the warnings from the Net::SMTP module (just
> remove the warn statement, that is all I am going to do)

Fine. With the patches, my perlbug 1.05 works just fine (modulus the fact
that somebody is leaking a site named "localhost" which gives fits to the
SMTP("localhost") bit.) I'll post 1.05.

> Regards,
> Graham.

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: MailUtils... [ In reply to ]
In <Pine.LNX.3.91.950822224602.1076A-100000@kjahds.com>
On Tue, 22 Aug 1995 22:48:31 -0400 (EDT)
Kenneth Albanowski <kjahds@kjahds.com> writes:
>On Tue, 22 Aug 1995, Graham Barr wrote:
>
>> Apply this patch in the MailTools-1.02a directory this should improve
>> maildomain. It now also looks in /etc/sendmail.cf if it exists before
>> calling smtp.
>
>You might also like to try /usr/lib/smail/config, although I have no idea
>how standard it'll be.

Hmm. We do not have this file here. Is this just another location for sendmail
config file or does it have a different format.

Are there any other places where this infomation might be found ?

>> This patch will not fix the warnings from the Net::SMTP module (just
>> remove the warn statement, that is all I am going to do)
>
>Fine. With the patches, my perlbug 1.05 works just fine (modulus the fact
>that somebody is leaking a site named "localhost" which gives fits to the
>SMTP("localhost") bit.) I'll post 1.05.

Regards,
Graham.

--
.-----------------------------------------------------------.
//// | Graham Barr Email: bodg@tiuk.ti.com | \\\\
| 00 | VLSI Cell Designer or: bodg@ti.com | 00 |
O ^ | MOS Design TI MSG: BODG | ^ O
\ ~/ | Texas Instruments Ltd Phone: +44 (0)1604 66 3419 | \~ /
| ENGLAND Fax: +44 (0)1604 66 3456 |
`-----------------------------------------------------------'
Re: MailUtils... [ In reply to ]
On Wed, 23 Aug 1995, Graham Barr wrote:

> >You might also like to try /usr/lib/smail/config, although I have no idea
> >how standard it'll be.
>
> Hmm. We do not have this file here. Is this just another location for sendmail
> config file or does it have a different format.
>
> Are there any other places where this infomation might be found ?

It's not part of sendmail, it's part of smail. I give you an extract of
mine:

#
# smail configuration for kjahds.com
# (see smail(5) man page for details and other options)
#
hostname=kjahds.com
visible_domain=com
retry_interval=35s
more_hostnames=kjahds.com
postmaster=postmaster
#delivery_mode=foreground
smtp_accept_max=10
smtp_banner="$primary_name Linux Smail$version #$compile_num ready at $date"
received_field="Received: \
${if def:sender_host \
{from $sender_host by $primary_name \
${if def:sender_proto: with $sender_proto}\
(Linux Smail$version #$compile_num) }\
else{by $primary_name ${if def:sender_proto:with $sender_proto }\
(Linux Smail$version #$compile_num) }}\
id $message_id;\n\t $spool_date"


--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: MailUtils... [ In reply to ]
On Thu, 24 Aug 1995, Graham Barr wrote:

> >From this the smtp_banner string tells me that the mail domain is $primary_name
> but you don't show what $primary_name is set to, or is it equal to
> $hostname in all cases as it seems to be in your case.

From digesting the manual:

`hostnames' or `hostname' is a colon separated of host names. The first
entry is the `primary name'. Exactly how these interact with `domains'
which is also a colon separated list is unclear. `visible_domain' is the
domain used on outgoing mail, so it's a real good bet, but it seems to be
separated from the hostname.

Guessing the first thing in hostnames or hostname probably will be good
enough.


> Regards,
> Graham.

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)
Re: MailUtils... [ In reply to ]
In <Pine.LNX.3.91.950823175324.585B-100000@kjahds.com>
On Wed, 23 Aug 1995 17:54:19 -0400 (EDT)
Kenneth Albanowski <kjahds@kjahds.com> writes:
>On Wed, 23 Aug 1995, Graham Barr wrote:
>
>> >You might also like to try /usr/lib/smail/config, although I have no idea
>> >how standard it'll be.
>>
>> Hmm. We do not have this file here. Is this just another location for sendmail
>> config file or does it have a different format.
>>
>> Are there any other places where this infomation might be found ?
>
>It's not part of sendmail, it's part of smail. I give you an extract of
>mine:
>
>#
># smail configuration for kjahds.com
># (see smail(5) man page for details and other options)
>#
>hostname=kjahds.com
>visible_domain=com
>retry_interval=35s
>more_hostnames=kjahds.com
>postmaster=postmaster
>#delivery_mode=foreground
>smtp_accept_max=10
>smtp_banner="$primary_name Linux Smail$version #$compile_num ready at $date"
>received_field="Received: \
> ${if def:sender_host \
> {from $sender_host by $primary_name \
> ${if def:sender_proto: with $sender_proto}\
> (Linux Smail$version #$compile_num) }\
> else{by $primary_name ${if def:sender_proto:with $sender_proto }\
> (Linux Smail$version #$compile_num) }}\
> id $message_id;\n\t $spool_date"

From this the smtp_banner string tells me that the mail domain is $primary_name
but you don't show what $primary_name is set to, or is it equal to
$hostname in all cases as it seems to be in your case.

Regards,
Graham.

--
.-----------------------------------------------------------.
//// | Graham Barr Email: bodg@tiuk.ti.com | \\\\
| 00 | VLSI Cell Designer or: bodg@ti.com | 00 |
O ^ | MOS Design TI MSG: BODG | ^ O
\ ~/ | Texas Instruments Ltd Phone: +44 (0)1604 66 3419 | \~ /
| ENGLAND Fax: +44 (0)1604 66 3456 |
`-----------------------------------------------------------'
Re: MailUtils... [ In reply to ]
On Tue, 22 Aug 1995, Graham Barr wrote:

> Apply this patch in the MailTools-1.02a directory this should improve
> maildomain. It now also looks in /etc/sendmail.cf if it exists before
> calling smtp.

You might also like to try /usr/lib/smail/config, although I have no idea
how standard it'll be.

there is also /etc/mail/sendmail.cf for a number of machines,
or, /usr/lib/sendmail.cf for older BSD (i think ultrix puts it
here) machines.

hmm.. looking at the sendmail 8 sources, also these dirs:

/etc/sendmail/sendmail.cf, /etc/ucblib/sendmail.cf are used by
some systems.

.mrg.