mutt fails to send email

40 Views Asked by At

In my Azure ci/cd pipeline, I am executing tests on Ubuntu 20.04. At the end of the test, I created task in the azure pipeline , to send an email to team with attachment of test reports.

I am using bash script in the azure task. Here is the code:

echo "line1"
sudo apt install mailutils
echo "line2"
sudo apt install mutt

echo "line3"
echo -e "Test Message" | mutt -s "[E2E ]TestReport - Test Status" -- [email protected]

Now this one works once in a while. I receive an email in my mailbox with the From Name as

vsts@fv-az355-724.norxwxgvcn4uzhpoaxg0br3vlg.fx.internal.cloudapp.net

Each time this email address is different.

I believe since my task is part of ci/cd pipeline, Each time deployment happens , this email is going to be auto-generated. My organization email system is somehow treating it as junk and not letting it enter everytime.

How do I solve this?

I also tried by editing the ~/.muttrc file and setting the hostname . Again it sent an email from that hostname only once and then it stopped. There are no errors or failures.

How do I solve this ?

1

There are 1 best solutions below

1
AnFi On

Mutt may be compiled with support of external smtp relay.
Using fixed SMTP relay may help to pass anti-spam filters

https://unix.stackexchange.com/questions/232178/where-to-configure-my-smtp-server-in-mutt-utility

You can use one of two options:
a) relay via fixed SMTP servers with SMTP AUTH(entication)
b) senging to fixed email address which will "expand" delivery to all intended recipients (after checks) e.g. usimg per OS account procmail scipt on unix

.