Erreur mail ssmtp

Bonsoir tout le monde!

Me voilà de retour avec une nouvelle question.

J’ai installé ssmtp avec mailutils. Lorsque je saisis la commande : echo "test" | mail -s "test" monmail@gmail.com

J’ai en retour : send-mail: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. 18sm44649981wju.15 - gsmtp) Can't send mail: sendmail process failed with error code 1

Mon fichier /etc/ssmtp/ssmtp.confressemble donc à ça : [code]

Config file for sSMTP sendmail

The person who gets all mail for userids < 1000

Make this empty to disable rewriting.

root=monmail@gmail.com

The place where the mail goes. The actual machine name is required no

MX records are consulted. Commonly mailhosts are named mail.domain.com

mailhub:587=smtp.gmail.com
#Activer l’usage du TLS
UseSTRATTLS=YES
AuthUser=monmail@gmail.com
AuthPass=monmdp

Where will the mail seem to come from?

#rewriteDomain=gmail.com
FromLineOverride=YES

The full hostname

hostname=ben-deb.home

Are users allowed to set their own From: address?

YES - Allow the user to specify their own From: address

NO - Use the system generated From: address

#FromLineOverride=YES
[/code]

Quelqu’un aurait-il une idée?

Merci d’avance,

xakan

Salut,

[quote=“xakan”]#

Config file for sSMTP sendmail

The person who gets all mail for userids < 1000

Make this empty to disable rewriting.

root=monmail@gmail.com

The place where the mail goes. The actual machine name is required no

MX records are consulted. Commonly mailhosts are named mail.domain.com

mailhub:587=smtp.gmail.com
#Activer l’usage du TLS
UseSTRATTLS=YES
AuthUser=monmail@gmail.com
AuthPass=monmdp

Where will the mail seem to come from?

#rewriteDomain=gmail.com
FromLineOverride=YES

The full hostname

hostname=ben-deb.home

Are users allowed to set their own From: address?

YES - Allow the user to specify their own From: address

NO - Use the system generated From: address

#FromLineOverride=YES[/quote]

[mono]rewriteDomain=gmail.com[/mono] Cette ligne est à décommenter.

Quel est le contenu du fichier [mono]/etc/ssmtp/revaliases[/mono] ?

Que retourne :

[mono]$ whereis sendmail
$ ls -la /usr/sbin/sendmail[/mono] ?

Les logs [mono]tail -f /var/log/mail.log[/mono] sont-ils parlant lors de ces tests ?

Merci pour la réponse :wink:

J’ai décommenté la ligne du fichier ssmtp.conf
Le fichier /etc/ssmtp/revaliases contient :

# sSMTP aliases
#
# Format:       local_account:outgoing_address:mailhub
#
# Example: root:your_login@your.domain:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.

whereis sendmail me renvoie :

ls -la /usr/sbin/sendmail me renvoie :

Enfin, les logs me disent ça :

May 28 19:42:01 ben-deb sSMTP[3239]: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. dk10sm11981421wib.1 - gsmtp) May 28 19:43:01 ben-deb sSMTP[3396]: Unable to set UseSTRATTLS="YES" May 28 19:43:01 ben-deb sSMTP[3396]: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. u1sm18598289wia.16 - gsmtp) May 28 19:44:01 ben-deb sSMTP[3406]: Unable to set UseSTRATTLS="YES" May 28 19:44:01 ben-deb sSMTP[3406]: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. c7sm44873502wjf.19 - gsmtp) May 28 19:45:01 ben-deb sSMTP[3417]: Unable to set UseSTRATTLS="YES" May 28 19:45:01 ben-deb sSMTP[3417]: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. dr6sm18602720wid.6 - gsmtp) May 28 19:46:02 ben-deb sSMTP[3423]: Unable to set UseSTRATTLS="YES" May 28 19:46:02 ben-deb sSMTP[3423]: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. ht5sm44894721wjb.49 - gsmtp)

Merci encore pour ton aide :slightly_smiling:

[quote=“xakan”]Le fichier /etc/ssmtp/revaliases contient :
Code:

sSMTP aliases

Format: local_account:outgoing_address:mailhub

Example: root:your_login@your.domain:mailhub.your.domain[:port]

where [:port] is an optional port number that defaults to 25.[/quote]

Modifies ce dernier ( à la suite) tel que :

[mono]$ cat /etc/ssmtp/revaliases
root:monmail@gmail.com:smtp.gmail.com:587
nom_de_ta_machine:monmail@gmail.com:smtp.gmail.com:587[/mono]

[mono]nom_de_ta_machine[/mono] obtenu avec la commande suivante : [mono]$ hostname[/mono]

As-tu déclaré cette adresse (gmail) en [mono]/etc/aliases[/mono] ?

[mono]$ cat /etc/aliases
[…]
root: monmail@gmail.com
[…][/mono]

J’ai fait tes manipulations comme indiqué, et j’ai retesté, en simple utilisateur j’ai ça en retour :

send-mail: Cannot open mailhub:25 Can't send mail: sendmail process failed with error code 1

Et en root j’ai ça :

send-mail: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. ho2sm18954689wib.15 - gsmtp) Can't send mail: sendmail process failed with error code 1

Je ne pense pourtant pas avoir loupé la moindre étape…

