Mutt Send Signature Hook - email

I've got a send hook setup in Mutt for my signature. I usually have a few links in my sig that one customer of mine doesn't like, their email always spits it back. So to fix this I made a new signature file just for this client and setup a send hook in mutt that when it's going to this client it adds this special signature:
send-hook "~t #domain.com" set signature=~/.mutt/branded.sig
set signature="~/.mutt/sig"
The problem now is that once I send an email to this customer then all other emails even if they go to another email address now have the new signature.
How do I tell Mutt that anything other than that email gets the regular signature?

Instead of that second "set signature" line, you want to set another send-hook for "anything other than that".
For example:
send-hook . set signature="~/.mutt/sig"
send-hook "~t #domain.com" set signature=~/.mutt/branded.sig

Related

Mail stay in queue when i use Sendgrid in symfony6

I have set my Sendgrid single sender and validate it ( status = verified).
I use SMTP, create my key that i paste in my code (.env file of my app):
MAILER_DSN=sendgrid+smtp://#default
Then i try to test integration in Sendgrid by clicking on button and refresh my localhost/ page (of course the controller's route is "/" and it contains the code using mailer to send a mail as explain in mailer documentation).
On my vue i don't have error code but mail stay in queue status...
Here the screenshot taken of the profiler:
Can someone tell me why my mail stay queued?
Of course the From email address is mine ( the verified one) and the To is anotherone of mine.
Maybe i have to configure something in my outlook mail (the From one) ?
Sendgrid never match the verification, it stay in checking status until message :
Hmm, we haven't seen your email yet.
Please check your code, run it again, then click "Retry".
Thanks for reply,
Regards,
In your question you said that your MAILER_DSN environment variable is set to:
MAILER_DSN=sendgrid+smtp://#default
That is missing your API Key though. You need to create an API key in the SendGrid dashboard and then add the API key to the MAILER_DSN variable, between the // and the #default like this:
MAILER_DSN=sendgrid+smtp://API_KEY#default
One other thing, ensure that you have installed the SendGrid transport with this command:
composer require symfony/sendgrid-mailer
Yes, thanks you a lot for reply.
Of course all was set as you notify me.
I now have fix my issue, in fact the problem for me with the mail that remains in queued is that the messenger was installed so in asynchronous by default.
I had to add the option message_bus: false in my config/packages/mailer.yaml file not to have the asynchronous option used.
Hopefully this is useful for some people.
add the option message_bus: false in my config/packages/mailer.yaml:
framework:
mailer:
dsn: '%env(MAILER_DSN)%'
message_bus: false

How to use applescript to tell Mail to keep a copy of sent message

I use AppleScript and can send messages without any problem, but the "Sent" box does not get a copy of what I sent. However, if I use Mail Application to send messages, the "Sent" box gets a copy of what I sent. So I guess my AppleScript may miss a command or so to tell Mail to keep a copy of the sent messages. What's the command that I missed? Thanks.
tell application "Mail"
set theNewMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return, visible:true}
tell theNewMessage
set visibile to false
set sender to theSender
make new to recipient at end of to recipients with properties {address:theAddress}
make new attachment with properties {file name:theAttachment} at after the last paragraph
send
delay 5
end tell
end tell
I don’t think you’re missing any command. I copied your script to Script Editor on my iMac, set values for theSubject, theBody, theAddress, theSender, and theAttachment, and ran it. It (a) successfully sent the message, and (b) I was able to view the message it sent in my Sent mailbox.
I tried this both with a known sender and with a random example.com sender. In both cases, it was saved in the default Sent box.
So the issue most likely lies elsewhere. Make sure that the value you’re currently using for theSender maps to an account in Mail that saves sent messages. (If it’s an IMAP account, it may be saving sent messages on the server, and server behavior may be affecting what you see.)
If that doesn’t work, set up some test values for all of the variables in the script except theAddress (using example.com for theSender), and include those (except theAddress) in your question. (If you can use example.com for theAddress, too, do that, but some servers will simply refuse the message immediately, which makes it worthless for testing this particular case.)
Note that you have an error that does not change this behavior; you have “visible” misspelled as “visibile”. However, I tried it both ways and in both cases the outgoing message does get stored in the appropriate Sent box.
Try adding this after you send the message...
set accountReference to first account whose name = "my account name"
synchronize with accountReference

Liferay: how do I add verication URL to new account e-mail

