Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
e034926b
Commit
e034926b
authored
21 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Bulk mail script (created by "The Hanged Man", edited by me).
parent
ea9c10f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/bulkmail.js
+93
-0
93 additions, 0 deletions
exec/bulkmail.js
with
93 additions
and
0 deletions
exec/bulkmail.js
0 → 100644
+
93
−
0
View file @
e034926b
// bulkmail.js
// Bulk email all users that match AR String input
// written by the hanged man, Solace BBS, solace.synchro.net
load
(
"
sbbsdefs.js
"
);
const
REVISION
=
"
$Revision$
"
.
split
(
'
'
)[
1
];
print
(
"
Synchronet BulkMailer
"
+
REVISION
);
print
(
"
Enter ARS matches to send mail to or [ENTER] for everyone
"
);
printf
(
"
ARS to match:
"
);
if
((
ars
=
console
.
getstr
(
40
,
K_UPPER
))
==
undefined
)
exit
();
printf
(
"
\r\n\
1y
\
1hSubject:
"
);
if
((
subj
=
console
.
getstr
(
70
,
K_LINE
))
==
""
)
exit
();
fname
=
system
.
temp_dir
+
"
bulkmsg.txt
"
;
file_remove
(
fname
)
console
.
editfile
(
fname
);
if
(
!
fexist
(
fname
))
// Edit aborted
exit
();
file
=
new
File
(
fname
);
if
(
!
file
.
open
(
"
rt
"
))
{
log
(
"
!ERROR
"
+
errno_str
+
"
opening
"
+
fname
);
exit
();
}
msgtxt
=
lfexpand
(
file
.
read
(
file_size
(
fname
)));
file
.
close
();
delete
file
;
if
(
msgtxt
==
""
)
exit
();
msgbase
=
new
MsgBase
(
"
mail
"
);
if
(
msgbase
.
open
()
==
false
)
{
log
(
"
!ERROR
"
+
msgbase
.
last_error
);
exit
();
}
var
u
;
// user object
if
(
system
.
lastuser
!=
undefined
)
lastuser
=
system
.
lastuser
;
// v3.11
else
lastuser
=
system
.
stats
.
total_users
;
// v3.10
var
sent
=
0
;
for
(
i
=
1
;
i
<=
lastuser
;
i
++
)
{
u
=
new
User
(
i
);
if
(
!
u
.
compare_ars
(
ars
))
continue
;
/*checking for netmail forward */
if
(
u
.
settings
&
USER_NETMAIL
&&
u
.
netmail
.
length
)
hdr
=
{
to_net_addr
:
u
.
netmail
,
to_net_type
:
NET_INTERNET
};
else
hdr
=
{
to_ext
:
String
(
u
.
number
)
};
hdr
.
to
=
u
.
alias
;
hdr
.
from
=
system
.
operator
;
hdr
.
from_ext
=
"
1
"
;
hdr
.
subject
=
subj
;
printf
(
"
Sending mail to %s #%u
\r\n
"
,
hdr
.
to
,
i
);
if
(
!
msgbase
.
save_msg
(
hdr
,
msgtxt
))
log
(
"
!ERROR
"
+
msgbase
.
last_error
+
"
saving bulkmail message
"
);
else
{
log
(
format
(
"
Sent bulk mail message to: %s #%u
"
,
u
.
alias
,
i
));
sent
++
;
}
}
msgbase
.
close
();
if
(
sent
>
1
)
{
print
(
"
Sent bulk mail to
"
+
sent
+
"
users
"
);
log
(
"
Sent bulk mail message to
"
+
sent
+
"
users
"
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment