Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
d324d476
Commit
d324d476
authored
Dec 27, 2001
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New version of mail_to_db.pl
tests/mail_to_db.pl: New verision of mail_to_db.pl
parent
e0473960
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
15 deletions
+51
-15
tests/mail_to_db.pl
tests/mail_to_db.pl
+51
-15
No files found.
tests/mail_to_db.pl
View file @
d324d476
...
@@ -17,7 +17,7 @@ use DBI;
...
@@ -17,7 +17,7 @@ use DBI;
use
Getopt::
Long
;
use
Getopt::
Long
;
$|
=
1
;
$|
=
1
;
$VER
=
"
2.
5
";
$VER
=
"
2.
6
";
$opt_help
=
0
;
$opt_help
=
0
;
$opt_version
=
0
;
$opt_version
=
0
;
...
@@ -153,29 +153,64 @@ sub main
...
@@ -153,29 +153,64 @@ sub main
$ignored
=
(
$mail_no_from_f
+
$mail_no_subject_f
+
$mail_no_txt_f
+
$ignored
=
(
$mail_no_from_f
+
$mail_no_subject_f
+
$mail_no_txt_f
+
$mail_too_big
+
$mail_duplicates
+
$mail_fixed
);
$mail_too_big
+
$mail_duplicates
+
$mail_fixed
);
print
"
Mails inserted:
\t\t\t\t\t
$mail_inserted
\n\n
";
print
"
################################ Mail Report #################################
\n\n
";
print
"
Mails inserted:
\t\t\t\t\t
$mail_inserted
\n
";
print
"
---------------
";
print
"
=
"
.
"
=
"
x
length
("
$mail_inserted
")
.
"
=
\n\n
";
if
(
$ignored
)
if
(
$ignored
)
{
{
print
"
Ignored mails
\n
";
print
"
Ignored mails
\n
";
print
"
-------------
\n
";
print
"
-------------
\n
";
$mail_no_from_f
?
if
(
$mail_no_from_f
)
print
"
Reason: mail without
\"
From:
\"
-field:
\t\t
$mail_no_from_f
\n
"
:
{
print
"
Reason: mail without
\"
From:
\"
-field:
\t\t
$mail_no_from_f
\n
";
}
else
{
print
"";
print
"";
$mail_no_txt_f
?
}
print
"
Reason: mail without message:
\t\t\t
$mail_no_txt_f
\n
"
:
if
(
$mail_no_txt_f
)
{
print
"
Reason: mail without message:
\t\t\t
$mail_no_txt_f
\n
";
}
else
{
print
"";
print
"";
$mail_no_subject_f
?
}
print
"
Reason: mail without subject:
\t\t\t
$mail_no_subject_f
\n
"
:
if
(
$mail_no_subject_f
)
{
print
"
Reason: mail without subject:
\t\t\t
$mail_no_subject_f
\n
";
}
else
{
print
"";
print
"";
$mail_too_big
?
}
print
"
Reason: mail too big (over
$opt_max_mail_size
bytes):
\t
$mail_too_big
\n
"
:
if
(
$mail_too_big
)
{
print
"
Reason: mail too big, over
$opt_max_mail_size
bytes:
\t\t
";
print
$mail_too_big
;
print
"
(see --max_mail_size=#)
\n
";
}
else
{
print
"";
print
"";
$mail_duplicates
?
}
print
"
Reason: duplicate mail, or in db already:
\t
$mail_duplicates
\n
"
:
if
(
$mail_duplicates
)
{
print
"
Reason: duplicate mail, or in db already:
\t
$mail_duplicates
\n
";
}
else
{
print
"";
print
"";
$mail_fixed
?
}
print
"
Reason: mail was an unsubscribe - mail:
\t\t
$mail_fixed
\n
"
:
if
(
$mail_fixed
)
{
print
"
Reason: mail was an unsubscribe - mail:
\t\t
$mail_fixed
\n
";
}
else
{
print
"";
print
"";
}
print
"
";
print
"
";
print
"
=
"
.
"
=
"
x
length
("
$ignored
")
.
"
=
\n
";
print
"
=
"
.
"
=
"
x
length
("
$ignored
")
.
"
=
\n
";
print
"
Total number of ignored mails:
\t\t\t
$ignored
\n\n
";
print
"
Total number of ignored mails:
\t\t\t
$ignored
\n\n
";
...
@@ -187,6 +222,7 @@ sub main
...
@@ -187,6 +222,7 @@ sub main
print
"
% Ignored:
";
print
"
% Ignored:
";
print
sprintf
("
%.1f
",
((
$ignored
/
(
$mail_inserted
+
$ignored
))
*
100
));
print
sprintf
("
%.1f
",
((
$ignored
/
(
$mail_inserted
+
$ignored
))
*
100
));
print
"
%)
\n
";
print
"
%)
\n
";
print
"
################################ End Report ##################################
\n
";
exit
(
0
);
exit
(
0
);
}
}
...
@@ -291,7 +327,7 @@ sub process_mail_file
...
@@ -291,7 +327,7 @@ sub process_mail_file
$values
{
$type
}
.=
"
\n
"
.
$_
;
$values
{
$type
}
.=
"
\n
"
.
$_
;
$check
--
;
$check
--
;
}
}
elsif
(
/^From .* \d\d:\d\d:\d\d\s\d\d\d\d
$
/
||
elsif
(
/^From .* \d\d:\d\d:\d\d\s\d\d\d\d/
||
/^From .* \d\d\d\d\s\d\d:\d\d:\d\d/
)
/^From .* \d\d\d\d\s\d\d:\d\d:\d\d/
)
{
{
$values
{'
hash
'}
=
checksum
("
$values
{'message'}
");
$values
{'
hash
'}
=
checksum
("
$values
{'message'}
");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment