Dovecot, mail crypt plugin - email

I am developing a mail server with dovecot and now I need to encrypt all the mails before storing and decrypt them when reading. I recently found a plugin for dovecot called mail crypt. Dovecot wiki is little bit hard to understand. Would you please suggest a good tutorial for that or is there any other good plugin for encrypt emails for dovecot?

Found the solution, update "dovecot.conf" with below lines
mail_plugins = $mail_plugins mail_crypt
mail_attribute_dict = file:%h/Maildir/dovecot-attributes
plugin {
mail_crypt_curve = prime256v1
mail_crypt_save_version = 2
}

Related

Gerrit not sending emails

I have set up a Gerrit server and trying to make it send emails (for all events). But for some reason Gerrit doesn't send any emails. error_logs shows absolutely no data, that means it is not even trying to send emails.
Here is relevant part of my project.config for All-Projects:
[notify "demo"]
email = me#company.com
type = all
Here is my gerrit.config:
[gerrit]
basePath = git
canonicalWebUrl = http://hostname:8443/
[database]
type = h2
database = db/ReviewDB
connectionPool = true
poolLimit = 128
[index]
type = LUCENE
[auth]
type = LDAP
[ldap]
poolDebug = all
server = ldap://nod.company.com
accountBase = cn=users,dc=company,dc=com
accountEmailAddress = mail
referral = follow
[sendemail]
smtpServer = relay.company.com
smtpServerPort = 25
smtpUser = my_username
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
heapLimit = 2g
[sshd]
listenAddress = *:29419
maxConnectionPerUser = 256
[automerge]
botEmail = me#company.com
[download]
scheme = ssh
[httpd]
listenUrl = http://*:8443/
maxThreads = 128
[cache]
directory = cache
[gitweb]
cgi = /usr/share/gitweb/gitweb.cgi
Environment: Ubuntu 14.04 and Gerrit 2.11.6.
I have tried to send emails from command line on this server and that works just fine.
All of my individual projects on Gerrit inherit access rights from All-Projects. I even tried adding the email section to each individual project but that didn't help either.
My colleague, who has his own Gerrit server that is able to send emails, looked into my issue and couldn't figure out what's wrong with my server. We both have same Linux version, Gerrit version, gerrit.config and project.config.
Ok, found the issues and fixed them. I had two issues, sharing for user reference.
I installed sendmail utility when logged in as a user other than smtpUser account mentioned in gerrit.config. After that I forgot to add the sendmail utility to /opt and hence the smtpUser's account from gerrit.config was not able to access the sendmail utility. Once I shared the sendmail utility with all user accounts, gerrit started sending emails.
To summarize, make sure the user account mentioned under smtpUser has sendmail available to it. Thanks everyone for your time.
gerrit wont send the email ONLY to the user that is also the smtpUser in gerrit.config. I was testing it by sending emails to only me, and hence it didnt work. I had to change to project config to add an email address other than my own email account.
I dont know if this is a gerrit bug or a gerrit feature. If a feature then not sure what is the use case for this !!
I hope this info helps other guys out there.
I had this problem after a recent Gerrit update (from 2.15 -> 3.2).
I checked the postfix logs in /var/log/maillog and they clearly showed that after the machine was rebooted following the Gerrit update no more mails arrived here.
Looking further into <gerrit-path>/logs/error_log (I had to look in rollated files) showed me that there seemed to be a problem with our mail template and also gave me the path to the offending file.
We previously used a custom mail template from https://gist.github.com/orgads/d8a61a1c10efeb7a4fafbcb6374167c3, the format of which seems to no longer be valid. I replaced this with the .soy.example file provided by Gerrit which fixed the issue.
For me, since I was trying to test emails by getting them to send to my own email, I had to go to settings (Gerrit 2.15.17 BTW), then preferences, under email notifications, select "every comment" in the dropdown menu.

How to open mail panel in Swift? Mac OS

For the past few days I've been strugling with finding a way to send emails from my app. This is the sample code I am currently using. It think, by using this method, I might be unable to handle the situation of an improper setting of the mail accound of the computer my app will be running, so I thought about using a different method. I was wondering if is there any MessageUI equivalent for mac os. Is there any MessageUI equivalent for mac os. Any ideas?
There are two ways to do that:
AppleScript framework
NSSharingService
NSSharingService to compose mail:
let service = NSSharingService(named: NSSharingServiceNameComposeEmail)
service?.recipients = ["test#gmail.com"]
service?.subject = "Test Mail"
service?.performWithItems(["Test Mail body"])
Launch Mail App
If you just want to open Mail app, try below code:
NSWorkspace.sharedWorkspace().launchApplication("Mail")
Improper Setting:
If account is not configured on the system, this code will show configuration window for mail
When user will try to send mail it'll be shown improper setting related error by Mail app so you need not to bother about it
If you want to use other then Mail app, just try your own mail system, native mail client or third party mail framework.
Try from terminal:
You can use shell script to send mail using native client
mail -s "Hello" "test#gmail.com" <<EOF
Hello, Test!
EOF
For Swift 4, little changes.
let service = NSSharingService(named: NSSharingService.Name.composeEmail)
service?.recipients = ["test#gmail.com"]
service?.subject = "Test Mail"
service?.perform(withItems: ["Test Mail body"])

