Unverified Commit 6f776fd8 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Merge branch 'main' of codeberg.org:derf/travelynx

parents 212ec032 e80dbf41
Loading
Loading
Loading
Loading
+3 −0
Changes for cpanfile: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -29,3 +29,6 @@ requires 'Travel::Status::DE::HAFAS', '>= 6.20';
requires 'Travel::Status::DE::IRIS';
requires 'UUID::Tiny';
requires 'XML::LibXML';

requires 'MIME::Base64';
requires 'Authen::SASL';
+5 −2
Changes for examples/docker/email-transport.sh: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
#!/bin/sh

export EMAIL_SENDER_TRANSPORT=SMTP
export EMAIL_SENDER_TRANSPORT_HOST=smtp.example.com
export EMAIL_SENDER_TRANSPORT_PORT=25
# [INFO] You can set any of the attributes found here:
# https://metacpan.org/pod/Email::Sender::Transport::SMTP#ATTRIBUTES
# For example, the following lines set the attributes host and port
export EMAIL_SENDER_TRANSPORT_host=smtp.example.com
export EMAIL_SENDER_TRANSPORT_port=25
+14 −4
Changes for lib/Travelynx/Helper/Sendmail.pm: 14 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -6,11 +6,13 @@ package Travelynx::Helper::Sendmail;

use strict;
use warnings;
use feature 'try';

use 5.020;
use 5.040;

use DateTime;
use Encode                qw(encode);
use Email::Sender::Simple qw(try_to_sendmail);
use Email::Sender::Simple qw(sendmail);
use MIME::Entity;

sub new {
@@ -26,10 +28,12 @@ sub custom {
		To             => $to,
		From           => $self->{config}{from},
		Subject        => encode( 'MIME-Header', $subject ),
		Type     => 'text/plain',
		Type           => 'text/plain;format=flowed',
		Charset        => 'UTF-8',
		Encoding       => 'quoted-printable',
		Data           => encode( 'utf-8', $body ),
		"MIME-Version" => '1.0',
		"Date"         => DateTime->now->strftime("%a, %d %b %Y %H:%M:%S %z"),
	);

	if ( $self->{config}->{disabled} ) {
@@ -39,7 +43,13 @@ sub custom {
		return 1;
	}

	return try_to_sendmail($reg_mail);
	try {
		return sendmail($reg_mail);
	}
	catch ($e) {
		$self->{log}->error("Sendmail.pm: sendmail error ${e}");
		return 0;
	}
}

sub age_deletion_notification {