All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bagas Sanjaya <bagasdotme@gmail.com>
To: Sumitra Sharma <sumitraartsy@gmail.com>
Cc: Linux Outreachy <outreachy@lists.linux.dev>
Subject: Re: [KERNEL NEWBIES ACCESS] Sumitra Sharma
Date: Tue, 14 Mar 2023 16:27:30 +0700	[thread overview]
Message-ID: <ZBA+AtHMFwwkwifW@debian.me> (raw)
In-Reply-To: <20230314081646.GA37415@sumitra.com>

[-- Attachment #1: Type: text/plain, Size: 4989 bytes --]

On Tue, Mar 14, 2023 at 01:16:46AM -0700, Sumitra Sharma wrote:
> > Hi,
> > 
> > You may also consider updating OutreachyfirstpatchAlt.
> >
> 
> Hi,
> 
> I am sorry but I am unable to understand this line. Are you referring here to the changes you are mentioning? or to some other document called "outreachyfirstpatchAlt?

On Outreachyfirstpatch, there is a pointer to Outreachyfirstpatchalt
(which contains instructions on spinning up Ubuntu VM), so you need to
install your tools (including postfix and mutt) there if you want to
contribute through there. So I think the latter doc should be kept as
is.

> 
> > For MTA, replace the now abandoned esmtp with Postfix. Configure the MTA as
> > null client (see [1]). For system-generated emails sent to root and postmaster,
> > you will also need to canonicalize these recipient addresses to your email
> > address (see [2]).
> > 
> 
> Okay, So then these will be the following new updates I will propose in
> the Outreachy firstpatch document.
> 
> Configure Postfix Null Client
> 
> 1. Install postfix using below commands. The installation process will open some interactive prompts where you set "General type of mail configuration -> Insternet Site" and "System mail name -> example.com".
> Note: The postfix will then use the address <username@example.com> to send and recieve emails.
> 
> 	> sudo apt update
> 	> sudo apt install postfix
> 
> 2. Edit and set /etc.postfix/main.cf for gmail as:
> 
> 	relayhost = [smtp.gmail.com]:587
> 	inet_interfaces=loopback-only
> 	mynetworks=127.0.0.0/8 [::1]/128
> 	myorigin=example1.example.com
> 	local_transport=error: local delivery disabled
> 
> And add this in main.cf:
> 
> 	recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
> 
> 3. Create file named /etc/postfix/recipient_canonical and add the
> following:
> 	
> 	root@example.com postmaster@example.com
> 
> This will enable the forwarded mail addressed to root@ and postmaster@ to be received in your primary account.
> 
> Finally hash it.
> 	> postmap /etc/postfix/recipient_canonical
> 
> 4. Add Gmail Username and App password to postfix configuration by creating a sasl_passwd file in /etc/postfix/sasl_passwd and add the gmail id and App password:
> 
> 	[smtp.gmail.com]:587 <username>@gmail.com:<App Password>
> 
> Finally hash it.
> 	> postmap /etc/postfix/sasl/sasl_passwd
> 
> 5. Restart your postfix using
> 
> 	> systemctl restart postfix
> 

You miss some important SASL authentication configs, since in this case Postfix
acts as email client. The SASL recipe is (ignore markdown except bullet
lists):

1. Adjust TLS level for Postfix SMTP client in `/etc/postfix/main.cf` so that Postfix can
   relay emails:

   ```
   smtp_tls_security_level = may
   ```

2. Add SASL settings to `/etc/postfix/main.cf`:

   ```
   smtp_sasl_auth_enable = yes
   smtp_sasl_security_options = noanonymous
   smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd
   ```

3. Enter SMTP credentials in `/etc/postfix/sasl/passwd`:

   ```
   [smtp.gmail.com]:587		my.email@gmail.com:<app password>
   my.email@gmail.com		my.email@gmail.com:<app password>
   ```

4. Build the password database:

   ```
   # postmap /etc/postfix/sasl/passwd
   ```

5. In case you have multiple email accounts, you can activate sender-dependent
   relay. To do so, append to `/etc/postfix/main.cf`:

   ```
   smtp_sender_dependent_authentication = yes
   sender_dependent_relayhost_maps = hash:/etc/postfix/relayers
   ```

   Add relay servers associated with your email addresses to
   `/etc/postfix/relayers`:

   ```
   my.email@gmail.com		[smtp.gmail.com]:587
   my.email@provider.net	[provider.net]:587
   ```

   Add credentials for your other addresses to `/etc/postfix/sasl/passwd`:

   ```
   my.email@provider.net	my.email@provider.net:<email password>
   ```

   Rebuild the databases:

   ```
   $ postmap /etc/postfix/relayers /etc/postfix/sasl/passwd
   ```

6. Restart Postfix.

Note that if you use SMTPS port (465), you will also need to append
`smtp_tls_wrappermode=yes` to `/etc/postfix/main.cf`.

> - Open the ~/.muttrc
>         - Add the information
> 
>                 set sendmail="/usr/sbin/sendmail"
>                 set envelope_from=yes
>                 set from="Your Name <my.email@gmail.com>"
>                 set use_from=yes
>                 set edit_headers=yes
> 
>                 # IMAP settings
>                 set imap_user = "username@gmail.com"
>                 set imap_pass = "<mailbox password>"
> 
>                 # SMTP settings
>                 set smtp_url = "smtps://username@smtp.gmail.com"
>                 set smtp_pass = "<mailbox password>"
> 

If you have set sendmail, you don't need to set SMTP credentials above,
as Postfix will do the job.

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2023-03-14  9:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 17:07 [KERNEL NEWBIES ACCESS] Sumitra Sharma Sumitra Sharma
2023-03-13  9:09 ` Bagas Sanjaya
     [not found]   ` <20230314081646.GA37415@sumitra.com>
2023-03-14  9:27     ` Bagas Sanjaya [this message]
     [not found]       ` <20230314123317.GB38692@sumitra.com>
2023-03-15  8:41         ` Bagas Sanjaya
2023-03-17  8:59   ` Bagas Sanjaya
2023-03-16  8:31 ` Sumitra Sharma
2023-03-17  8:51   ` Bagas Sanjaya
2023-03-17 16:15     ` Sumitra Sharma
2023-03-17 11:05   ` Fabio M. De Francesco
2023-03-17 11:12     ` Julia Lawall
2023-03-17 15:15     ` Fabio M. De Francesco
2023-03-17 18:00       ` Sumitra Sharma
2023-03-17 19:24         ` Fabio M. De Francesco
2023-03-18  6:54           ` Sumitra Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZBA+AtHMFwwkwifW@debian.me \
    --to=bagasdotme@gmail.com \
    --cc=outreachy@lists.linux.dev \
    --cc=sumitraartsy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.