[quote=“xakan”]Mon fichier /etc/ssmtp/ssmtp.confressemble donc à ça :

#Activer l'usage du TLS UseSTRATTLS=YES[/quote]
Y aurait pas une erreur de frappe là ?

On dirait que oui…

[quote=“PascalHambourg”][quote=“xakan”]Mon fichier /etc/ssmtp/ssmtp.confressemble donc à ça :

#Activer l'usage du TLS UseSTRATTLS=YES[/quote]
Y aurait pas une erreur de frappe là ?

On dirait que oui…[/quote]

J’ai rajouté les “” autour du YES et j’obtiens :

May 28 21:16:01 ben-deb sSMTP[3140]: Unable to set UseSTRATTLS=""YES""

Donc ça ne vient pas de ça, si?

Suis-je le seul à voir que [mono]UseSTRATTLS[/mono] != [mono]UseSTARTTLS[/mono] ?

Ah… Oui, vu sous cet angle… Je viens de faire la manip et ça ne fonctionne toujours pas. J’ai toujours le même message quand j’essaie d’envoyer un mail, et dans mes log, j’ai ça :

May 28 21:24:01 ben-deb sSMTP[2937]: Server didn't like our AUTH LOGIN (530 5.7.0 Must issue a STARTTLS command first. jr1sm45479015wjc.13 - gsmtp)

Re,

J’avais une poutre dans l’œil … :wink:

[quote=“http://doc.ubuntu-fr.org/ssmtp”]Configuration d’AuthUser

Ce paramètre, tout comme le suivant (AuthPass=) n’est pas présent par défaut dans le fichier de configuration, rajoutez-le après root=identifiant@fournisseur.com par exemple, mais ne le mettez pas à la fin du fichier sinon dans les logs (var/log/mail.log) ou dans le terminal vous pourrez avoir le message d’erreur suivant

send-mail: Authorization failed (535 5.7.0 authentication failed)

Can’t send mail: sendmail process failed with error code 1[/quote]

Corriges donc ton fichier [mono]ssmtp.conf[/mono] identiquement à ci-dessous.

[quote][22:43:57] ~ # cat /etc/ssmtp/ssmtp.conf

Config file for sSMTP sendmail

The person who gets all mail for userids < 1000

Make this empty to disable rewriting.

#root=postmaster
root=monmail@gmail.com
Authuser=monmail
AuthPass=mot_de_passe

The place where the mail goes. The actual machine name is required no

MX records are consulted. Commonly mailhosts are named mail.domain.com

#mailhub=mail
mailhub:587=smtp.gmail.com

Where will the mail seem to come from?

#rewriteDomain=
rewriteDomain=gmail.com

The full hostname

hostname=ben-deb.home

Are users allowed to set their own From: address?

YES - Allow the user to specify their own From: address

NO - Use the system generated From: address

FromLineOverride=YES
UseSTARTTLS=YES

[22:44:07] ~ #[/quote]

Ca y est tout fonctionne!

Merci à vous de votre aide! Moi qui galérais au possible, en fait il y avait quand même pas mal d’erreurs dans le lot…

Au plaisir!

:clap:

Quelles ont été les modifications nécessaires pour que ça fonctionne au final ?

J’ai du modifier le fichier ssmtp.conf comme indiqué, en corrigeant bien le UseSTARTTLS :

[quote=“BelZéButh”]

[quote][22:43:57] ~ # cat /etc/ssmtp/ssmtp.conf

Config file for sSMTP sendmail

The person who gets all mail for userids < 1000

Make this empty to disable rewriting.

#root=postmaster
root=monmail@gmail.com
Authuser=monmail
AuthPass=mot_de_passe

The place where the mail goes. The actual machine name is required no

MX records are consulted. Commonly mailhosts are named mail.domain.com

#mailhub=mail
mailhub:587=smtp.gmail.com

Where will the mail seem to come from?

#rewriteDomain=
rewriteDomain=gmail.com

The full hostname

hostname=ben-deb.home

Are users allowed to set their own From: address?

YES - Allow the user to specify their own From: address

NO - Use the system generated From: address

FromLineOverride=YES
UseSTARTTLS=YES

[22:44:07] ~ #[/quote][/quote]

J’ai égalemente effectué ces modifications :

[quote=“BelZéButh”][quote=“xakan”]Le fichier /etc/ssmtp/revaliases contient :
Code:

sSMTP aliases

Format: local_account:outgoing_address:mailhub

Example: root:your_login@your.domain:mailhub.your.domain[:port]

where [:port] is an optional port number that defaults to 25.[/quote]

Modifies ce dernier ( à la suite) tel que :

[mono]$ cat /etc/ssmtp/revaliases
root:monmail@gmail.com:smtp.gmail.com:587
nom_de_ta_machine:monmail@gmail.com:smtp.gmail.com:587[/mono]

[mono]nom_de_ta_machine[/mono] obtenu avec la commande suivante : [mono]$ hostname[/mono]

As-tu déclaré cette adresse (gmail) en [mono]/etc/aliases[/mono] ?

[mono]$ cat /etc/aliases
[…]
root: monmail@gmail.com
[…][/mono][/quote]

Voilà je pense que j’ai fait le tour de ce qui a permis que ça fonctionne… Merci pour votre aide en tout cas!