mail server - Postfix and sending incoming emails to script instead of sending -


i want use postfix accept incoming emails , have send them external python script parse them , add them database.

i read done via policy file.

my first question should policy file return have postfix delete email queue success message sender.

my second question can use policy file validate smtp authentication sent client? if not, there way of having use external script validate login?

thanks!

  • christian

if need smtp authentication anyway , want script act mda, think can setting mailbox_command = /path/to/my/script in /etc/postfix/main.cf , configuring authentication scheme. if have dovecot running, too, can recommend having postfix authenticate via dovecot, configurable when comes sasl authentication.

update

since having plaintext passwords going on wire (assuming service reachable network), recommend permitting authentication on encrypted line. configuration i'm going show still accept mails server destination without authentication. far know, behaviour mandated rfc smtp servers reachable internet.

announce sasl authentication on encrypted connections

smtpd_tls_auth_only=yes 

don't require talk on encrypted channel

smtpd_tls_security_level=may 

sasl boilerplate

smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_local_domain = $mydomain 

for whom accept mail. worked left right, until permitting or denying rule encountered. fallback behaviour permit.

smtpd_recipient_restrictions = permit_auth_destination, reject_plaintext_session, permit_sasl_authenticated, reject 
  • permit_auth_destination first rule make sure clients may deliver mail users feel responsible unauthenticated. clients may choose whether use tls or not.
  • reject_plaintext_session second rule makes sure other rules further down line can assume ecrypted channel.
  • permit_sasl_authenticated self-explanatory
  • reject last rule changes default policy "deny".

if don't want accept mails without smtp authentication, may want drop first rule of smtpd_recipient_restrictions.

not shown configuration of ssl certificate , how tell postfix (the latter of easy).


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -