Https and http Email

There’s a number of places you need to change your host name from erpnext.vm

In the frappe sites folder
In the site json file imost needs to be added or corrected to your host

There may be another place.

Otherwise your host name that erpnext thinks it’s using is different to
what it is using and may cause ssl errors I would guess

Julian

1 Like

Actually the SMTP port is working well because the http (vmail.fastgrp.net) site is working well
while the https site (erp.fastgrp.net)is not

frappe@erpnext:~/frappe-bench/sites$ ls
apps.txt assets common_site_config.json currentsite.txt currentsite.txt.old erp.fastgrp.net languages.txt vmail.fastgrp.net
frappe@erpnext:~/frappe-bench/sites$

frappe@erpnext:~$ sudo netstat -tulpn | grep LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1096/sshd
tcp 0 0 127.0.0.1:11000 0.0.0.0:* LISTEN 2074/redis-server 1
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 1950/master
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 2873/0
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 3146/2
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1822/nginx
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 2067/python
tcp 0 0 127.0.0.1:12000 0.0.0.0:* LISTEN 2076/redis-server 1
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN 2072/nodejs
tcp 0 0 127.0.0.1:13000 0.0.0.0:* LISTEN 2075/redis-server 1
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1682/mysqld
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1970/redis-server 1
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1822/nginx
tcp6 0 0 :::22 :::* LISTEN 1096/sshd
tcp6 0 0 :::25 :::* LISTEN 1950/master
tcp6 0 0 ::1:6010 :::* LISTEN 2873/0
tcp6 0 0 ::1:6011 :::* LISTEN 3146/2
frappe@erpnext:~$

Thats exactly what i was think but lets check together

frappe@erpnext:~/frappe-bench/sites$ cat currentsite.txt

erp.fastgrp.net

frappe@erpnext:~/frappe-bench/sites/erp.fastgrp.net$ ls
error-snapshots locks private public site_config.json task-logs

{
“db_name”: “",
“db_password”: "
”,
“encryption_key”: “",
“ssl_certificate”: “/etc/letsencrypt/live/erp.fastgrp.net/fullchain.pem”,
“ssl_certificate_key”: “/etc/letsencrypt/live/erp.fastgrp.net/privkey.pem”,
“dropbox_access_key”: "
”,
“dropbox_secret_key”: “**********”,
“developer_mode”: 1,
“host_name”: “https://erp.fastgrp.net

}

===================

Is there any other places to change ?

To troubleshoot http, https, smtp, pop3, imap etc service connectivity, first identify the port that the tcp service runs, then confirm that the port is open. So for example

frappe@erpnext:~/frappe-bench$ nc -vv smtp.gmail.com 587
Connection to smtp.gmail.com 587 port [tcp/submission] succeeded!
220 smtp.gmail.com ESMTP l22sm30607654pfi.2 - gsmtp

frappe@erpnext:~/frappe-bench$ nc -vv imap.gmail.com 993
Connection to imap.gmail.com 993 port [tcp/imaps] succeeded!

As @Sagar_Vora advised, the required port between the vm guest and host may be closed

In a VM environment, my experience is that bridged is easier than NAT to solve for network connectivity.

2 Likes

frappe@erpnext:~$ nc -vv fastgrp.net 25
Connection to fastgrp.net 25 port [tcp/smtp] succeeded!
220 mail.fastgrp.net ESMTP MailEnable Service, Version: 9.16-- ready at 05/09/17 14:17:53

in addidtion the mail is successfully work if i send from vmail.fastgrp.com (http site
)
while
the problem in erp.fastgrp.net site (https) i cant send any mail

i dont think the problem is https, are u trying to send email using ssl protocol?

1 Like

No
i am sending the email using port 25
without any ssl

Ok, so why you think the problem is https?

1 Like

Because this happend after
i transfer data from

erpnext.vm (http site) To erp.fastgrp.net (the https site)

well …https is not related to smtp email relay …double check your settings

1 Like

its one week now i am trying to figure out the reason that prevent me from sending mail from that https site
while it works well in
**vmail.fastgrp.net (**http site)
with the same mail setting

well for sure it’s not a problem of https …what i can suggest is to double check logs and email settings

1 Like

can u guide me please
How to check the mail log?
where i can find or read it ?

This works as expected

frappe@erpnext:~/frappe-bench$ nc -vv erp.fastgrp.net 25
Connection to erp.fastgrp.net 25 port [tcp/smtp] succeeded!
220 erpnext ESMTP Postfix (Ubuntu)

So now check whether port 25 is open on you VM host and finally from within your VM…

have a look at logs inside frappe-bench/logs/ folder

Hi

I think the host name us without https just http

I will check my config

Julian

yes in the site_config.json file it will be “host_name”: "
http://erp.erpsite.com",

1 Like

Thank u dears for all your help
Finallyyyyyyyyyyyyyyy
i found the problem that stop my Email

Check enable scheduled jobs

1 Like

As a check the worker.error.log lists details of each job the scheduler runs…

For eg

frappe@erpnext:~/frappe-bench$ find . -name *.log | xargs grep sendmail