Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamCS03 committed Mar 24, 2023
1 parent ca24e6c commit af62894
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions store/src/java/com/zimbra/cs/mailbox/MailSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ void updateHeaders(MimeMessage mm, Account acct, Account authuser, OperationCont
Date date = new Date();
mm.setSentDate(date);

String value = getHashForMessageVerification(mm.getMessageID(), date, from.getAddress());
String value = getMessageVerificationHeaderValue(mm.getMessageID(), date, from.getAddress());
mm.addHeader("Message-Verification", value);

if (sender == null) {
Expand Down Expand Up @@ -1486,10 +1486,11 @@ public static void unregisterPreSendMailListener(PreSendMailListener listener) {
* @param date
* @param from
* @throws ServiceException
*
*/
private static String getHashForMessageVerification(String id, Date date, String from) throws MessagingException, ServiceException {
private static String getMessageVerificationHeaderValue(String id, Date date, String from) throws MessagingException, ServiceException {
String guid = (id + date + from);
String guidHash = getEncryptedValue(guid, MSGVRFY_ALGORITHM_NAME);
String guidHash = getHashForMessageVerification(guid, MSGVRFY_ALGORITHM_NAME);
String hash = MSGVRFY_HEADER_PREFIX + guidHash;
return hash;
}
Expand All @@ -1500,7 +1501,7 @@ private static String getHashForMessageVerification(String id, Date date, String
* @param algo
* @throws ServiceException
*/
private static String getEncryptedValue(String input, String algo) throws ServiceException {
private static String getHashForMessageVerification(String input, String algo) throws ServiceException {
try {
MessageDigest md1 = MessageDigest.getInstance(algo);
byte[] messageDigest1 = md1.digest(input.getBytes(StandardCharsets.UTF_8));
Expand Down

0 comments on commit af62894

Please sign in to comment.