Skip to content
GitLab
  • Explore
  • Sign in
  • Register
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #1475

Restrict MailFrom only from available mailboxes or aliases

Its usefull to restrict the mailserver to send mails with mailfrom from foreign mail adresses. e.g. I have the mail account blub@bla.de and try to send a mail with sender address admin@bla.de or admin@test.de

I used reject_authenticated_sender_login_mismatch in my installation:

File: /etc/postfix/mysql-virtual_senderloginmaps.cf user = ispconfig password = XXXXXXXX dbname = dbispconfig hosts = 127.0.0.1 query = select destination from mail_forwarding where source = '%s' and active = 'y' and type = 'alias' and server_id = XXXXXXXX union select email from mail_user where email = '%s' and postfix = 'y' and server_id = XXXXXXX;

Changed the following lines in main.cf: smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql-virtual_senderloginmaps.cf

proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps $smtpd_sender_login_maps

smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf

Edited Aug 16, 2020 by Thom
Assignee
Assign to
Time tracking