Configuring cronie for mailing output [solved]

Hi,
I am having a hard time setting up cronie for mailing output. Jump to the last sentence for the actual question.
From man 8 cron, I read that the -m option "allows you to specify a shell command to use for sending Cron mail output instead of using sendmail(8). This command must accept a fully formatted mail message (with headers) on standard input and send it as a mail message to the recipients specified in the mail headers". I do have msmtp installed. I can do this and receive email successfully:
$ msmtp -t << eof
> To: <my address>@gmail.com
>
> test
> eof
Thus I know that msmtp -t is the command I must provide with the -m option.
Then, I followed these instructions and created /etc/systemd/system/cronie.service.d/mailing.conf which contains:
[Service]
ExecStart=
ExecStart=/usr/bin/crond -n -m 'msmtp -t'
Note: the first, empty ExecStart cancels the former one from the original .service file.
After starting cronie.service, this is the result of systemctl status cronie.service:
cronie.service - Periodic Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/cronie.service; enabled)
Drop-In: /etc/systemd/system/cronie.service.d
└─mailing.conf
Active: active (running) since Mon 2013-06-24 22:58:24 EDT; 2s ago
Main PID: 1457 (crond)
CGroup: name=systemd:/system/cronie.service
└─1457 /usr/bin/crond -n -m msmtp -t
Jun 24 22:58:24 electron systemd[1]: Started Periodic Command Scheduler.
Jun 24 22:58:24 electron crond[1457]: (CRON) INFO (Syslog will be used instead of sendmail.)
Jun 24 22:58:24 electron crond[1457]: (CRON) INFO (running with inotify support)
Jun 24 22:58:24 electron crond[1457]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
It seems that systemd drops the single quotes and takes -t as it's own parameter instead of passing it to msmtp. You can also see that crond logged "Syslog will be used instead of sendmail". I can actually see the output of my commands in /var/log/crond.log. How should I quote the space between msmtp and -t in the ExecStart line of my .service file?
Last edited by a_neutrino (2013-06-30 21:54:53)

