Komzi's picture

Hello guys and thank you for your time reading my message !

Recently I have downloaded the vm of Zoneminder (v.15.1) and I'm trying to use the Mailgun as SMTP relay.

I have followed many guidances and the one Mailgun site provided ,but without success.

Lines added in /etc/postfix/main.cf

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

relayhost = smtp.mailgun.org:587 
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:postmaster@sandbox_Id.mailgun.org:postmaster_password
smtp_sasl_security_options = noanonymous

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

When I try to send an email from command line like the example below:

mail -s "Test mail" bobxxxxx@gmail.com <<< "A test message using Mailgun"

I always get the same error :

SASL authentication failed; cannot authenticate to server smtp.mailgun.org no mechanism available

I tried also with port 25 and again I got the same error.

When I try with swaks (shown below) everything works ok.

./swaks --auth \
        --server smtp.mailgun.org \
        --au postmaster@sandbox_Id.mailgun.org \
        --ap postmaster_password \
        --to bobxxxx@gmail.com \
        --h-Subject: "Hello" \
        --body 'Testing some Mailgun awesomness!'

I searched many forums how to fix that and almost all of them had the same solution, the installation of libsasl2 module with is already installed (cyrus libsasl2-2).

Does anyone of you faced this issue and resolved this ?

Please help !

Thanks !

Komzi 

Forum: 
Jeremy Davis's picture

My guess (and admittedly that's all it is) is that there are a package or 2 missing. TBH, I thought that all the requirements should already be satisfied, but your error suggests not.

There is a doc page for setting up an SMTP relay. It's quite dated and as I noted above, I thought we should be already pre-installing all requirements in v15.x, but perhaps have a read through that?

Also, FWIW Confconsole has a "Mail Relay configuration" plugin that ships by default with all TurnKey appliances. TBH, I'm not sure how it will go seeing as you've already made a start configuring by hand, but that might be worth a try too?

Add new comment