Mail server
Mail server
How can I create email account for main panel domain which is also hostname?
Also, is it possible to modify mail() to send all panel e-mail notifications via external SMTP account?
Thanks
Re: Mail server
This could be one reason, you may want to change the hostname of the system to a subdomain to e.g. "keyhelp.domain.com" - this can be done via the KeyHelp configuration page, and after that you can create a user and assign the main domain "domain.com" to him. Than you can manage the email accounts within this user and maybe add a redirection for "domain.com" to "keyhelp.domain.com" within domain settings.How can I create email account for main panel domain which is also hostname?
Alternatively, depending on your demands: Inside KeyHelp, have a look into the "Configuration" page -> Notifications" -> "Forward emails sent to common mailbox names of the server domain". Maybe this is already sufficient for your needs.
This is currently not possible, but i will add your point to the feature request list.Also, is it possible to modify mail() to send all panel e-mail notifications via external SMTP account?
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Re: Mail server
What happened to this?
Actually, what I want is to be able to send email from both the domain and the external SMTP account and receive only in the other account. I suppose I will need to modify the MX records manually, but I have the DNS server disabled. Is there a way to check which would be the correct MX?
Re: Mail server
Your request has actually nothing to do with the initial request by sempre, where he just wanted to configure the sender of panel notifications.What happened to this?
If you want to send mails by PHP via external SMTP, have a look here https://github.com/PHPMailer/PHPMailer.
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Re: Mail server
Re: Mail server
Within this account you can manage email adresses.
Then you can use this new email account for your board.
If your mailqueue is still full you can delete all emails in KeyHelp as administrator.
Tobi
-----------------------------
wewoco.de
Das Forum für Reseller, Digital-Agenturen, Bildschirmarbeiter und Mäuseschubser
Re: Mail server
This is the error I'm getting amavis[218378]: (218378-03-429) (!!)TROUBLE in check_mail: check_init2 FAILED: /etc/resolv.conf: No such file or directory at /usr/sbin/amavisd-new line 18264.
- space2place
- Posts: 532
- Joined: Tue 24. Mar 2020, 11:02
- Contact:
Re: Mail server
It seems the file "/etc/resolv.conf" does not exist.
Re: Mail server
- space2place
- Posts: 532
- Joined: Tue 24. Mar 2020, 11:02
- Contact:
Re: Mail server
The file „/etc/resolv.conf“ is the a file where you add the namserver.
E.g.
Code: Select all
nameserver 8.8.8.8
nameserver 8.8.4.4
Re: Mail server
Re: Mail server
My setup is similar to what @shortsnow mentioned here https://translate.googleusercontent.com ... mAg#p15406
Gmail is working fine (the external email server) and is set up in the external DNS and in KH DNS Manager. I've just set up the spf record for it as well.-External mail server
-External DNS
-mail sent by scripts via phpmail and does not use SMTP
The website is also working properly.
But every email sent by the system is queued and doesn't go out.
EMail domain is set to yes and DNS is enabled for the domain.
I've seen another message in this board by @smied saying this worked for him:
Code: Select all
sudo systemctl enable systemd-resolved
Code: Select all
echo "nameserver xx.xx.xx.xx" | sudo tee /etc/resolv.conf
echo "nameserver yy.yy.yy.yy" | sudo tee -a /etc/resolv.conf
Code: Select all
ls -altrh /etc/resolv.conf
lrwxrwxrwx 1 root root 39 May 27 23:40 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
Re: Mail server
firstly, DNS setup always comes before email setup. Forget about email until you have proper DNS resolution at least. See my suggestions in the topic you quoted above:
viewtopic.php?p=25490#p25490
Here are some handy commands, to aid in testing.
Check GLOBAL/LINK DNS resolvers:
Code: Select all
systemctl status systemd-resolved
journalctl -u systemd-resolved -f
systemd-resolve --status
Check services listening on port 53:
Code: Select all
lsof -i :53
ss -lp 'sport = :domain'
Check ROOT nameservers:
Code: Select all
dig . ns
Check requested data is authenticated:
Code: Select all
systemd-resolve encryptedsni.com
The standard resolver used listens on 127.0.0.53, and handles all client dns requests, forwarding them to upstream server. When running a proper email server (internal), I always prefer to use bind on 127.0.0.1. This gives better results for spam BL checks, and works better overall. If you choose to go this way, you will need to limit recursion to local clients only (for security).
These days, the best and recommended method of establishing which nameserver to use, is NETPLAN.
My netplan config file resides here:
/etc/netplan/01-eth0.yaml
Contents (nameservers at bottom):
Code: Select all
# This file describes the network interfaces available on your system
# For more information, see netplan(5).
# /etc/netplan/01-eth0.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
- 111.111.222.222/24 # KeyHelp public IPv4 address.
- "2404:6800:4006:810::200e/64" # Primary IPv6 address.
gateway4: 111.111.222.1 # Primary IPv4 gateway.
gateway6: "fe80::1" # Primary IPv6 gateway.
nameservers:
search: [host.domain.com] # Search domain.
addresses: [127.0.0.1, "::1"] # DNS Server IP addresses.
If you create a netplan config, make sure to keep the formatting as above. Once saved, test the config is ok:
Code: Select all
netplan try
Code: Select all
netplan apply
This should get you rolling...
Re: Mail server
I have an external DNS which has been up and running for years and through several server moves; it's easier to point @ to the new ip in the nameserver than reimport all the CNAMEs, etc. to a new one, specially if your server crashes. And I have another server for a new domain which worked flawlessly with KH from the start, other than me trying to 'innovate'

So when KH panel emails were not going out now, I thought I was missing some DNS settings or something relating to it.
To your comments
Code: Select all
systemctl status systemd-resolved
Journal is not exiting query, but so far is blank.
Code: Select all
systemd-resolve --status
Code: Select all
lsof -i :53
ss -lp 'sport = :domain'
Code: Select all
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
named 496696 bind 23u IPv4 20171049 0t0 UDP localhost:domain
named 496696 bind 24u IPv4 20171050 0t0 UDP localhost:domain
named 496696 bind 26u IPv4 20171051 0t0 TCP localhost:domain (LISTEN)
named 496696 bind 27u IPv4 20171051 0t0 TCP localhost:domain (LISTEN)
named 496696 bind 28u IPv4 20171051 0t0 TCP localhost:domain (LISTEN)
Code: Select all
dig . ns
Code: Select all
c.root-servers.net. 328164 IN AAAA 2001:500:2XXX
Code: Select all
systemd-resolve encryptedsni.com
Re: Mail server
"systemd-resolved is broken"
When you decide to get "innovative" again, make sure to follow these tips, to avoid getting stuck like this:
viewtopic.php?p=25490#p25490
Especially, take notes of your "innovations", so you can go back and undo.
The most important component, you have left out: NETPLAN
I strongly suggest you configure it, as it really sorts out the network, and its nameservers take precedence.
Quick FIX:
This will likely work, especially after configuring netplan.
Code: Select all
apt install --reinstall libnss-resolve
If you still need help, start a new topic.
Good luck!