Old mail settings used after change

Plone 5.0.8
Debian 8 and 9

I'm moving my site to another domain and therefor I need to change the mail server settings.

I've adapted @@mail-controlpanel and a test message is sent to the new e-mail address. So, the SMTP server is functioning correctly.

Now, when I use the PloneFormGen form, the message is still sent to the old address.

I've checked PloneFormGen settings: prefs_pfg_addressing
All fields are empty but even when I fill in the new address, the message is still sent to the old address.

When I edit the form itself, I can't find any references to the old address.

In ZMI I checked that the site's MailHost/manage_main was set correctly. Running "Clear and Rebuild" in portal_catalog/manage_catalogAdvanced didn't change anything either.

Against better judgement I compressed the database to 0 (zero) days history in @@maintenance-controlpanel which obviously didn't help.

When I run this command there is still a match on on the old e-mail address in Data.fs:

grep -i "my@ldaddress.com" var/filestorage/Data.fs
Binary file var/filestorage/Data.fs matches

var/client1/event.log:

2018-04-11T19:51:40 ERROR MailDataManager {'Schoelje <my@ldaddress.com>': (454, '4.7.1 <my@ldaddress.com>: Relay access denied')}

Does anybody know what's going wrong here?

err, did you check in the Plone Control Panel mail settings ?

Yes, that was the first thing I did. :wink:

I've done something right because now even the Plone test mails are not sent (although it says it did) :sweat_smile:

I can use my mail server without a problem, only Plone doesn't seem to be able to use it.

On the server I checked whether the server was running:

sudo netstat -ntap | grep 25
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1088/master     

sudo telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 my_domain.nl ESMTP Postfix (Debian/GNU)

There are no errors in /var/log/mail.err

Sending the test mail from Plone, /var/log/maillog gives me this:

Apr 12 14:11:54 h2776529 postfix/smtpd[6327]: connect from localhost[127.0.0.1]
Apr 12 14:11:54 h2776529 postfix/smtpd[6327]: 9B7E81C3A1F3D: client=localhost[127.0.0.1], sasl_method=CRAM-MD5, sasl_username=arjenbalfoort@mydomain.com
Apr 12 14:11:54 h2776529 postfix/cleanup[6331]: 9B7E81C3A1F3D: message-id=<20180412121154.9B7E81C3A1F3D@mydomain.com>
Apr 12 14:11:54 h2776529 check-quota[6334]: Starting the check-quota filter...
Apr 12 14:11:54 h2776529 /usr/lib/plesk-9.0/psa-pc-remote[482]: handlers_stderr: SKIP
Apr 12 14:11:54 h2776529 /usr/lib/plesk-9.0/psa-pc-remote[482]: SKIP during call 'check-quota' handler
Apr 12 14:11:54 h2776529 postfix/qmgr[4775]: 9B7E81C3A1F3D: from=<admin@mydomain.com>, size=759, nrcpt=1 (queue active)
Apr 12 14:11:54 h2776529 postfix/smtpd[6327]: disconnect from localhost[127.0.0.1]
Apr 12 14:11:54 h2776529 postfix-local[6336]: postfix-local: from=admin@mydomain.com, to=admin@mydomain.com, dirname=/var/qmail/mailnames
Apr 12 14:11:54 h2776529 dovecot: service=lda, user=admin@mydomain.com, ip=[]. msgid=<20180412121154.9B7E81C3A1F3D@mydomain.com>: saved mail to INBOX
Apr 12 14:11:54 h2776529 postfix/pipe[6335]: 9B7E81C3A1F3D: to=<admin@mydomain.com>, relay=plesk_virtual, delay=0.18, delays=0.09/0.01/0/0.08, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Apr 12 14:11:54 h2776529 postfix/qmgr[4775]: 9B7E81C3A1F3D: removed

Which seems alright but I never receive a message.

I tested the postfix sendmail command:

echo -e "From: admin@mydomain.com\nTo: admin@mydomain.com\nSubject: sendmail test\n\nThis is the body,\nwith multiple lines." | sendmail -t

Which sends me an email immediately.

Any ideas?

if when you are sending a mail from Plone your local postfix (I understand that you set up the Plone mail server as 'localhost' ?) is waking up and trying to send something, then Plone is not the issue, your mail setup is.

From your logs it's difficult to say more since it seems you redacted your log (understandable but makes it difficult for an outsider to understand what is really happening).
I say that you redacted because in the Postfix log the dest mailbox is 'admin@mydomain.com' while in your test you are posting it as 'admin@my_domain.com' (echo -e "From: admin@my_domain.com\nTo: admin@my_domain.com) so I assume your real domain is neither 'mydomain.com' nor my@domain.com'. If you redacted your log what else have you left out ? Maybe essential information.

Nothing was left out. Just replacing domain name, ip addresses, personal names when needed.

I changed my_domain to mydomain in my previous post.

What do you recommend me to do next?

bypass your local Postfix server. There is no problem whatsever running your local mail server provided it's a public server (ie on the internet with a public IP address). If this is the case (it's impossible to say since your redacted out IP addreses) it should work. It even seems impossible it does not work.
If it's an internal (private) address it's possible to do it but correct configuration is not really easy. Far simpler to ask Plone to connect directly to your provider's mail server, like a common mail client.

I've done that and even tried an external SMTP server. The results are the same: no e-mail received as if something is blocking the communication.

I've opened an issue on the Plesk forum: Issue - Mail not deliverd when sent locally | Plesk Forum

Hopefully somebody knows what I'm doing wrong.

Are you sure that it is not sent?

Some email-adresses (like google) blocks mal that is sent from web servers etc (relayed emails).

Also, it could be that your FormGen form is set up to send to several email adresses (cc, bc, )

For example, if your old setup sent mail to

theadmin@mydomain.com
cc: my@personal.mail
bc: antoher@one.com

And you changed your Plone mail setting to
theadmin@gmail.com

The mail would only be sent to the cc and bcc adresses, which you might mistake for 'sending to the old adr.'

If this is the case, you need to set up your sender adr. to permit relaying (this is NOT set up in plone, but in your 'mail / domain account' (can not remember the english word for it)

You should check whether your IP is blacklisted.
If so mails won't be transfered.

http://multirbl.valli.org/lookup/

The IP is blacklisted by one: rbl.rbldns.ru
The rest is in the green (or not listed). So, that can't be enough to cause this problem, right?

I've got it now that WebFormGen is sending form submissions to the correct new email address. Sending a test mail from Site setup > Mail Settings is still not working, whatever I do.

I don't understand why it doesn't function but it has no consequence for what I need: I can send and receive e-mails on the new domain and the web form is functioning as expected.

Thanks everybody for your help!