Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the SMTP password from a file as opposed to the command-line argument #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Synopsis: sendEmail -f ADDRESS [options]
-bcc ADDRESS [ADDR ...] bcc email address(es)
-xu USERNAME username for SMTP authentication
-xp PASSWORD password for SMTP authentication
-xp-file FILE read the password for SMTP server from FILE

Paranormal:
-b BINDADDR[:PORT] local host bind address
Expand Down
12 changes: 12 additions & 0 deletions sendEmail
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,13 @@ sub processCommandLine {
}
}

elsif ($ARGS[$counter] =~ /^-xp-file$/) { ## AuthSMTP Password in a file ##
$counter++;
open my $pfile, '<', $ARGS[$counter];
$opt{'password'} = <$pfile>;
close $pfile;
}

elsif ($ARGS[$counter] =~ /^-xp$/) { ## AuthSMTP Password ##
$counter++;
if ($ARGS[$counter] && $ARGS[$counter] !~ /^-/) {
Expand Down Expand Up @@ -1300,6 +1307,7 @@ Synopsis: $conf{'programName'} -f ADDRESS [options]
-bcc ADDRESS [ADDR ...] bcc email address(es)
-xu USERNAME username for SMTP authentication
-xp PASSWORD password for SMTP authentication
-xp-file FILE read the password for SMTP server from FILE

${colorGreen}Paranormal:${colorNormal}
-b BINDADDR[:PORT] local host bind address
Expand Down Expand Up @@ -1567,6 +1575,7 @@ Options that don't fit anywhere else:
-a ATTACHMENT [ATTACHMENT ...]
-xu USERNAME
-xp PASSWORD
-xp-file FILE
-o username=USERNAME
-o password=PASSWORD
-o tls=<auto|yes|no>
Expand All @@ -1584,6 +1593,9 @@ Options that don't fit anywhere else:
-xp PASSWORD
Alias for -o password=PASSWORD

-xp-file FILE
Read the SMTP server password from the specified FILE.

-o username=USERNAME (synonym for -xu)
These options allow specification of a username to be used with SMTP
servers that require authentication. If a username is specified but a
Expand Down