Hi everybody! I'm running a mailserver with ISPCONFIG 3 (Duh) and I'd like to restrict SMTP use to the localhost only so that my clients can only send mail via my server through webmail. I've tried closing the 25 port, but that will prevent mail from being recieved by the server. How on earth do I do this? Thanks in advance!
Edit the file /etc/postfix/main.cf and remove "permit_sasl_authenticated" from the line smtpd_recipient_restrictions = ...... and restart postfix.
This won't work for me, the roundcube webmail client I use, uses sasl authentification. I need something to disallow all other hosts than localhost.
This works perfectly as roundcube does not have to use sasl as it is installed on localhost. Just reconfigure your roundcube so that it sends from localhost without sasl.
I'm not sure how to configure roundcube then... then again I'm a bit of a noob at this. This is my current roundcube configuration. Code: [...] // use this host for sending mails. // to use SSL connection, set ssl://smtp.host.com // if left blank, the PHP mail() function is used $rcmail_config['smtp_server'] = 'localhost'; // SMTP port (default is 25; 465 for SSL) $rcmail_config['smtp_port'] = 25; // SMTP username (if required) if you use %u as the username RoundCube // will use the current username for login $rcmail_config['smtp_user'] = '%u'; // SMTP password (if required) if you use %p as the password RoundCube // will use the current user's password for login $rcmail_config['smtp_pass'] = '%p'; // SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use // best server supported one) $rcmail_config['smtp_auth_type'] = ''; [...]
Won't that stress my PHP too much, since it is then using the mail() function. Your help is appreciated by the way.
Okay, thanks for your help, I'll use this then. I did find another solution I'll just post here just for documentation. In /etc/postfix/main.cf Just change: inet_interfaces = all to: inet_interfaces = localhost