Author Topic: Postfix smtp authentication  (Read 1624 times)

tunsa

  • Zen Samurai
  • ****
  • Posts: 328
  • Karma: +13/-1
    • View Profile
Postfix smtp authentication
« on: November 15, 2017, 08:29:57 am »
Hello friends!
How to configure postfix in order for local e-mail clients to require smtp authentication?
My server is used to send spam. Zentyal version 2.4/

main.cf

Code: [Select]
# Generated by Zentyal
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Generated by Zentyal
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# require helo
smtpd_delay_reject  = yes
smtpd_helo_required = yes

strict_rfc821_envelopes = yes
disable_vrfy_command = yes

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUAs job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myorigin = /etc/mailname
myhostname = mail
mydestination = $myorigin,$myhostname,localhost,localhost.$mydomain
smtp_helo_name = mail.domain.ru
alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases
local_recipient_maps = proxy:unix:passwd.byname $alias_maps

relayhost =




mynetworks = 127.0.0.0/8

message_size_limit = 41943040
mailbox_size_limit = 0
virtual_mailbox_limit = 0
recipient_delimiter = +
inet_interfaces = all

# Virtual Aliases
virtual_alias_maps = ldap:valiases
valiases_server_host = 127.0.0.1
valiases_search_base = ou=mailalias,ou=postfix,dc=zentyal2012
valiases_query_filter = (&(mail=%s)(objectClass=CourierMailAlias))
valiases_result_attribute = maildrop
aliases_bind = no

# Virtual Domains
dovecot_destination_recipient_limit = 1
virtual_transport = dovecot
#virtual_transport = virtual
virtual_mailbox_base = /var/vmail/
virtual_mailbox_maps= ldap:ldapvirtualmap

ldapvirtualmap_server_host = 127.0.0.1:389
ldapvirtualmap_bind = no
ldapvirtualmap_search_base = ou=Users,dc=zentyal2012
ldapvirtualmap_query_filter = (&(mail=%s)(!(quota=-1))(objectClass=CourierMailAccount))
ldapvirtualmap_result_attribute = mailbox

virtual_mailbox_domains = ldap:vmaildomains
vmaildomains_server_host = 127.0.0.1, 192.168.5.0/24
vmaildomains_bind = no
vmaildomains_search_base =  ou=postfix,dc=zentyal2012
vmaildomains_query_filter = (|(&(objectclass=domain)(domainComponent=%s))(&(objectclass=CourierMailAlias)(mail=@%s)))
vmaildomains_result_attribute = dc, maildrop


virtual_minimum_uid = 100
virtual_uid_maps = static:108
virtual_gid_maps = static:114

# TLS/SSL
smtpd_use_tls = yes
smtpd_tls_note_starttls = yes
smtpd_tls_key_file  = /etc/postfix/sasl/postfix.pem
smtpd_tls_cert_file = /etc/postfix/sasl/postfix.pem
smtpd_tls_loglevel = 1

# recipient restrictions
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, check_helo_access pcre:/etc/postfix/helo_checks.pcre
submission_recipient_restrictions = reject_non_fqdn_sender, reject_non_fqdn_recipient, permit_sasl_authenticated, permit_mynetworks, reject
smtpd_restriction_classes = submission_recipient_restrictions

#SASL authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_tls_auth_only = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =  $myorigin


content_filter=smtp-amavis:127.0.0.1:10024

BerT666

  • Zen Warrior
  • ***
  • Posts: 220
  • Karma: +10/-0
    • View Profile
Re: Postfix smtp authentication
« Reply #1 on: December 01, 2017, 11:20:24 am »
Hi, did you check the relay config?

tunsa

  • Zen Samurai
  • ****
  • Posts: 328
  • Karma: +13/-1
    • View Profile
Re: Postfix smtp authentication
« Reply #2 on: April 04, 2020, 08:28:20 am »
Hi, did you check the relay config?

How can I do that? Help me please.