Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket pipeline, Email not getting send to me when attachment is a zip file

Edited

Hi, 
When I try to send an HTML file as an attachment then I am able to receive an email from the bitbucket pipeline but when I am trying to send a Zip file then I am seeing a error "Failed to send email to email@email.com. Check your configuration settings."

 

screenshot22_09_02.png

Note: I am not the admin of this repository, Do I need to ask an admin to make some changes?

 

Yml file , Attachment is an HTML file


custom: # Pipelines that can only be triggered manually
QA2: # The name that is displayed in the list in the Bitbucket Cloud GUI
- step:
image: openjdk:8
caches:
- gradle
size: 2x # double resources available for this step to 8G
script:
- apt-get update
- apt-get install zip
- cd config/geb
- ./gradlew -DBASE_URL=qa2 clean BSchrome_win
- cd build/reports
- zip -r testresult.zip BSchrome_winTest

after-script: # On test execution completion or build failure, send test report to e-mail lists
- pipe: atlassian/email-notify:0.3.11
variables:
<<: *email-notify-config
TO: 'email@email.com'
SUBJECT: "Test result for QA2 environment"
BODY_PLAIN: |
Please find the attached test result report to the email.
ATTACHMENTS: config/geb/build/reports/BSchrome_winTest/tests/index.html

 

Yml file, attachment is a zip file

custom: # Pipelines that can only be triggered manually
QA2: # The name that is displayed in the list in the Bitbucket Cloud GUI
- step:
image: openjdk:8
caches:
- gradle
size: 2x # double resources available for this step to 8G
script:
- apt-get update
- apt-get install zip
- cd config/geb
- ./gradlew -DBASE_URL=qa2 clean BSchrome_win # This step fails
- cd build/reports
- zip -r testresult.zip BSchrome_winTest

after-script: # On test execution completion or build failure, send test report to e-mail lists
- pipe: atlassian/email-notify:0.3.11
variables:
<<: *email-notify-config
TO: 'email@email.com'
SUBJECT: "Test result for QA2 environment"
BODY_PLAIN: |
Please find the attached test result report to the email.
ATTACHMENTS: config/geb/build/reports/testresult.zip

UPDATE:-

Found out that, My zip file includes a ".js" that's why I can't send it as an attachment, 

screenshot09_58_19.png

One solution I think is to create an artifact and send a bitbucket pipeline link in the email, but many business people have not accessed to repo

Another solution could be to send it as a drive attachment. I like this one but I am not sure how to send zip file as a drive attachment using "atlassian/email-notify:0.3.11" ?

1 answer

1 accepted

0 votes
Answer accepted

Hello @Shubhendu Pandey , thank you for reporting.

As a workaround I can propose two solutions:

- zip archive without executable files , due to security , indeed, you are right, google does not allow such files to prevent some malware https://support.google.com/mail/answer/6584

- or send drive link in a message if this satisfy your case

It is also a good idea for writing custom pipe that will be uploading your archive to drive. Follow this guide How to write custom pipe 

I implemented a different report that doesn't create a.js file. I will checkout the custom pipe.Thanks 

Like Galyna Zholtkevych likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

56 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you