Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I created an smtp mail server and it was successfully configured using postfix, dovecot, and roundcube.
Wanting to add functionality and to get active directory users to authenticate, I chose to use pbis (http://download1.beyondtrust.com/Technical-Support/Downloads/PowerBroker-Identity-Services-Open-Edition/?Pass=True) and found that I was able to easily add to the Active Directory domain ultimately using this command after install and completing a few prerequisites:
$ ./domainjoin-cli join TEST.LOCAL testuser
where "TEST.LOCAL" is the domain in active directory and "testuser" is a user account I set up in the active directory domain.
When logging into the account on roundcube:
I use: TEST\testuser and I am able to successfully login
This required a slight change to the dovecot configuration file /etc/dovecot/conf.d/10-auth.conf and adding the "\" to the list of characters under "auth_username_chars"
I can send an e-mail to a system linux account "user" and verify receipt of that e-mail. I have to change the outgoing e-mail address from TEST\testuser#test.local to testuser#test.local because of incorrect syntax.
What I can't seem to do is send mail to the active directory account "testuser"
I get the following error when attempting this:
SMTP Error (550): Failed to add recipient "testuser#test.local" (5.1.1 <testuser#test.local>: Recipient address rejected: User unknown in local recipient table).
This seems to correspond to alias mapping but I don't know how to do that and the guides I am finding online don't seem to quite fit what I am looking to do. No, I do not have virtual mapping. The user accounts I am trying to map to are all under this directory:
/home/local/TEST/
My question is basically this: How do I map "testuser#test.local" to "TEST\testuser#test.local" in postfix?
Actually submitted this a bit prematurely because I found my answer but had to alter it to my environment to get it to work.
Following the directions on: www.electrictoolbox.com/update-postfix-virtual-alias-map was incredibly helpful.
The exception was the /etc/postfix/virtual file had to have the windows slashes in it.
Basically what I did was
Add a line to /etc/postfix/main.cf
virtual_alias_maps = hash:/etc/postfix/virtual
Created a /etc/postfix/virtual file with the following contents:
testuser#test.local TEST\\testuser
Applied the settings:
postmap /etc/postfix/virtual
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 1 year ago.
Improve this question
I think that we all deal comfortably with programming in case there is an Internet connection, especially if we are dealing with a server , But gentlemen, there are terrifying and disturbing results in the event that the user does not have an Internet connection , Imagine that there is a server connected to the Internet that interacts with the user's input , I often wonder what is the global applications use in such a case
I'm going to make it simple what is the problem I'm facing
i am building flutter app using dart and Firebase ..
well lets say user sent data to firestore Let's say it's a message for example
int count ;
FirebaseFirestore.instance.collection(widget.documentUid).doc(currentUser.uid).set({
"timestamp": DateTime.now(),
"name": currentUser.name,
"receiverUid": widget.documentUid,
"countM" : count++
});
well everything going to be perfect here If the user has an internet connection .
What I noticed is that the same process in the event that there is no internet connection is that the data sent will not wait for the connection again and therefore the process will be canceled .. This is a shame :( .. user will never accept like this app .. and it is only a example from many like count messages and delete messages and read messages which i developed them to be Responsive with the server how could i deal with this problem ..
and please no one tell me to chick internet state before , because this process it self will never make data to wait ,
Is there a data caching control?
Is there a library that handles this?
Is there a way to control the user's input in in case no Internet connection and make it wait until the connection again and execute without losing anything?
Is there anything important that I missed?
This process is not automated. You will have to handle offline/online cases yourself.
This package allows you to stream the connectivity status:
https://pub.dev/packages/connectivity_plus
You can use this with provider to rebuild UI whenever the stream changes.
Also, firebase itself has some level of caching, but I would recommend using an offline database like hive to sync with your online data incase internet connection is lost. You can also store the state of your navigator in the database when connection is lost and switch to the offline database. When connection is back, reload the state and continue. If only online data is to be shown, make a page which shows internet connectivity lost and switch the UI using the connectivity stream.
As for messages, don't use async on your firestore writes and it will automatically write to the database when internet connection is back on. But again, if the app was closed when internet was lost, this won't happen. To enable this, when internet goes offline, store the messages in the hive db and then when its back online or the user starts the app with internet, it will push the messages with the relevant timestamps.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Where do you usually store the bot token/API key for a discord bot or any program that integrates a bot token? I just have mine stored in the main.py file. Is there an agreed upon way to store keys and tokens such as a discord bot token? My bot works fine but I would like to know if there is a specific way to store these values or if it's something preferential like using single quotes or double quotes.
I've seen one example of a discord token being stored in a separate JSON file. Is this the preferred way to store keys and tokens in?
I'll show you a quick example of what I'm talking about.
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='-', case_insensitive=True)
#bot.event
async def on_ready():
print(f"{bot.user.name} is online and ready to go! Bot id: {bot.user.id}")
bot.run('botToken')
# I have mine placed right here in the botToken value.
This quick overview should only be considered if you are working on a hobby project. If you are doing anyhting commercial, be more serious about it.
Leaving the token in your file (hardcoding it)
Pro
Quick
Contra
Your token is easily exposed if you forget that you have your token in your file and e.g. upload it to Github
Putting it in a JSON/toml/other seperate file
Pro
Still quite quick
You can gitignore the file where you are storing the token
Contra
You need to parse the token every time you need it
still insecure if someone gets ahold of your file (for example if you forget to gitignore it)
Saving your token as a system variable
Pro
Doesn't work from a different machine -> very hard for someone to get ahold of it
Quite quick
Contra
You need to be able to access system variables
Hard to containerize
These are the main "quick and dirty" options. If you have a question about how any specific option works, you may ask here. If you want to know how to implement a specific option, ask another question on Stackoverflow.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I am having some trouble with my upload CakePHP 2.4.6 to GoDaddy. Specifically the file "CakeResponse.php" doesn't want to upload correctly. When I upload it GoDaddy appends a ".gdav" extension to it, and changes the permissions to "00".
I am using FileZilla 3.7.3 and have tried renaming it (both on server and locally), which works but does nothing. And it doesn't allow me to change permissions on the file.
Command: SITE CHMOD 704 CakeResponse.php
Response: 550 Could not change perms on CakeResponse.php: Permission denied
Any thoughts on what the problem might be?
Update: I've downloaded Cake v2.4.0 and CakeResponse will still not upload. I've also tried from my Windows PC at work using FileZilla 3.7.4.1
Based on the previous comment, my guess is that gdav stands for GoDaddy antivirus...
I went ahead and called them and yes it is their new antivirus they are still working the bugs out on.
I got around the issue by using the "File Manager" website that GoDaddy provides, which allowed me to upload the file with permissions.
In hopes of helping to lead to an answer with another case study, let me share the experience I had with the same issue, but on a WordPress file:
/wp-admin/includes/ajax-actions.php
Here are my specs:
GoDaddy Deluxe Web Hosting, Linux
Cyberduck v 4.2.1
Also tried in FileZilla v 3.6.0.2 (same results)
MacBook, OS X v 10.6.8
To be clear, I also could not change permissions (although it deceptively acted like it was letting me) and renaming the file didn't help me either. I also tried uploading a new dummy file with a different name (work.php) and with different content (I think "WORK!" was all I wrote in it), which uploaded fine with normal permission (704 I think). I then tried pasting the contents of the above ajax-actions.php into it and re-uploading it. It added a .gdav to that file as well and changed the permissions to 000.
Using GoDaddy's File Manager became my workaround as well, thanks to timmsimpson (I may not have thought of that).
Yep, issue with Go Daddy Anti-virus. login to GD host control panel, go to the File Manager, rename the file and remove the .gdav extension, select the file, change the file permissions to 644.
Update: I'm not sure if this is related to gdav, but for the past 3 weeks my WordPress sites, which normally load in 2 seconds are taking 5 seconds to never loading (connection resets, lost DB connections, etc) intermittently throughout the day every day for 3 weeks now. The other thing that was implemented 3 weeks ago on GD was SiteLock. Also this time of year is infrastructure rebuild/enhancement time at GD. POD6 is currently hosed.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Can anyone tell me if it is possible to change the linux system password at a given time interval (ex. once every 7 days) using shell script or any other programming technique without explicitly changing it? The script should be running continuously to check if the time interval has passed and if it has, then to change the passwd to some default password mentioned in the script itself.
It may work to put on the cron job
passwd --expire username
This will expire the password for the given account immediately, forcing to change it at the second login. You can setup the job to run at any time policies you need, and (if run as root) this command will have effect on any specified user.
It is not secure to set some explicit password you later need to tell somehow to the user. It may be better to allow the user to think the password.
Use cron to schedule your script.
I agree this seems like a Bad Idea, but I don't know why you want to do this.
It is a Very Bad Idea. Without root, you are screwed for good. And messing with the relevant files by a script is a terrible idea on its own.
If you want to disallow root login at all, give it an impossible password (like * in the password field in /etc/shadow. Just make sure to have the rescue disk at hand...
Or use the "password aging", check out passwd(5) and shadow(5).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I wish to make a regular backup of my notes stored on my iPhone, iPad and Mac OS in the standard Notes.app. Unfortunately since Apple moved these from their standard IMAP format to a database format (and added a separate app) this is close to impossible.
I currently have over 200 notes and growing. I suppose they are stored in a standard database format and get synced to iCloud and pushed to all devices.
Notes seems to store its data in this path:
"Library/Containers/com.apple.Notes/Data/Library/Notes/"
If anyone of you can reliable read, and perhaps even backup/restore this database, then please comment.
There is an Apple KB article HT4910 that deals with this issue, which proves of little help. In fact their method complicates issues and is very unelegant for multiple backups.
Time Machine, Apple's own built-in backup solution is also of little help as it seems to skip backup and allow no restore for notes.
I'd be grateful if someone could peruse this and come up with solutions, which would be appreciated certainly by many of the growing community of iCloud users.
Ok, this is a somewhat incomplete answer but I wanted to post it so people may be able to contribute.
Using this LSOF command:
lsof -c Notes | GREP /Users/
I was able to figure out that most of the Notes.app data was being stored here:
/Users/USERNAME/Library/Containers/com.apple.Notes/Data/Library/Notes
In that folder there are three files (for me at least):
NotesV1.storedata
NotesV1.storedata-shm
NotesV1.storedata-wal
Which strangely enough pointed me in this direction:
https://superuser.com/questions/464679/where-does-os-x-mountain-lion-store-notes-data
I also found a SqlLite cache database here:
/Users/USERNAME/Library/Containers/com.apple.Notes/Data/Library/Caches/com.apple.Notes/Cache.db
Though investigating it with Sqlite3 only turned up a few un-interesting tables:
sqlite> .tables
cfurl_cache_blob_data cfurl_cache_response
cfurl_cache_receiver_data cfurl_cache_schema_version
If you need to get back your notes, you first disconnect from internet... Then copy your notes to a safe place (desktop).. Then delete the folder at your library and then copy the safe folder back to notes at library...
you can see one old file date..that is the main file you need to get back the notes.. You can delete the other 2 new dated ones as they are copy from icloud..
Now you can enjoy opening your note.app and you will see all your old notes are back
I was poking around trying to accomplish the same thing and found where the notes are stored in 10.8.5 Mountain Lion. It is very straight forward. The location is as follows:
/Users/(your user)/Library/Mail/V2/Mailboxes/Notes.mbox/(long number with hyphens)/Data/Messages/
The individual notes are stored in that location with a number.emlx name format.
if you copy the Notes.mbox, that should get them all.