25Oct01=======================================================================
1. added unset/password command to allow sysops (only) to completely delete
and remove a user's password.
+2. make 'read' increment the 'no of times read' for all messages.
+3. give a read receipt for everybody that reads a message so marked.
+4. enhance set/email so that if you set email address(es) with this command
+it will send any messages to your callsign as they come in. unset/email
+will disable forwarding. This probably only works for unix systems. To enable
+this feature you need to download Mail::Send from CPAN and install it.
+(http://www.cpan.org/modules/by-module/Mail/Mail-Tools-1.40.tar.gz). If you
+don't want this then it should work without.
24Oct01=======================================================================
1. added (un)set/register, show/registered commands which when a 'set/var
$main::reqreg = 1' is done in the startup script will require users to
YOU DO NOT NEED TO USE THIS COMMAND IF YOU ARE CONNECTED VIA AX25.
+=== 0^SET/EMAIL <email> ...^Set email address(es) and forward your personals
+=== 0^UNSET/EMAIL^Stop personal msgs being forwarded by email
+If any personal messages come in for your callsign then you can use
+these commands to control whether they are forwarded onto your email
+address. To enable the forwarding do something like:-
+
+ SET/EMAIL mike.tubby@somewhere.com
+
+You can have more than one email address (each one separated by a space).
+Emails are forwarded to all the email addresses you specify.
+
+You can disable forwarding by:-
+
+ UNSET/EMAIL
+
=== 0^SET/HERE^Tell the system you are present at your terminal
=== 0^UNSET/HERE^Tell the system you are absent from your terminal
@body = $ref->read_msg_body;
push @out, @body;
- # mark my privates as read
- if ($ref->private && $self->call eq $ref->to && $ref->read == 0) {
- $ref->read(1);
- $ref->store(\@body); # note call by reference!
+ # mark it as read
+ $ref->read($ref->read() + 1);
+ $ref->store(\@body); # note call by reference!
- # if it had a read receipt on it generate a new message to send back to
- # the sender.
- if ($ref->rrreq) {
- my $sub = $ref->subject;
- $sub = "Re: $sub" unless $sub =~ /^\s*re:/i;
- my $to = $ref->to;
- my $from = $ref->from;
- my $rref = DXMsg->alloc(1, $from, $main::mycall, time,
- 1, $sub, $main::mycall, 0, 0 );
- my $msgno = DXMsg::next_transno("Msgno");
- $rref->msgno($msgno);
- $rref->gotit( [ "$main::mycall" ] );
- $rref->store( [ "Return receipt from delivering node. Message read by $to." ] );
- DXMsg::add_dir($rref);
- DXMsg::queue_msg(0);
- }
+ # if it had a read receipt on it generate a new message to send back to
+ # the sender.
+ if ($ref->rrreq) {
+ my $sub = $ref->subject;
+ $sub = "Re: $sub" unless $sub =~ /^\s*re:/i;
+ my $to = $ref->to;
+ my $from = $ref->from;
+ my $rref = DXMsg->alloc(1, $from, $main::mycall, time,
+ 1, $sub, $main::mycall, 0, 0 );
+ my $msgno = DXMsg::next_transno("Msgno");
+ $rref->msgno($msgno);
+ $rref->gotit( [ "$main::mycall" ] );
+ $rref->store( [ "Return receipt from delivering node. Message read by $to." ] );
+ DXMsg::add_dir($rref);
+ DXMsg::queue_msg(0);
}
# remember this one as the last one read
$self->lastread($msgno);
-
-
}
return (1, @out);
my $call = $self->call;
my $user;
-# remove leading and trailing spaces
-$line =~ s/^\s+//;
-$line =~ s/\s+$//;
-$line =~ s/[{}]//g; # remove any braces
+$line =~ s/[<>()\[\]{}]//g; # remove any braces
+my @f = split /\s+/, $line;
return (1, $self->msg('emaile1')) if !$line;
$user = DXUser->get_current($call);
if ($user) {
- $user->email($line);
+ $user->email(\@f);
+ $user->wantemail(1);
$user->put();
return (1, $self->msg('emaila', $line));
} else {
--- /dev/null
+#
+# unset the email address of the user
+#
+# Copyright (c) 2001 - Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my $call = $self->call;
+my $user;
+
+$user = DXUser->get_current($call);
+if ($user) {
+ $user->wantemail(0);
+ $user->put();
+ return (1, $self->msg('emaila', $line));
+} else {
+ return (1, $self->msg('namee2', $call));
+}
+
use IO::File;
use Fcntl;
+eval {
+ require Mail::Send;
+};
+
use strict;
use vars qw($VERSION $BRANCH);
$ref->{msgno} = next_transno("Msgno");
push @{$ref->{gotit}}, $fromnode; # mark this up as being received
$ref->store($ref->{lines});
+ $ref->notify;
add_dir($ref);
- my $dxchan = DXChannel->get($ref->{to});
- $dxchan->send($dxchan->msg('m9')) if $dxchan && $dxchan->is_user;
Log('msg', "Message $ref->{msgno} from $ref->{from} received from $fromnode for $ref->{to}");
}
}
}
+sub notify
+{
+ my $ref = shift;
+ my $to = $ref->{to};
+ my $uref = DXUser->get($to);
+ my $dxchan = DXChannel->get($to);
+ if (*Mail::Send && $uref && $uref->wantemail) {
+ my $email = $uref->email;
+ if ($email) {
+ my @list = ref $email ? @{$email} : $email;
+ my $msg = new Mail::Send Subject=>"[DXSpider: $ref->{from}] $ref->{subject}";
+ $msg->to(@list);
+ my $fh = $msg->open;
+ print $fh "From: $ref->{from} To: $to On Node: $main::mycall Origin: $ref->{origin} Msgno: $ref->{msgno}\r\n\r\n";
+ print $fh map {"$_\r\n"} $ref->read_msg_body;
+ $fh->close;
+ for (@list) {
+ Log('msg', "Msgno $ref->{msgno} from $ref->{from} emailed to $_");
+ }
+ }
+ }
+ $dxchan->send($dxchan->msg('m9')) if $dxchan && $dxchan->is_user;
+}
+
# store a message away on disc or whatever
#
# NOTE the second arg is a REFERENCE not a list
$ref->add_dir();
push @out, $self->msg('m11', $ref->{msgno}, $to);
#push @out, "msgno $ref->{msgno} sent to $to";
- my $dxchan = DXChannel->get(uc $to);
- if ($dxchan) {
- if ($dxchan->is_user()) {
- $dxchan->send($dxchan->msg('m9'));
- }
- }
+ $ref->notify;
}
} else {
Log('msg', $self->call . " swore to @{$loc->{to}} subject: '$loc->{subject}' in msg, REJECTED");
$mref->add_dir();
push @out, $dxchan->msg('m11', $mref->{msgno}, $to);
#push @out, "msgno $ref->{msgno} sent to $to";
- my $todxchan = DXChannel->get(uc $to);
- if ($todxchan) {
- if ($todxchan->is_user()) {
- $todxchan->send($todxchan->msg('m9'));
- }
- }
+ $mref->notify;
}
}
return @out;
wanttalk => '0,Rec Talk,yesno',
wantwx => '0,Rec WX,yesno',
wantdx => '0,Rec DX Spots,yesno',
+ wantemail => '0,Rec Msgs as Email,yesno',
pagelth => '0,Current Pagelth',
pingint => '9,Node Ping interval',
nopings => '9,Ping Obs Count',
return _want('grid', @_);
}
+sub wantemail
+{
+ return _want('email', @_);
+}
+
sub wantann_talk
{
return _want('ann_talk', @_);