Utilisation SMTP du registar?

J’ai corrigé le même problème en ajoutant des aliases à mes utilisateurs. Ainsi, postfix détecte que le mail n’a pas besoin d’être relayé en externe et le traite en local dès qu’il le reçoit de l’utilisateur.

I solved by addind aliases to users. Thus, postfix does not relay email externaly but directly process it.

Cf. /etc/postfix/virtual
Format: email@gandi local_user

@guyou : accepterais-tu de me détailler ce que tu as fait exactement?

As-tu d’abord modifié /etc/postfix/main.cf comme indiqué par @Aleks en ajoutant mail.gandi.net ainsi

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 mail.gandi.net

?

Et ensuite, quel(s) autre(s) fichiers as-tu modifié? et de quelle façon?

Merci pour ton aide.

[wrongly assumed you were forwarding to gandi]

Sorry, I think what is missing is the login. Your server needs to log in to your provider’s smtp server to be allowed to submit emails. See, the example main.cf under “Setup the relay server” in the howto linked above.

And then, you provider also needs to allow your sender addresses. If it does not simply allow all addresses *@your.domain, some may require creating separate accounts, or additional addresses at the provider.

Err, the sender address rejection errors are from your own server not gandi’s, right?
Of course the users need to exist on the yunohost.

But, it looks that actually relay1-d.mail.gandi.net tried to forward your message. So you may have to add a couple of gandi relays to mynetworks instead.

1 Like

I think he is using his own domain. But maybe this is a workaround, automatically allowing email from all gandi servers?

More exactly, my users have emails on both free.fr and laposte.net. So my file looks like:

user1@free.fr user1
user2@laposte.net user1
user2@free.fr user2
user2@laposte.net user2

HTH

Autant que je m’en souvienne, j’ai :

  1. créé le fichier /etc/postfix/virtual (comme indiqué ci-dessus)
  2. modifié /etc/postfix/main.cf en ajoutant hash:/etc/postfix/virtual à la ligne virtual_alias_maps

Et franchement, ça marche bien mieux.

I come late in this subject. I had the very same error message recently, when switching forth and back to smtp.free.fr and localhost. It might be another configuration but I’ll write it here, might be useful for someone.

My smtp localhost:587 is not open outside (not port routing). In the Rainloop configuration, the box “use authentication” was unchecked (I don’t remember if it the default or not). It works. It might also works with some internet providers because you are on their network, behind the box. BUT … some emails are refused with this Sender address rejected: not logged in (in reply to RCPT TO command). Including emails send from Yunohost to Yunohost.

If you use authentication for SMTP, this problem is solved.

Not sure my text is very clear, hope this helps.

That’s right.

I have tried writting this settings but it doesn’t solve my issue.

relayhost =      
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 relay1-d.mail.gandi.net relay10-d.mail.gandi.net relay*-d.mail.gandi.net
mailbox_command = procmail -a "$EXTENSION"

I keep receiving error email from either relay1-d.mail.gandi.net or other relay*-d.mail.gandi.net servers…

so I came back to the original setting

relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128                         
mailbox_command = procmail -a "$EXTENSION"

I’m going to try @guyou suggestion and will keep you updated.

I’m wondering if using domain names is allowed in mynetworks.
Don’t see that in http://www.postfix.org/BASIC_CONFIGURATION_README.html and IP ranges may also allow to cover all the servers in the data centers well.

Please, note that my solution will only work for new messages, as it improve the rule of the local SMTP distribution. Mail already outside (it was my cases when local users sent emails to other local users via external address) will stay outside and rejected.

tried also with

relayhost =
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 217.70.183.193 217.70.183.194 217.70.183.195 217.70.183.196 217.70.183.197 217.70.1$
    mailbox_command = procmail -a "$EXTENSION"

not better success…

I can send email with Gandi’s SMTP to all email adresses but those belonging to our server.
My setup to send email is STARTLS 587 password.
The problem is not to be "accepted"by Gandi’s SMTP, that’s ok and it’s working.

The problem is when I send email to one of our server. It’s our entering email server that don’t accept email with our domain name but coming from Gandi’s SMTP server.

What do you mean new? outside? local?

I’m confused now.

A “network” definition for a single IP would be the IP with 32 network bits, e.g. 217.70.183.193/32

Ok, I’m trying with

relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 217.70.183.193/32 217.70.183.194/32 217.70.183.195/32 217.70.183.196/32 217.70.183.197/32 217.70.183.198/32 217.70.183.199/32 217.70.183.200/32 217.70.201/32
mailbox_command = procmail -a "$EXTENSION"

after sudo service postfix restart it doesn’t work better. I’ll try with a reboot but it takes time… I’ll let you know but I’m not really hopefull.

I’m just wondering, Postfix is the SMTP server right?
The IMAP server is Dovecot, no?
So why are we trying to setup Postfix whereas our problem is for receiving emails that has been sent from an external SMTP server?
Should I not setup something in Divecot instead?

Let me reword it. Let’s suppose your domain is thatoo.com, just to make it easier for my understanding.

If you are using smtp.thatoo.com (or localhost), you can emails to any address.

If you are using smtp.gandi.com, then you can successfully send emails to peter@gafam.com. BUT your mail server on thatoo.com does not accept emails sent from john@tathoo.com to peter@thathoo.com. It says sebder address rejected: not logged in.

Is that your problem ?

That is the problem I was facing a few weeks ago. Using smtp.free.fr I could send emails to any address outside but not to my own domain. With the same error message. Right now I’m using localhost:587 with authentication. And therefor I don’t have the problem.

When you send an email, you are authenticated on thatoo.com, but is your relay configuration using authentication as well ? A user/password in an encrypted file like described somewhere in the postfix documentation ?

1 Like
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 217.70.183.193/32 217.70.183.194/32 217.70.183.195/32 217.70.183.196/32 217.70.183.197/32 217.70.183.198/32 217.70.183.199/32 217.70.183.200/32 217.70.201/32
mailbox_command = procmail -a "$EXTENSION"

it didn’t work.

It is indeed my problem.

How do you send using localhost:587 with authentication ?
Can you give me some more details?

The solution now is to switch betwen smtps, smtp.thatoo.com can send to all but gafam and smtp.gandi.net can send to all including gafam but thatoo.com