Hi,
Thanks a lot for your help. The issue is [solved].
dif wrote:You have to create a file /etc/aliases that holds the addresses where e-mail notifications will be sent to when a user's cronjob creates an output.
It seems unnecessary. The MAILTO variable set in the crontab accepts a complete email address.
dif wrote:Contrary to Wiki, there are no commas separating e-mail addresses if there are a few in a line.
The msmtp man page also says to put commas.
dif wrote:
There is a special script distributed with Arch that is able to scan /etc/aliases for a valid domain address and then calls msmtp. Here is its path
/usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh
Copy it to /usr/bin/ and create a simlink:
sudo cp /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh /usr/bin/find_alias_for_msmtp.sh
sudo ln -s /usr/bin/find_alias_for_msmtp.sh /usr/bin/sendmail
Why didn't you just :
chmod +x /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh
ln -s /usr/share/doc/msmtp/find_alias/find_alias_for_msmtp.sh /usr/bin/sendmail
Also, I had to modify the find_alias_for_msmtp.sh script a little because cronie calls sendmail without any parameters:
diff --git a/scripts/find_alias/find_alias_for_msmtp.sh b/scripts/find_alias/find_alias_for_msmtp.sh
index fb485dd..346f313 100644
--- a/scripts/find_alias/find_alias_for_msmtp.sh
+++ b/scripts/find_alias/find_alias_for_msmtp.sh
@@ -16,15 +16,18 @@ MSMTP=`which msmtp || echo "/usr/local/bin/msmtp"`
if [ "$1" = '-i' ] ; then
v_recipient=$2 # mailx calls sendmail with -i as the 1st param and the recipient as the second param
-elif [ "$1" = '-t' ] ; then # most other programs call sendmail with a -t option
+elif [ "$1" = '-t' -o $# = 0 ] ; then
+ # Most other programs call sendmail with a -t option.
+ # cronie calls sendmail without parameters and
+ # expects sendmail to find the recipient in the mail headers.
v_to=`echo "$v_msg" | grep -m 1 'To: '`
v_recipient=${v_to:4:50}
else
- v_recipient=$1 # no parameter, sendmail was called with the recipient as parameter
+ v_recipient=$1 # sendmail was called with the recipient as parameter
fi
-if [ $v_recipient != 0 ] ; then
+if [ "$v_recipient" != 0 ] ; then
# trim spaces from recipient email address
v_recipient="${v_recipient// /}"
Or maybe I missed something. I submitted the patch upstream to see if they think it's relevant.
dif wrote:Hope this helps.
Yes, it did! Thank you so much.

Similar Messages

  • Manually configure icloud for mail in OSX 10.6.8

    Hi
    Running SnowLeopard on an iMac. Still using Quicken 2007 which needs rosetta.
    Previously getting mail [MobileMe] worked perfectly. Now no longer so.
    Can anyone advise on how to manually enter an email account in SnowLeopard to access iCloud please?
    Thanks, Rory Scott

    Raischub wrote:
    Thanks to you Roger...
    This solved my Problem
    I Was trying to make Mail work today for now just 7 hours under SnowLeo...
    The tip for changing the Password was it...
    I did everything absolutely correct (and the time spend was for nothing).
    And after Password Change everythings fine.
    In formertimes that was only the behavior of Windows - that has changed. Theres no "Thinking different" any longer... Making Money (with selling new things) is the Motto.
    Wonder what´s not longer supported after next OS Update.
    MAC spits and spits on his customers... Especially on that, who made the company big.
    You had the wrong password and took 7 hours (with help) to figure it out?
    How exactly are Apple responsible for that?

  • Configure Workflow for mailing

    Hi,
    I am looking for step-by-step documents or link how to configure workflow to send external mails if CUSTOM IDoc failed.
    Your help appreciated
    Thanks
    Sa_R

    Hi,
    /people/sapna.modi/blog/2007/04/27/workflows-for-dummies--workflow-builderpart-ii
    aRs

  • Is there a "Configuration utility" for SE android phones?

    Hi, I'm wondering If there Is an application similar to Apples "Iphone Configuration utility" for SE Android phones?
    //Johan

    http://support.apple.com/kb/DL926
    It gives you the ability to craft configuration profiles (for mail, wlan and so on) and activate them on the phone via a PC or Mac. I work in a support enviroment and this would be a great app for us (remote to customers computer and use app to configure phone).

  • XSLT Mapping with Dynamic Configuration for Mail Adapter

    Hi Guys,
    I am wondering if somebody can help me please.
    I have a requirement in which I need to pick up the file from FTP and email it to the user as an attachment with the same file name and content.
    I know it is possible via 3 method either by deploying adapter module or via XSLT or JAVA Mapping.
    I preferred XSLT Mapping because it is easier to use and we don't need to compile the code like JAVA Mapping.
    I have done the XSLT Mapping but the only problem I am facing is that how to copy the file name which we get it from Dynamic Configuration to the Mail ContentDisposition.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:map="java:java.util.Map"
      xmlns:dyn="java:com.sap.aii.mapping.api.DynamicConfiguration"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:output indent="no" />
    <xsl:param name="inputparam"/>
    <xsl:template match="/">
    <!-- change dynamic configuration -->
        <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/File', 'FileName')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
        <xsl:variable name="dummy"
            select="dyn:put($dynamic-conf, $dynamic-key, $new-value)" />
        <!-- copy payload -->
    I tried many option but unfortunately none of them worked.
    <Content_Disposition>attachment;filename="$inputparam"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-conf"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-key"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dynamic-value"</Content_Disposition>
    <Content_Disposition>attachment;filename="$dummy"</Content_Disposition>
             <Content_Disposition>
                attachment;filename=
                <xsl:value-of select="dynamic-key"/>
             </Content_Disposition>
    I really appreciate if someone can please provide some guidance.
    Thanks,

    Hi,
    Yes u r correct it will show error in operation mapping.. bcoz u cannot check the DynamicConfiguration in Operation mapping...
    It will throw Exception..
    The parameter to UDF depends on ur requirement.... Let us know ur requirements exactly...
    If u r doing for file to file means no UDF required,, just check ASMA on both sides....
    Babu

  • Configure e-mail output

    Hi Gurus
    Can somebody send me informaton on how to configure e-mail output for a sales order/delivery document/invoice. I know how to do it for a printer but I want for e-mail.
    My e-mail is: [email protected]
    thanks all
    Srini

    Hi
    If your SD output configuration is set up correctly, an e-mail from SAP using medium 5 should go through just fine via SAPconnect (transaction SCOT). When it works, the external recipient should receive an e-mail with a PDF attachment containing the form image, regardless of whether it has been created via SAPscript or Smart Forms. Depending on your output determination settings, this even can happen in the background, without any interaction with the SAP front end (e.g. for invoices created automatically by a batch job).
    Typically, a failed send will be flagged in the message control table (NAST), and this table should be monitored closely. However, there are many reasons why a document hasn't gone through, and this can be the case with both outgoing faxes and e-mails from SAP. The solution to both is the same: After identifying the failed document, re-send it manually by going inside it in change mode and repeating the appropriate output. If an obsolete customer e-mail address was the culprit, a customer master change would also be required, along with an audit of any docs recently created for this customer.
    If any underlying data has changed since initial issuance, a re-sent document may not appear identical to the (failed) original. Sometimes, as when address info has been corrected, this can be a good thing. After all, the new document is more accurate than the old one.
    In other cases, such as when pricing info has changed, it might be a cause for serious concern. There are several ways to deal with this concern:
    1) Limit the types of changes allowed on certain docs after creation
    2) Set up a doc image archive via ArchiveLink and re-issue output from there instead of from the current doc; or
    3) For highly sensitive docs, consider a more secure delivery method.
    <b>sending  smart form</b>
    You didn't specify the nature of the form or print program, but I suspect we are discussing application-driven output.
    In any case, I suggest you take a close look at the print program. If it is a standard one provided by SAP, it is quite possible that hooks already exist to send your Smart Form output via e-mail as a PDF attachment.
    See for example the call to function 'LF_FM_NAME' in standard print program RLB_INVOICE. Notice the preceding call to function WFMC_PREPARE_SMART_FORM? This function does the heavy lifting for you; here, no additional work is needed in either the form or the print program. To generate e-mail output, the remaining work essentially is:
    1) SD output configuration (e.g. mapping the relevant billing output type to transmission medium 5 - 'External send' - via the IMG)
    2) SAPconnect configuration (txn SCOT -- there are several notes in the SAP Service Marketplace discussing this component, such as 152474 and 312690).
    3) Setting up the sender and recipient e-mail addresses (e.g. sender = txn SU3 data; recipient = bill-to party's txn XD02 data).
    Hopefully, the print program at issue has the hooks you need. If not, you may need to explore the possibility of (a) changing it, (b) cloning it and changing the cloned version, or (c) manipulating the values directly within the form itself via field-symbols (which may or may not work). Whichever approach you take, I wish you luck.

  • Custom E-mail instead of Standard e-mail for PO Output type standard config

    The requirement goes something like this..
    "We need to create a custom table and based on the values maintained in this custom table the email addresses would be displayed when the user saves a PO. The user would select a email address from the list of email address that is shown on the screen. User would get a message confirming the email address that has been selected.
    Output type would be configured to use the standard email program to send out mails. We need to ensure that the email address which would usually be the vendor's mail address is replaced with this new email address selected by the user. This functionality should work for ME9F as well."
    My questions -
    1) Which medium to be chosen in O/P type configuration for sending out standard e-mail. Is the PO Details send out via attachment or in the body of the mail? How would that be configured?
    2) Output type would be configured to use the standard email program to send out mails. - If this is done, is there any exit where i can handle the change of e-mail address?
    3) In case, i attach a Z-program for that output type, how it can be handled.

    Hi abhisek,
    You try for Implicit enhancement where you call screen as popup. Design POPUP screen as per requirement which will fetch details from your Custom table. Find the internal table which contains the standard email ids maintained through the ran transaction and  update the existing EMAIL ID in that statndard internal table.
    Hope this will guide you to proceed.
    Thanks
    Sumesh

  • Mail output for Invoice Verification

    Hi All,
    I am SD consultant and got requirment to work on related to MM. searched a lot but not able to get answer to my querry looking for.
    The requirment is to send Invoice to vendor by e-mail message. as soon as we save the invoice for vendor (MIRO) need to send same invoice to Vendor.
    As far as I knwo I maintained data like vendor Mailing address in vendor master.
    Can you guys guide me with complete implementation / configuration steps.
    Thanks in advance
    Vishal

    Hi
    To  check config step  
    1> Execute  NACE  -t-code
    2>  Look for  application  MR,  (High light)
    3>  Look for  output type condition   ( EINK   or depend on requirement) .
    4> Check  for attached program ,Form Routine, Attached form
    5 > Maintain  medium , partner function
    Then  create  out put record  MRM1  for the output condition.
    Thanks
    Dilip

  • How to configure Workflow Notification Mailer for oracle alert in R12

    Hi all....,
    How to configure Workflow Notfication mailer for oracle Alert in R12. Please provide the complete steps.. Its urgent.. Plz help me..
    Regards ,
    Madhan

    Duplicate thread (please post only once)
    plz help me...!!!! Workflow Notification Mailer
    plz help me...!!!! Workflow Notification Mailer

  • How can I save a page and all its component parts in a single file, like IE does as an MHT - it's much easier for mailing to people where page address not available?? (as in output from an airline booking site, for example)

    how can I save a page and all its component parts in a single file, like IE does as an MHT?
    It's much easier for mailing to people where page address not available?? (as in output from an airline booking site, for example)
    It is simply too painful to have to zip everything up into a single file to send. MHT format has been available for years now from IE, and with every new FF release it's the first thing I look for. I have been using FF for years, and hate having to come out of it, over into IE |(which I even took out of startup) and key everything in again, in order to send somebody something in a convenient format that they can open with a single click.
    I can't believe this hasn't been asked before, so have you looked at it and rejected it? Have MS kept the file format secret?
    Thanks
    MG

    This is not really an answer just my comments on your question.
    I am sure I recollect efforts being made to get mhtml to work with FF.
    Probably the important thing to remember about .mhtml is that if other browsers do support it they may need addons, and may not necessarily render the content correctly/consistently.
    There are FF addons designed for archiving webpages, you could try them, but that then assumes the recipient has the same software.
    You could simply save the page from FF to your XP pc; then offline open it with and save it using IE, before then emailing using FF, and attaching the .mht or mhtml file that you have now created on your PC.
    As an alternative method, in some cases it could be worth considering taking a screen grab of the required page, then sending that to the recipient as a single email attatchment using either a bitmap or jpeg file format for instance.
    Something such as an airline booking may be designed with a print option, possibly it could be worthwile looking at sending the print file itself as an email attachment.

  • How to configure N9 for push e-mail?

    Does anybody know how to configure N9 for push e-mail? It should be possible because push email is part of Nokia's N9 official specs but I'm unable to find any reference in the manual or online.

    I know that I am late to the party but just got my N9.  The push email works fine for my Exchange & my Gmail but for my mail.com account (which I believe is really AOL) it only syncs when I manually tell it to.  I have it set to "always up to date" ... does anyone have any ideas?
    Thanks!
    Update: just fixed it myself but in case it helps anyone I turned on the Push Notifications & that did the trick.  Which is kind of odd bc I notifications from my Gmail & MS Exchange automatically did it but I guess that feature has to be turned on for this email. 
    Wish all the features on the N9 had the "I" icon which you could press for more info as I thought that option would just let you know when your email was syncing (like the little arrow on the top right).  Oh well - now if I can just get my contacts/calendar off of my PC's OutLook & onto my N9 ...................
    Cheers!

  • Help configuring PulseAudio for 2.1 on laptop [SOLVED]

    Hello
    I've been trying to figure out how to properly configure PulseAudio for my laptop for the past couple of nights, but haven't had much luck.  I'm may be misunderstanding my laptop's audo setup correctly.  Seeing stuff like True 5.1, Dobly Home Theater, and Virtual SurroundSound confused me, but right now I think 5.1 is only for HDMI output (which I don't use).  My laptop has a so-called subwoofer and in alsamixer I have controls for front and lfe.
    By default, pulseaudio chooses stereo, which sounds fine for anything that stereo or mono, but if I play a DVD in VLC I can barely hear voices and but hear parts of music and background sounds.
    Also, for some reason if I run speaker-test -c 2 -t wav.  Front-left is loud and somewhat distorted while Front-right is really soft.  Yet it still sounds fine (to me) when listening to non-surround content.
    Everything worked perfectly before pulseaudio was pulled in.
    I tried following this post on manually loading the alsa sources and sink modules, but it didn't work.
    Running pulseaudio in verbose mode showed that hw:0 doesn't support 3 channels and then defaults to stereo.
    default-sample-channels = 3
    default-channel-map = front-left,front-right,lfe
    I also just tried the above in daemon.conf just to see what would happen but, it ignored it... 
    What am I doing wrong?  Am I going about this the wrong way?
    Any help would be much appreciated.
    More information:
    My laptop series/specs:
    http://support.acer.com/acerpanam/noteb … 0sp2.shtml
    uname -a
    Linux archlaptop 3.0-ARCH #1 SMP PREEMPT Wed Oct 19 12:14:48 UTC 2011 i686 AMD Athlon(tm) X2 Dual-Core QL-62 AuthenticAMD GNU/Linux
    aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: SB [HDA ATI SB], device 0: ALC888 Analog [ALC888 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 0: SB [HDA ATI SB], device 1: ALC888 Digital [ALC888 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    default.pa
    ### Load audio drivers statically
    ### (it's probably better to not load these drivers manually, but instead
    ### use module-udev-detect -- see below -- for doing this automatically)
    #load-module module-alsa-sink
    #load-module module-alsa-source device=hw:1,0
    #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
    #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
    #load-module module-null-sink
    #load-module module-pipe-sink
    load-module module-alsa-source device=hw:0
    load-module module-alsa-sink device=hw:0 channels=3 channel_map=front-left,front-right,lfe
    ### Automatically load driver modules depending on the hardware available
    #.ifexists module-udev-detect.so
    #load-module module-udev-detect
    #.else
    ### Use the static hardware detection module (for systems that lack udev/hal support)
    #load-module module-detect
    #.endif
    Last edited by Vortalex (2011-11-14 05:20:52)

    Update.
    I got vlc to work right.  Yay!
    I deleted my .vlc directory
    Then, manually set the output to alsa (and set Device to Default) which then ungrayed the Audio > Audio Device menu to select Stereo
    edit:
    I noticed I loose audio in VLC if I pause or seek around too much...   Work around for now is to disable and reenable the audio.
    looking with pavucontol vlc is still there, it just doesn't do anything.
    anyway, this new problem is probably for a different thread
    Last edited by Vortalex (2011-11-14 06:34:33)

  • Configuring Server DNS for Mail on Google Apps

    I'm trying to configure the DNS on my Snow Leopard Server for mail.mydomain.com to point to Google for Google Apps mail hosting.
    I thought I could go into mydomain.com and put an alias record to point to ghs.google.com, but that's no longer working. Any ideas of how to get around this? Is there something else I'm doing wrong?

    I figured out the problem. It had to do with an alias record hanging up the DNS.

  • Output Determination Configuration Setting for GoodsIssue(Transfer Posting)

    Hello Gurus,
    Can any one give the details for Output Determination Configuration Setting for Goods Issue(Transfer Posting).
    Thanks N Regards,
    Venu MG

    hi,
    PRINT OUT OF MATERIAL DOCUMENT AT GI/Transfer posting:
    1. Maintain the Printer Name in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Printer Setting
    2. Ensured in SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Item Print Indicator, 1 stands for Matl Doc print out
    3. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Gen Settings->Print Version, maintain Print Version 2
    4. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Print Control->Maintain Print Indicator for GI/Transfer Posting Documents
    5. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Maintain Output Types, for the Output types WE01, WE02 and WE03, ensure the foll:
    a. Default Values: Dispatch Time is 3 or 4 as per reqmt. and Tr medium is 1
    b. Print Parameter is 7
    6. In SPRO->Matl Mgmt->Inv Mgmt and Phy Inv->Output Determination->Printer Det->Pr Det by Pl/StoLoc, maintain the Output device for all your Plants
    7. In MN21, for Tr Type WE, Print Version 3, maintain Print Item as 1.(Condition records)
    8. While doing MIGO, ensured that in General Tab, you get "3 Collective Slip" beside the Print Indicator and you tick mark the field.
    Now go to MB90 entered the output type as WE01, Tr m as 1, Sort or. 01, Pro.mode as 01, and executed. Sytem outputted all the material documents that has to be taken print out.
    Regards
    Priyanka.P

  • User exit to change vendor e-mail address used for PO output via e-mail...

    We have two vendor e-mail addresses for a particular vendor. Ignoring output determination, it looks like I will need to control which of the two e-mail vendor addresses is used when the PO is output via e-mail.
    The default is the first one e-mail address, but for PO's I would like to force the second vendor e-mail address.
    There are tonnes of exits available for PO output by the looks of it so I am trying to discover which is relevant for what I am trying to achieve.
    Jas
    Edited by: Jason Stratham on Apr 30, 2009 5:53 PM

    Thanks Martin,
    I guess that's the same path that I took earlier when using SPRO and looking at the Purchasing->Messages. In my case it's ZMEDRUCK, but that does not help me in regards to controlling the vendors e-mail address being used. When sending the PO as an e-mail it uses (by default) the first e-mail address of the Vendor, whereas the vendor could have multiple ones. In my test case my vendor has two addresses but it always defaults to using the first. I know that I need to modify this behaviour somehow, but how I have no idea as I can find no Exit routine.
    Jas

Maybe you are looking for

  • CRM Survey

    Hello Forum,    As per our  business scenario once the Interaction Record or a Complaint is created and saved the Survey is to be triggered and once the customer on receiving an survey URL the customer clicks on the survey link URL, submits his respo

  • Changing preview panel transparency background in Adobe Bridge CC

    Can the background color showing transparency in the Adobe Bridge CC preview panel be changed from the default black to white?

  • Video mirroring iPad 2 + Component AV Cable

    Can I use a Component Av Cable to video mirroring my iPad 2? I have the VGA adapter an it works great for that purpose but I'd like better quality output than just VGA. Have you tested this combination? Thanks

  • Installing iTunes failes at QuickTime

    I am trying to install iTunes on Windows XP and when it gets to QuickTime, it gives me: QuickTime installation failed: Error Code: -3 OK is the only button to push. When I run iTunes, it says a lower version of QT is installed and I need to re-instal

  • TS2755 how do I retrieve my deleted messages

    I have deleted some information in text messages, some just got old and went away...how do I retrieve these messages..?