(Using Liferay 6.1.0-CE-GA1.) I have written my own user registration portlet. When I UserLocalServiceUtil.addUser(...), the sendEmail parameter is true and, indeed, it sends the Account Verification Notification.
I've modified that notification by adding this line to it:
Please verify your email address for [$PORTAL_URL$] by clicking this link: [$EMAIL_VERIFICATION_URL$].
Unfortunately the e-mail it sends contains this line, literally:
Please verify your email address for xxx by clicking this link: [$EMAIL_VERIFICATION_URL$].
Is there any way to make this work? I want to send one e-mail with the verification code. My program flow requires it.
Thank you.
You should use this after you added the account in the action
ServiceContext serv = ServiceContextFactory.getInstance(request);
UserLocalServiceUtil.sendEmailAddressVerification(user1, user1.getEmailAddress(), serv);

Emails sent through joomla go to SPAM folder

I am using the latest Joomla build for my website.
Allso we use a DNS record for having the mail delivered to our own server instead of the server on which the website is hosted.
I have used several contact form components, but every sent mail goes to my SPAM folder.
After searching hours on the web (and getting linked to this site frequently) i decided to make a new post.
It does not matter if i use the standard joomla forms, or any component.
Whenever a user fills in a form on my website, the email gets sent. The user receives a copy of its message, and i receive the message of the user. However, this message gets thrown in the spam folder, as phishing.
The sender of the mail always is: username#nameserver.i3d.net; namens; websitename
What do i have to change/enable/disable for this to work?
Thanks in advance.
Patrick.
(Sorry, I'm new to Joomla, but it uses PHP, so this may apply. Also this answer got a little long...)
It might be an issue with the email headers. A lot of email clients will automatically spam-box all mail where the address in the From: header doesn't match the envelope sender. As an analogy, you might not trust a snail-mail letter signed "Your Rich Uncle", mailed in an envelope with a Nigerian return address. Also if your envelope sender has a different domain than the one the email is actually sent from, that's another quick ticket to the junk bin. For more info about Gmail's message blocking policies (and general good practices), you can try this help page.
Here's some basic PHP email-sending code:
$to = $userEmailAddress;
$subj = $emailSubject;
$mesg = $emailMessage;
$headers = implode("\r\n",array(
"MIME-Version: 1.0"
,"Content-type: text/html;charset=iso-8859-1"
,"From: WEB_ADMIN_NICE_NAME <WEB_ADMIN#YOURSERVER.COM>" // *** 'From:' header
));
$from = "-fWEB_ADMIN#YOURSERVER.COM"; // *** envelope sender
if(!mail($to, $subj, $text, $headers, $from)){
//Some error handling...
}
On the first line I commented, you'll want to replace WEB_ADMIN_NICE_NAME with the name you want the email recipient to see (e.g. "Bill Gates"), and on both lines, replace WEB_ADMIN#YOURSERVER.COM with the actual return address (e.g. "da_boss#microsoft.com"). Note: whatever address you choose for the return address is where users' replies will be sent.
To reiterate, make sure both lines have the same return address (though the nice name can be anything you like), and make sure that the actual server sending the mail is in fact located at YOURSERVER.COM.
Lastly, I'm not sure where Joomla does its mailing, but if you're totally lost, you can try grepping with -lr for 'mail[[:space:]]*('.
there are several reasons that could make your email look suspicious to spam filters; to find out which head on to:
http://www.mail-tester.com
grab the email address and send an email from your website to it.
Then go back to the page and it will tell you what's wrong.
btw I'm struggling with the same issue,my problem being that on Joomla 2.5.9 apparently when you send html emails, a text-only copy is not added to the message, which is considered "spammish behaviour"
The problem is the i3d.net email address. My personal experience is that their network (31.204.154.0 - 31.204.155.255) is a significant source of spam and they do not action abuse reports. I suggest changing your hosting company.

How to implement email correlation with subject and body modification?

I have a system that sends mail.
I have a system that receives mail.
I need to identify that a received mail correlates with the one the other system sent.
The particular thing here is that either the subject or the body can be modified.
I thought on putting some hash in the header of the sent email, but I don't know where this could be added
Don't you have any clue?
As you did not supply enough detail for a language specific answer, I will explain the general approach.
You can add a custom header to your outbound email, using x-vendor-header style for the header (start with x- to mark it as an extension, then vendor- for your company and end with the header name. The can be a unique identifier for the email message.
You can look for this header in your inbound process to identify the message.
I've finally found the solution:
Most email's servers support to put something after the username using '+' as separator. So I can encrypt some id and decrypt it when is replied looking on the from address.
example:
neuquino+encryptedID123421234#gmail.com
I hope this can help someone else with the same problem