EPrints Technical Mailing List Archive
Message: #08286
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
Re: [EP-tech] SMTP settings - one solution
- To: <eprints-tech@ecs.soton.ac.uk>, Ravi M <rm@auroville.org.in>
- Subject: Re: [EP-tech] SMTP settings - one solution
- From: David R Newman <drn@ecs.soton.ac.uk>
- Date: Wed, 5 Aug 2020 06:54:28 +0100
Hi Ravi,
As there is so many different ways that mail sending could be configured, my general advice is to leave this to an application that knows what its doing and configure Postfix to do this for you rather than doing a lot of hacking around with the EPrints code. Here is a guide for doing this with Amazon SES:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html
There might be the need to make a small change to SystemSettings.pm but I hope even this should not be necessary as your server (i.e. 127.0.0.1) will still be sending email it will just be using Amazon SES as a relay host.
Regards
David Newman
In the EPrints mailing list archive there are many queries about how to configure SMTP settings but I couldn't find a clear answer that worked for me. After some trial and error I've managed to get SMTP working for my EPrints site, and I'm sharing the settings here in case it's useful for anyone.
I run EPrints 3.4.2 on an Ubuntu server, and I use Amazon Simple Email Service (SES) for my SMTP. (I am not affiliated to Amazon in any way - I mention this service to indicate that I don't know if the settings I've used will work with another SMTP provider.)
Step 1:
I defined the value of
smtp_server
in the file
/perl_lib/EPrints/SystemSettings.pm
Step 2:
In the file
/usr/share/eprints/perl_lib/EPrints/Email.pm
I replaced the line
my $smtp = Net::SMTP->new( $smtphost );
with the below:
my $smtp = Net::SMTP->new( $smtphost,
Hello => 'eprints_site_domain',
Debug => 1,
);
And I added these two lines:
$smtp->starttls();
$smtp->auth('username','password');
Of course you should change eprints_site_domain, username, password to match your configuration. On Amazon SES my eprints_site_domain is verified, and my SMTP settings are connected to the same email address that is set as EPrints' adminemail. I suppose this helps in getting email from the site delivered without being marked as spam.
I think the $smtp->starttls(); part is especially important. There is some advice out there on using the Net::SMTP::TLS module instead of Net::SMTP, and at first glance it might seem that the former is more recent or advanced. But Net::SMTP could in fact be more reliable as it is a core Perl module.
Cheers,Ravi Murugesan
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/
- References:
- [EP-tech] SMTP settings - one solution
- From: Ravi M <rm@auroville.org.in>
- [EP-tech] SMTP settings - one solution
- Prev by Date: Re: [EP-tech] Remove new version button
- Next by Date: [EP-tech] WG: Antwort: Linkcheck: HEAD method ends up in 404
- Previous by thread: [EP-tech] Sort view with creators_name and corp_creators
- Index(es):