Differences between revisions 4 and 10 (spanning 6 versions)
Revision 4 as of 2020-05-02 11:19:38
Size: 734
Editor: PieterSmit
Comment:
Revision 10 as of 2021-04-25 05:17:16
Size: 1908
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:
 * add entries to /etc/postfix/sasl_passwd
   * then compile to db with # postmap sasl_passwd
 * Tell postfix to use sasldb {{{
# cat /etc/postfix/sasl/smtpd.conf
pwcheck_method: saslauthd
}}}
 * Debug smtp sasl auth [[https://wiki.vigor.nz/smtp]]
 * --(add entries to /etc/postfix/sasl_passwd)--
   * --(then compile to db with # postmap sasl_passwd)--
Line 14: Line 19:
 * Test with {{{  * Test local user/password with testsaslauthd {{{
# cat /etc/default/saslauthd
  ... MECHANISMS="sasldb
  ... OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
# # ls -l /etc/sasldb2 <<The sasldb
# sasldblistusers2
# saslpasswd2 <user>
# testsaslauthd -u <user> -p <password> -f /var/spool/postfix/var/run/saslauthd/mux
}}}

 * Test with openssl s_client {{{
Line 26: Line 41:

== Configure gmail email ==
 * Log into gmail
 * Click gear top right, Settings, and then all settings
 * [Accounts and Import] -> [Add another email address]
 * Popup, complete [Name: <description>] [email: <address>], uncheck [ ][Treat as an alias] to use new email in responses.
 * Complete server details - test202104
   * SMTP Server: [smtp.probfaci.com] Port: 25
   * Username: ["me@gmail.com"]
   * Password: ["xxxxxxx"]
   * [x] Secure connection TLS


 * Check tls certificate on smtp server {{{
# echo "quit" | openssl s_client -starttls smtp -crlf -connect <smtp.host>:25 | openssl x509 -noout -text | grep DNS:
}}}

Notes on Linux PostFix email server

  • Aliases configured in

    /etc/postfix/virtual
  • compile file in to *.db with postmap

    /usr/sbin/postmap /etc/postfix/virtual

Setup postfix so gmail can send email through your server to use your own domain

  • Tell postfix to use sasldb

    # cat /etc/postfix/sasl/smtpd.conf 
    pwcheck_method: saslauthd
  • Debug smtp sasl auth https://wiki.vigor.nz/smtp

  • add entries to /etc/postfix/sasl_passwd

    • then compile to db with # postmap sasl_passwd

  • Test local user/password with testsaslauthd

    # cat /etc/default/saslauthd
      ... MECHANISMS="sasldb
      ... OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"
    # # ls -l /etc/sasldb2   <<The sasldb
    # sasldblistusers2
    # saslpasswd2 <user>
    # testsaslauthd -u <user> -p <password> -f /var/spool/postfix/var/run/saslauthd/mux
  • Test with openssl s_client

    $ echo -n "<user>" | base64
    $ echo -n "<password>" | base64
    $ openssl s_client -connect vigor.nz:25 -starttls smtp
    EHLO test.com
    AUTH LOGIN
    334 VXNlcm5hbWU6   >> = "Username:" in base64
    <user|base64>
    334 UGFzc3dvcmQ6   >> = "Password:" in base64
    <pass|base64>
    535 5.7.8 Error: authentication failed: authentication failure

Configure gmail email

  • Log into gmail
  • Click gear top right, Settings, and then all settings
  • [Accounts and Import] -> [Add another email address]

  • Popup, complete [Name: <description>] [email: <address>], uncheck [ ][Treat as an alias] to use new email in responses.

  • Complete server details - test202104
    • SMTP Server: [smtp.probfaci.com] Port: 25
    • Username: ["me@gmail.com"]

    • Password: ["xxxxxxx"]
    • [x] Secure connection TLS
  • Check tls certificate on smtp server

    # echo "quit" | openssl s_client -starttls smtp -crlf -connect <smtp.host>:25 | openssl x509 -noout -text | grep DNS:

linux/PostFixEmail (last edited 2023-01-21 07:37:26 by PieterSmit)