[Bps-public-commit] app-wsgetmail branch update-stripcr created. 0.07-1-g0e0cdd4
BPS Git Server
git at git.bestpractical.com
Fri Sep 23 18:41:56 UTC 2022
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "app-wsgetmail".
The branch, update-stripcr has been created
at 0e0cdd4977102e31be7d40269e6a3df51d7739e5 (commit)
- Log -----------------------------------------------------------------
commit 0e0cdd4977102e31be7d40269e6a3df51d7739e5
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Fri Sep 23 14:40:25 2022 -0400
Update strip_cr to stripcr for compatibility with fetchmail
diff --git a/Changes b/Changes
index 0855a93..5e05edc 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
Revision history for App-wsgetmail
+0.08 22/09/23
+ * Update strip_cr to stripcr for more obvious compatibility
+ with the fetchmail option of the same name.
+
0.07 22/09/23
* Add documentation about error messages, warnings, and
diagnosing problems with processing.
diff --git a/README.md b/README.md
index 744aacf..c4d71a6 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ where `wsgetmail.json` looks like:
"global_access": 1,
"username": "rt-comment at example.com",
"folder": "Inbox",
- "strip_cr": 0,
+ "stripcr": 0,
"command": "/opt/rt5/bin/rt-mailgate",
"command_args": "--url=http://rt.example.com/ --queue=General --action=comment",
"command_timeout": 30,
@@ -60,7 +60,7 @@ A hash ref that is passed to construct the `mda` and `client` (see below).
## mda
-An instance of [App::wsgetmail::MDA](https://metacpan.org/pod/App%3A%3Awsgetmail%3A%3AMDA) created from our `config` object.
+An instance of [App::wsgetmail::MDA](https://metacpan.org/pod/App::wsgetmail::MDA) created from our `config` object.
## client\_class
@@ -203,13 +203,17 @@ configuration file.
Set this to the name string of a mail folder to read.
-- strip\_cr
+- stripcr
Set this to 1 to make wsgetmail convert the messages from the CRLF
line-ending encoding to the LF line-ending encoding.
- This is technically not standards-compliant, but some unix utilities
- don't work with CRLF line-endings.
+ This emulates the fetchmail option of the same name, which enabled
+ the stripcr option if an MDA was declared. The feature is similar,
+ but you need to enable it explicitly in your configuration.
+
+ This option is helpful if you are forwarding email to a Linux
+ utility that doesn't work with CRLF line-endings.
- command
@@ -307,9 +311,9 @@ of time.
# SEE ALSO
- [wsgetmail](https://metacpan.org/pod/wsgetmail)
-- [App::wsgetmail::MDA](https://metacpan.org/pod/App%3A%3Awsgetmail%3A%3AMDA)
-- [App::wsgetmail::MS365](https://metacpan.org/pod/App%3A%3Awsgetmail%3A%3AMS365)
-- [App::wsgetmail::MS365::Message](https://metacpan.org/pod/App%3A%3Awsgetmail%3A%3AMS365%3A%3AMessage)
+- [App::wsgetmail::MDA](https://metacpan.org/pod/App::wsgetmail::MDA)
+- [App::wsgetmail::MS365](https://metacpan.org/pod/App::wsgetmail::MS365)
+- [App::wsgetmail::MS365::Message](https://metacpan.org/pod/App::wsgetmail::MS365::Message)
# AUTHOR
diff --git a/lib/App/wsgetmail.pm b/lib/App/wsgetmail.pm
index 3676bc8..ab4e3d8 100644
--- a/lib/App/wsgetmail.pm
+++ b/lib/App/wsgetmail.pm
@@ -73,7 +73,7 @@ where C<wsgetmail.json> looks like:
"global_access": 1,
"username": "rt-comment at example.com",
"folder": "Inbox",
- "strip_cr": 0,
+ "stripcr": 0,
"command": "/opt/rt5/bin/rt-mailgate",
"command_args": "--url=http://rt.example.com/ --queue=General --action=comment",
"command_timeout": 30,
@@ -412,13 +412,17 @@ configuration file.
Set this to the name string of a mail folder to read.
-=item strip_cr
+=item stripcr
Set this to 1 to make wsgetmail convert the messages from the CRLF
line-ending encoding to the LF line-ending encoding.
-This is technically not standards-compliant, but some unix utilities
-don't work with CRLF line-endings.
+This emulates the fetchmail option of the same name, which enabled
+the stripcr option if an MDA was declared. The feature is similar,
+but you need to enable it explicitly in your configuration.
+
+This option is helpful if you are forwarding email to a Linux
+utility that doesn't work with CRLF line-endings.
=item command
diff --git a/lib/App/wsgetmail/MS365.pm b/lib/App/wsgetmail/MS365.pm
index 056e1e8..d17e30a 100644
--- a/lib/App/wsgetmail/MS365.pm
+++ b/lib/App/wsgetmail/MS365.pm
@@ -186,14 +186,14 @@ has post_fetch_action => (
required => 1
);
-=head2 strip_cr
+=head2 stripcr
A boolean. If true, the message content will have CRLF line terminators
converted to LF line terminators.
=cut
-has strip_cr => (
+has stripcr => (
is => 'ro',
required => 0,
);
@@ -250,7 +250,7 @@ around BUILDARGS => sub {
grep {
defined $config->{$_}
}
- qw(client_id tenant_id username user_password global_access secret folder post_fetch_action strip_cr debug)
+ qw(client_id tenant_id username user_password global_access secret folder post_fetch_action stripcr debug)
};
return $class->$orig($attributes);
@@ -309,7 +309,7 @@ sub get_message_mime_content {
# can we just write straight to file from response?
my $tmp = File::Temp->new( UNLINK => 0, SUFFIX => '.mime' );
my $content = $response->content;
- $content =~ s/\r$//mg if $self->strip_cr;
+ $content =~ s/\r$//mg if $self->stripcr;
print $tmp $content;
return $tmp->filename;
}
-----------------------------------------------------------------------
hooks/post-receive
--
app-wsgetmail
More information about the Bps-public-commit
mailing list