:-) >> My postfix hostname is `mail.my.domain'. >> >> DNS settings result in redirecting not only mail to >> `[email protected]' but also mail addressed to: >> `[email protected]', `[email protected]', etc to this host. >> >> `virtual_alias_maps' allow resolving: >> [email protected] -> smith >> [email protected] -> jones >> etc. >> >> `sender_canonical_maps' do similar mappings for outgoing mail. >> >> I offer roundcube as a webmail. >> >> If people log into roundcube and accept default config, then for >> outgoing mail their `MAIL FROM' is set to `[email protected]'. Then >> thanks to canonical it is re-mapped as shown above. >> >> OK till now. >> >> I'd like to use the `reject_sender_login_mismatch' restriction. My >> problem is: it is applied before canonical does its work. So it seems >> that `smtpd_sender_login_maps' cannot use the same source as >> `virtual_alias_maps' but also a similar source but with the mappings for >> `mail.my.domain': >> >> [email protected] -> smith >> [email protected] -> jones > > How accurate is this description? If it is accurate, a regexp table > will do: > > # Regexp for cases that fit a regular pattern. > /etc/postfix/sender_login_pcre: > /^([^@]+)@.+/ $1 > > /etc/postfix/main.cf: > # Use the hash as backup for cases that don't fit the regular pattern. > smtpd_sender_login_maps = pcre:/etc/postfix/sender_login_pcre, > hash:/etc;/postfix/sender_login > > This is, assuming that email submissions are via port 587, not > via the MX service on port 25.
The description was not precise enough. My virtual_alias_maps can be in the form: [email protected] -> jones [email protected] -> smith [email protected] -> someuser (user@... can differ to username). So I always have to check the LDAP. I need some rewriting between ... Best regards, Marek
