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

[2021/12/03/12:07:31]<优化::tmp>: commit by Yang2635 #2

Merged
merged 1 commit into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions SCS_domail_mail_manage.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
source ./htmlTemp_Demo.sh

function _Generate_Users_StrongPassword_Algorithm(){
local i tmp size max rand
Expand All @@ -25,7 +24,7 @@ function _Domain_MainAccess_Manage_ByAdmin(){
# "$Aceess_EmailList_Manage_API/list?domain=$Access_Domain")

# add user.
ADD_MAIL_List_Request=$(curl -H "PddToken: ${Define_PDD_Token}" \
ADD_MAIL_List_Request=$(curl -s -H "PddToken: ${Define_PDD_Token}" \
-H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:93.0) Gecko/20100101 Firefox/93.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" \
-d "domain=$Access_Domain&login=$Define_Mail_UsernameNosuffix&password=$_Pass_From_GUSP_Algo" \
Expand All @@ -36,7 +35,10 @@ Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/w
function _SCSMAIN_Domain_Mail_Manage_Logic(){
_Generate_Users_StrongPassword_Algorithm
_Domain_MainAccess_Manage_ByAdmin
echo -e "$EmailhtmlTempStart$Define_Mail_FullUsername\n密码为:\n $_Pass_From_GUSP_Algo\n$EmailhtmlTempEnd\n" > result.html
#echo -e "$EmailhtmlTempStart$Define_Mail_FullUsername\n密码为:\n $_Pass_From_GUSP_Algo\n$EmailhtmlTempEnd\n" > result.html
export Username=${Define_Mail_FullUsername}
export Password=${_Pass_From_GUSP_Algo}
envsubst <./htmlTemp_Demo.html.template >./result.html
}

# Set gobal var here. Visit https://yandex.com/dev/domain/doc/reference/email-add.html to access api.
Expand All @@ -48,4 +50,4 @@ Define_PDD_Token=$1
Define_Mail_UsernameNosuffix=$2
Define_Mail_FullUsername="$Define_Mail_UsernameNosuffix@$Access_Domain"

_SCSMAIN_Domain_Mail_Manage_Logic
_SCSMAIN_Domain_Mail_Manage_Logic
13 changes: 2 additions & 11 deletions htmlTemp_Demo.sh → htmlTemp_Demo.html.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/bash

EmailhtmlTempStart=$(cat<<EOF
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="https://tuna.moe/assets/css/font-awesome-v4-shims.min.css"/>
<table border="0" cellspacing="0" cellpadding="0" style="padding-bottom:20px;max-width:516px;min-width:220px">
Expand Down Expand Up @@ -71,12 +68,7 @@ EmailhtmlTempStart=$(cat<<EOF
</div>
<table align="center" style="margin-top:8px"><tbody><tr style="line-height:normal"><td align="right" style="padding-right:8px">
<div style="padding-top:20px;font-size:12px;line-height:16px;color:#5f6368;letter-spacing:0.3px;text-align:center">
<pre><code>
EOF
)

EmailhtmlTempEnd=$(cat<<EOF
</code></pre>
<pre><code>账号:${Username}<br>密码:${Password}</code></pre>
</div>
</div>
<div style="border-bottom:thin solid #dadce0;color:rgba(0,0,0,0.87);line-height:32px;padding-bottom:24px;text-align:center">
Expand All @@ -91,5 +83,4 @@ EmailhtmlTempEnd=$(cat<<EOF
</div>
</td>
<td width="8" style="width:8px"></td></tr></tbody></table>
EOF
)