• 10 Posts
  • 263 Comments
Joined 2 years ago
cake
Cake day: June 16th, 2023

help-circle










  • Dovecot + Postfix + Rspamd can do it. Instead of pulling emails you can simply forward those providers to your homeserver account. You may also setup Postfix in a way that would allow you to use our @gmail @hotmail addresses as “from” addresses / aliases to your local account and it will automatically submit the email through the provider SMTP server when you send something.


    If you really want to pull email instead of setting up forwards (have your server offline more time and whatnot) there are a few options:


    To route the outgoing email through the right provider / external SMTP server based on the “from” address you may configured it like this:

    main.cf:

    smtp_sasl_auth_enable = yes
    smtp_sender_dependent_authentication = yes
    smtp_sasl_password_maps = mysql:/etc/postfix/virtual/mysql-external-alias-credentials.cf
    sender_dependent_relayhost_maps = mysql:/etc/postfix/virtual/mysql-external-alias-relay-hosts.cf
    smtp_sasl_security_options = noanonymous
    

    mysql-external-alias-credentials.cf:

    user = XXXXX
    password = XXXXXX
    hosts = 127.0.0.1
    dbname = mailserver
    query = SELECT concat(relay_user, ':', relay_passwd) AS credential FROM `Virtual_Alias_External` WHERE alias='%s' AND active = 1;
    

    mysql-external-alias-relay-hosts.cf:

    user = XXXXX
    password = XXXXXX
    hosts = 127.0.0.1
    dbname = mailserver
    query = SELECT relay_host AS transport FROM `Virtual_Alias_External` WHERE alias='%s' AND active = 1;
    

    MySQL table structure:

    CREATE TABLE `Virtual_Alias_External` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `alias` varchar(70) NOT NULL,
      `owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
      `active` tinyint(1) NOT NULL DEFAULT 0,
      `relay_host` varchar(70) NOT NULL DEFAULT '',
      `relay_user` varchar(70) NOT NULL,
      `relay_passwd` varchar(70) NOT NULL,
      PRIMARY KEY (`id`) USING BTREE
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT;
    

    Create an entry like this:

    alias: [email protected]
    owner: [email protected]
    active: 1
    relay_host: [smtp.gmail.com]:587
    relay_user:  [email protected]
    relay_passwd: your-gmail-password-or-app-password
    

    Now when you send and email and the from is set as your-emai@gmail.com Postfix will route the email through Gmail’s SMTP server with credential stored on that table. If done correctly (smtpd_sasl_authenticated_header = no) no references to local-email-address@homeserver.example.org will show up on the email headers.



  • Well partial sync is the only thing you can say that is an advantage… but frankly you can emulate with in Syncthing with exclusion patterns. I “hate” Nextcloud because it eventually failed in all deploys I made with it. They don’t even get right a simple WYSIWYG editor. As I said before I re-try Nextcloud from time to time, and I would love very much to see it succeed and replace all the other tools I use, but it doesn’t deliver on the promise. At least not for the numbers of users I have.

    What logic does it have to advertise your solution as an alternative to MS365 / Google Workplace if they can’t even deliver a properly working and useful webmail? The WYSIWYG is broken, you can’t resize the window to make it bigger and some other annoying details. And then there are always constant complaints of others about losing all data on upgrades (I haven’t experienced this but still).