Cron Email with msmtp MCQ Quiz

25 questions with shuffled answers, score, timer, and short explanations

Total Questions
25
Answered
0
Score
0
Timer
20:00

Result

Question 1 Not answered

What is the main purpose of configuring msmtp with cron?

Explanation: msmtp acts as an SMTP client so cron/mail output can be delivered to an external inbox such as Gmail.
Question 2 Not answered

What does MAILTO do inside a crontab?

Explanation: MAILTO tells cron where to send output generated by cron jobs.
Question 3 Not answered

Which password should be used for Gmail SMTP with msmtp?

Explanation: For Gmail SMTP, use a Google App Password, not your normal Gmail password.
Question 4 Not answered

What must usually be enabled before creating a Google App Password?

Explanation: Google App Passwords require 2-Step Verification to be enabled on the Google Account.
Question 5 Not answered

Which file is commonly used for system-wide msmtp configuration?

Explanation: The system-wide msmtp configuration file is commonly `/etc/msmtprc`.
Question 6 Not answered

Which file can be used for user-specific msmtp configuration?

Explanation: A user-specific msmtp configuration can be stored in `~/.msmtprc`.
Question 7 Not answered

Which command secures `/etc/msmtprc` so only the owner can read and write it?

Explanation: `chmod 600` allows only the file owner to read and write the file.
Question 8 Not answered

Why should `/etc/msmtprc` be protected?

Explanation: The msmtp config contains sensitive SMTP credentials, so permissions should be strict.
Question 9 Not answered

Which command creates the msmtp log file if it does not exist?

Explanation: `touch` creates the file if it does not exist.
Question 10 Not answered

Which command tests msmtp directly with a subject line?

Explanation: Using `printf` with a Subject header and piping to msmtp is a direct SMTP test.
Question 11 Not answered

What does this error mean: `mail: cannot send message: Process exited with a non-zero status`?

Explanation: This means the mail-sending backend failed. You should check msmtp logs and sendmail linkage.
Question 12 Not answered

Which command helps check msmtp errors?

Explanation: `/var/log/msmtp.log` stores msmtp log messages if configured.
Question 13 Not answered

Which command checks whether `/usr/sbin/sendmail` points to msmtp?

Explanation: `readlink -f /usr/sbin/sendmail` shows the real target of the sendmail compatibility path.
Question 14 Not answered

What does `account default : gmail` mean in `/etc/msmtprc`?

Explanation: It tells msmtp to use the configured `gmail` account by default.
Question 15 Not answered

Which SMTP host is used for Gmail in this lab?

Explanation: Gmail SMTP uses `smtp.gmail.com`.
Question 16 Not answered

Which SMTP port was used for Gmail TLS submission in this lab?

Explanation: Port 587 is commonly used for SMTP submission with STARTTLS.
Question 17 Not answered

What happens if cron output is redirected using `>> logfile 2>&1`?

Explanation: Redirection sends stdout and stderr to the log file, so cron may have no output left to email.
Question 18 Not answered

What does `MAILTO=""` mean?

Explanation: An empty MAILTO disables cron email for that crontab.
Question 19 Not answered

Which cron entry sends email every minute if the command produces output?

Explanation: This command runs every minute and prints output, so cron can email that output if MAILTO is set.
Question 20 Not answered

Why should you remove or comment the every-minute test cron job after testing?

Explanation: The test job runs every minute, so leaving it active will flood your inbox.
Question 21 Not answered

Which cron style is best when you want logs only and no email?

Explanation: Set `MAILTO=""` to disable email and redirect output/errors to a log file.
Question 22 Not answered

Which method can send output to both a log file and cron email?

Explanation: `tee -a` writes output to a file and also passes it along, allowing cron to email it.
Question 23 Not answered

Which command tests the `mail` command after msmtp direct testing works?

Explanation: This sends a test email using the `mail` command with a subject.
Question 24 Not answered

Which command edits the user's crontab to set MAILTO?

Explanation: `crontab -e` edits the current user's crontab where MAILTO can be set.
Question 25 Not answered

What proved the lab was successful?

Explanation: Receiving all three emails proves Gmail SMTP, msmtp, mail, and cron MAILTO are working.