[SOLVED]Lost Password sender

Moderator: crythias

Post Reply
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

[SOLVED]Lost Password sender

Post by chrotha »

Hey everyone,

I have a question about which email address sends the lost password email for the users.
I have a news OTRS installation, currently using the version 6.0.40, and I checked that the email address that sends the lost password email, is the administrator's email. Is there any way to change this setting? I want the notification email address, to also send the lost password emails.

Thanks in advance
Last edited by chrotha on 23 Mar 2023, 16:58, edited 3 times in total.
wurzel
Znuny guru
Posts: 3224
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: Lost Password sender

Post by wurzel »

Hi,

you may check sysconfig for admin e-mail address setting.

Flo
OTRS 8 SILVER (Prod)
OTRS 8 auf Debian 11 (Test)
Znuny 7.x latest version testing auf Debian 11

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

Re: Lost Password sender

Post by chrotha »

Hi Flo,

Thanks for the quick reply.
The admin email is correct, my fear is that, if I change it, the error emails will start going to the notification Sender instead of our admin email.
I'm in doubt if I can use the SendmailEnvelopeFrom to send the lost password notifications or even the SendmailNotificationEnvelopeFrom.

In the end, what I really want, is the AdminEmail to be different than the notification sender email, and use the latter to also send LostPassword notifications for the agents.

Thanks
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Lost Password sender

Post by root »

chrotha wrote: 20 Apr 2022, 11:59 Hey everyone,

I have a question about which email address sends the lost password email for the users.
I have a news OTRS installation, currently using the version 6.0.40, and I checked that the email address that sends the lost password email, is the administrator's email. Is there any way to change this setting? I want the notification email address, to also send the lost password emails.

Thanks in advance
Hi,

Since the sender addess (From) is not set when the lost password email is sent the value of the system configuration AdminEmail is used.
See https://github.com/znuny/Znuny/blob/rel ... nt.pm#L715 for agents and https://github.com/znuny/Znuny/blob/rel ... er.pm#L656 for customer.

You could patch these files via the Customer/ folder and add the From parameter:

Code: Select all

              my $Sent = $EmailObject->Send(
# ---
# Customization
# ---
                From     => $ConfigObject->Get('NotificationSenderEmail'),
# ---             
                To       => $UserData{UserEmail},
                Subject  => $Subject,
                Charset  => $LayoutObject->{UserCharset},
                MimeType => 'text/plain',
                Body     => $Body
            );
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

Re: Lost Password sender

Post by chrotha »

Hi Roy,

Sorry for the late reply, but I could only test the workaround yesterday.
I tried it, but I get the same error where it says that "SendAsDenied", even if the From is set for the notification email.
Is there any way to "force" the lost password email to use the AuthUser and AuthPassword configured, without using the SendAs AdminEmail on OTRS?

Thanks in advance.
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

Re: Lost Password sender

Post by chrotha »

Hello everyone.

Could we get any help? I've been trying, but I still get the same error, the From: email address changed to the NotificationSender, but OTRS is still trying to use the AdminEmail, generation a 554 SendAsDenied error.

Any help would be appreciated
shawnbeasley
Znuny Employee
Posts: 132
Joined: 13 Sep 2021, 09:38
Znuny Version: Znuny 6.3.x
Real Name: Shawn Beasley
Company: Znuny

Re: Lost Password sender

Post by shawnbeasley »

Would you please check in the communication log and post it here?
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

Re: Lost Password sender

Post by chrotha »

shawnbeasley wrote: 03 Aug 2022, 08:09 Would you please check in the communication log and post it here?
Hi, here's the log, some information has been redacted for security purposes.
If any more information is needed, please let me know.

Code: Select all

Could not send message to server: 554, 5.2.252 SendAsDenied; "OTRS Notification Sender" not allowed to send as "OTRS Admin Email"; STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message [BeginDiagnosticData]Cannot submit message. "There are loads of numbered codes in here, I don't know if they're useful or not"[EndDiagnosticData] [Hostname=eurprd03.prod.outlook.com] ! 
Also, the solution that Roy said is currently in use, and kind of working, it's returning the error above.

If the full log is needed I'll need some time to redact some information from it.

Thanks in advance
shawnbeasley
Znuny Employee
Posts: 132
Joined: 13 Sep 2021, 09:38
Znuny Version: Znuny 6.3.x
Real Name: Shawn Beasley
Company: Znuny

Re: Lost Password sender

Post by shawnbeasley »

Code: Select all

              my $Sent = $EmailObject->Send(
                To       => $UserData{UserEmail},
                Subject  => $Subject,
                Charset  => $LayoutObject->{UserCharset},
                MimeType => 'text/plain',
                Body     => $Body,
# ---
# Customization
# ---
                Loop => 1
# ---             

            );
Try this in combination with SendmailNotificationEnvelopeFrom.

SendmailNotificationEnvelopeFrom is only triggered in Send() when Loop is present.

This might help.
chrotha
Znuny newbie
Posts: 93
Joined: 29 Jun 2018, 13:44
Znuny Version: 6.x.x/7.0.x
Real Name: Ruben Sardinha

Re: Lost Password sender

Post by chrotha »

shawnbeasley wrote: 05 Aug 2022, 16:21

Code: Select all

              my $Sent = $EmailObject->Send(
                To       => $UserData{UserEmail},
                Subject  => $Subject,
                Charset  => $LayoutObject->{UserCharset},
                MimeType => 'text/plain',
                Body     => $Body,
# ---
# Customization
# ---
                Loop => 1
# ---             

            );
Try this in combination with SendmailNotificationEnvelopeFrom.

SendmailNotificationEnvelopeFrom is only triggered in Send() when Loop is present.

This might help.
Hello,

It worked perfectly adding the Loop=>1 it send both emails (we also added to the email that sends the password)

Thanks for the help
Post Reply