Change Exim file with WHM Cpanel - email

Hi i started using osTicket for my helpdesk and i was able to do the Email pipe successfully, but even if the ticket is created, the user receives: Mail delivery failed: returning message to sender.
In osTicket it says to change de exim document, but i have WHM and i don't know how to change it.
Can someone tell me how to change the following using the WHM editor
driver = pipe
return_output
driver = pipe
group = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
return_output
user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
i need to change the return_output to return_fail_output

Sounds like you need to change your EXIM config file. In WHM, you can go to: Service Configuration -> Exim Configuration and click on 'Advanced Editor' (at the bottom) to have access to it.
I will warn to be careful in there as it may cause issues, but that's where it looks like you'll want to put your rules and such.

Related

Sitecore custom MTA for localhost

I am trying to figure out EXM for Sitecore. I installed it and now I am trying to configure it to send emails from my local machine. SAC MTA is not an option because I don't have access to App Center. I am left with custom MTA.
I was trying to configure config files to use gmail smtp:
Sitecore.EDS.Providers.CustomSmtp.config
<smtpSettings type="Sitecore.EDS.Core.Net.Smtp.SmtpSettings, Sitecore.EDS.Core" singleInstance="true">
<server>smtp.gmail.com</server>
<port>465</port>
<userName>*****#gmail.com</userName>
<password>*****</password>
<authenticationMethod>Login</authenticationMethod>
<startTls>true</startTls>
<proxySettings ref="exm/eds/proxySettings" />
</smtpSettings>
Sitecore.EDS.Providers.CustomSmtp.Sync.config
<pop3Settings>
<pop3Setting type="Sitecore.EDS.Core.Net.Pop3.Pop3Settings, Sitecore.EDS.Core" singleInstance="true">
<server>pop.gmail.com</server>
<port>995</port>
<userName>****#gmail.com</userName>
<password>****</password>
<useSsl>true</useSsl>
<startTls>true</startTls>
<proxySettings ref="exm/eds/proxySettings"/>
</pop3Setting>
</pop3Settings>
But when I try to "send quick test" through EXM I get "Failed to connect to the email server. Please try again later". Can anyone help me with that configuration. And is it even possible? I remember reading something about paid license to use custom MTA. Would it mean, that you need to pay to send email via EXM?
To switch from using the Sitecore MTA to using the Custom SMTP, you must disable the Dyn configurations and then enable the CustomSmtp configurations:
In the Website\App_Config\Include\EmailExperience folder, add the suffix .disabled to the end of the following file names:
Sitecore.EDS.Providers.Dyn.config
Sitecore.EDS.Providers.Dyn.Sync.config
In the  Website\App_Config\Include\EmailExperience folder, remove the suffix .disabled from the following file names:
Sitecore.EDS.Providers.CustomSmtp.config.disabled
Sitecore.EDS.Providers.CustomSmtp.Sync.config.disabled

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.

Recover email sended through exim?

lost some important data from my server and I know that data was sended via email. I have root access and I need to recover those emails.
I looked into exim logs and I have the email ID, but when I use a command like:
root#server [/var/spool/exim/msglog]# exim -Mvh 1ZfRwk-003bDf-JB
Failed to open input file for 1ZfRwk-003bDf-JB-H: No such file or directory.
Logs looks like:
2015-09-25 08:17:50 1ZfRwk-003bDf-JB <= info#myserver.com U=username P=local S=7453 id=20150925121750.117390002 ...... etc
I am running WHM under centOS
Is possible recover sended mails?
Any help would be appreciated.
No, You can not recover any mail which was send from your server. You can check your 1ZfRwk-003bDf-JB mail logs with the following command so that you can find out full logs of that mail.
grep 1ZfRwk-003bDf-JB /var/log/exim_mainlog

Problems with Exim hosts_require_tls config

I'm trying to enforce TLS for out going mail to a single host. I'm no exim expert, in fact I've never even used it, it was all set up by the previous developer.
I just assumed inserting hosts_require_tls = example.co.uk in exmin.conf and restarting the service would work. But when I add this line the service wont start. I checked in the "panic" error log after trying to start the service and it contains
"2011-08-02 12:20:18 Exim configuration error in line 150 of /etc/exim.conf:
main option "hosts_require_tls" unknown"
So I'm obviously being dumb and putting it in the wrong config file or something. Any help would be greatly appreciated. Thanks! :-)
The setting has to be put in the corresponding transport configuration section, probably
remote_smtp:
driver = smtp
hosts_require_tls = example.co.uk
by default. Not in the main configuration (where it is unknown).

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