codeigniter test sending mails on windows

i am currently developing a website which requires email verification, but i am developing on windows, and would like to test sending email verifications on localhost. I tried using Test Mail Server Tool, but i don't think i am setting it up correctly because there were no errors, but i didn't receive any email. this is the code i put in my config file
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['mailpath'] = 'C:\Program Files\Toolheap\Test Mail Server Tool\TestMailServerTool.exe';
$config['protocol']= 'smtp';
what am i doing wrong? i am really new to this so i have no idea where to start looking.
i created an email.php and put that in application/config/ so i don't think i need to initialize it?
thanks in advance.
Have you checked whether or not you need to include the following configuration options?
smtp_host
smtp_user
smtp_pass
smtp_port

Amazon Simple Email Service - "From" email verification

I am signed up for AWS SES (with instance, S3 and my website running nicely). I also have rec'd approval for sending out email without receiver verification and "mass production" OK. The only thing I'm left with is having my 3 "from" email addresses verified. Started to download Perl, as was suggested to run email-verification scripts -- but got no where with the installation. Do have my credentials ready to use.
There is an AWS SES API to use for verification which I can't find... suspect that it has something to do with AWS's sdk which I could figure out how to install.
So my question: is there a simple, straight forward way to get my email addresses to Amazon for verification via a response email they send? Their documentation is somewhat confusing.
You have to go validate your email address through their web service (like the perl script is doing). You can also use their SDK's that they publish, which are wrappers around their web service. For example, if you have Visual Studio, you can use the AWS SDK for .NET (also available as a Nuget package: PM> Install-Package AWSSDKForNET) and set up a simple console application to do something like this:
using Amazon.SimpleEmail;
using Amazon.SimpleEmail.Model;
static class Program {
static void Main() {
var client = new AmazonSimpleEmailServiceClient("yourAccessKey", "yourSecretKey");
var request = new VerifyEmailAddressRequest { EmailAddress = "yourEmailAddress" };
client.VerifyEmailAddress(request);
}
}
They also have SDK's available in PHP and Java that work pretty much the same.
This is an old post but came up in a search.
You can now verify emails directly from the SES control panel (See screen shot)
AWS SES Panel

Catchall Router on Exim does not work

I have setup a catchall router on exim (used as last router):
catchall:
driver = redirect
domains = +local_domains
data = ${lookup{*#$domain}lsearch{/etc/aliases}}
retry_use_local_part
This works perfectly when sending emails locally. However, if I login to my GMail account and send an email to whatever#mydomain.com, then I get an "Unrouteable Address".
Thank you for any hints to solve this issue.
In the system_aliases: section of the config file you already have a section which does the lookup in /etc/aliases.
Replace
data = ${lookup{$local_part}lsearch{/etc/aliases}}
with
data = ${lookup{$local_part}lsearch*#{/etc/aliases}}
and make sure you have *:catchall_username* in /etc/aliases
This works great for a single domain mail server which is already using /etc/aliases
For this router to work, make sure that
mydomain.com is in local_domains
there is an entry for *#mydomain.com in /etc/aliases
MX record for mydomain.com is pointing to the server, where you've
configured this
This is old as heck, but I didn't see a good answer posted and someone else might want to know the answer.
This post is geared towards Debian with in single configuration file mode. It should work on any Linux Exim4 install though. For the purpose of explaining things we’ll use test#example.com which is configured with the hostname mail.example.com. The system will have a real user called test and we want to create an alias for test called alias. So the end result will all email sent to alias#example.com forwarded to test#example.com without having to create the user alias on the system.
First we need to create a place to store all of the alias files:
mkdir /etc/exim/aliases.d
vim /etc/exim/aliases.d/mail.example.com
contents of the alias file for mail.example.com alias:test
vim /etc/exim/exim4.conf.template
Now look for the section system_aliases. Here you’ll see data = ${lookup{$local_part}lsearch{/etc/aliases}} or something similar. Change that to
data = ${lookup{$local_part}lsearch{/etc/exim4/aliases.d/$domain}}
Save the file and restart exim. The alias should now work. To add support for other domains just add more alias files in the aliases.d directory with the correct hostname.
I copied and pasted this from my blog:
0xeb.info